Java Code Examples for com.sun.codemodel.internal.JCodeModel#directClass()

The following examples show how to use com.sun.codemodel.internal.JCodeModel#directClass() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TypeUtil.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Obtains a {@link JType} object for the string representation
 * of a type.
 */
public static JType getType( JCodeModel codeModel,
    String typeName, ErrorReceiver errorHandler, Locator errorSource ) {

    try {
        return codeModel.parseType(typeName);
    } catch( ClassNotFoundException ee ) {

        // make it a warning
        errorHandler.warning( new SAXParseException(
            Messages.ERR_CLASS_NOT_FOUND.format(typeName)
            ,errorSource));

        // recover by assuming that it's a class that derives from Object
        return codeModel.directClass(typeName);
    }
}
 
Example 2
Source File: TypeUtil.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Obtains a {@link JType} object for the string representation
 * of a type.
 */
public static JType getType( JCodeModel codeModel,
    String typeName, ErrorReceiver errorHandler, Locator errorSource ) {

    try {
        return codeModel.parseType(typeName);
    } catch( ClassNotFoundException ee ) {

        // make it a warning
        errorHandler.warning( new SAXParseException(
            Messages.ERR_CLASS_NOT_FOUND.format(typeName)
            ,errorSource));

        // recover by assuming that it's a class that derives from Object
        return codeModel.directClass(typeName);
    }
}
 
Example 3
Source File: TypeUtil.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Obtains a {@link JType} object for the string representation
 * of a type.
 */
public static JType getType( JCodeModel codeModel,
    String typeName, ErrorReceiver errorHandler, Locator errorSource ) {

    try {
        return codeModel.parseType(typeName);
    } catch( ClassNotFoundException ee ) {

        // make it a warning
        errorHandler.warning( new SAXParseException(
            Messages.ERR_CLASS_NOT_FOUND.format(typeName)
            ,errorSource));

        // recover by assuming that it's a class that derives from Object
        return codeModel.directClass(typeName);
    }
}
 
Example 4
Source File: TypeUtil.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Obtains a {@link JType} object for the string representation
 * of a type.
 */
public static JType getType( JCodeModel codeModel,
    String typeName, ErrorReceiver errorHandler, Locator errorSource ) {

    try {
        return codeModel.parseType(typeName);
    } catch( ClassNotFoundException ee ) {

        // make it a warning
        errorHandler.warning( new SAXParseException(
            Messages.ERR_CLASS_NOT_FOUND.format(typeName)
            ,errorSource));

        // recover by assuming that it's a class that derives from Object
        return codeModel.directClass(typeName);
    }
}
 
Example 5
Source File: TypeUtil.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Obtains a {@link JType} object for the string representation
 * of a type.
 */
public static JType getType( JCodeModel codeModel,
    String typeName, ErrorReceiver errorHandler, Locator errorSource ) {

    try {
        return codeModel.parseType(typeName);
    } catch( ClassNotFoundException ee ) {

        // make it a warning
        errorHandler.warning( new SAXParseException(
            Messages.ERR_CLASS_NOT_FOUND.format(typeName)
            ,errorSource));

        // recover by assuming that it's a class that derives from Object
        return codeModel.directClass(typeName);
    }
}
 
Example 6
Source File: TypeUtil.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Obtains a {@link JType} object for the string representation
 * of a type.
 */
public static JType getType( JCodeModel codeModel,
    String typeName, ErrorReceiver errorHandler, Locator errorSource ) {

    try {
        return codeModel.parseType(typeName);
    } catch( ClassNotFoundException ee ) {

        // make it a warning
        errorHandler.warning( new SAXParseException(
            Messages.ERR_CLASS_NOT_FOUND.format(typeName)
            ,errorSource));

        // recover by assuming that it's a class that derives from Object
        return codeModel.directClass(typeName);
    }
}
 
Example 7
Source File: TypeUtil.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Obtains a {@link JType} object for the string representation
 * of a type.
 */
public static JType getType( JCodeModel codeModel,
    String typeName, ErrorReceiver errorHandler, Locator errorSource ) {

    try {
        return codeModel.parseType(typeName);
    } catch( ClassNotFoundException ee ) {

        // make it a warning
        errorHandler.warning( new SAXParseException(
            Messages.ERR_CLASS_NOT_FOUND.format(typeName)
            ,errorSource));

        // recover by assuming that it's a class that derives from Object
        return codeModel.directClass(typeName);
    }
}
 
Example 8
Source File: TypeUtil.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Obtains a {@link JType} object for the string representation
 * of a type.
 */
public static JType getType( JCodeModel codeModel,
    String typeName, ErrorReceiver errorHandler, Locator errorSource ) {

    try {
        return codeModel.parseType(typeName);
    } catch( ClassNotFoundException ee ) {

        // make it a warning
        errorHandler.warning( new SAXParseException(
            Messages.ERR_CLASS_NOT_FOUND.format(typeName)
            ,errorSource));

        // recover by assuming that it's a class that derives from Object
        return codeModel.directClass(typeName);
    }
}