Package org.apache.jdo.model.java

Examples of org.apache.jdo.model.java.JavaModel


     * support <code>null</code> keys.
     */
    public JavaModel getJavaModel(Object key)
    {
        synchronized (modelCache) {
            JavaModel javaModel = (JavaModel)modelCache.get(key);
            if (javaModel == null) {
                // create new model and store it using the specified key
                try {
                    javaModel = createJavaModel(key);
                    modelCache.put(key, javaModel);
View Full Code Here


     */
    public static JavaType resolveType(JDOModel jdoModel, String typeName,
                                       String packagePrefix)
    {
        JavaType type = null;
        JavaModel javaModel = jdoModel.getJavaModel();
        if (primitiveTypeNames.contains(typeName) ||
            (typeName.indexOf('.') != -1) ||
            (packagePrefix == null) || (packagePrefix.length() == 0)) {
            // Take the typeName as specified,
            // if typeName denotes a primitive type or is a qualified name
            // or if there is no packagePrefix (default package)
            type = javaModel.getJavaType(typeName);
        }
        else {
            // Not a primitive type and not qualified and packagePrefix
            // specified => qualify using packagePrefix
            type = javaModel.getJavaType(packagePrefix + typeName);
            if (type == null) {
                // If type could not be resolved =>
                // use java.lang. package prefix as qualifier
                type = javaModel.getJavaType("java.lang." + typeName); //NOI18N
            }
        }
        return type;
    }
View Full Code Here

TOP

Related Classes of org.apache.jdo.model.java.JavaModel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.