Examples of JavaType


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

            // field has persistence modifier none => cannot be a relationship
            return null;
                           
        // check the type if available
        JDORelationship rel = null;
        JavaType type = getType();
        if (type != null) {
            if (type.isValue() || TypeSupport.isValueArrayType(type)) {
                // no relationship
                rel = null;
            }
            else if (type.isJDOSupportedCollection()) {
                rel = createJDOCollectionInternal();
            }
            else if (type.isJDOSupportedMap()) {
                rel = createJDOMapInternal();
            }
            else if (type.isArray()) {
                rel = createJDOArrayInternal();
            }
            else {
                rel = createJDOReferenceInternal();
            }
View Full Code Here

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

            // return javaProperty, if explicitly set by the setter
            return javaProperty;
        }
       
        // not set => calculate
        JavaType javaType = getDeclaringClass().getJavaType();
        return javaType.getJavaProperty(getName());
    }
View Full Code Here

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

            // return objectIdClass if explicitly set by the setter
            return objectIdClass;
        }

        // not set => try to resolve ObjectId class
        JavaType type = null;
        String name = getDeclaredObjectIdClassName();
        if (name != null) {
            JavaModel javaModel = getDeclaringModel().getJavaModel();
            type = javaModel.getJavaType(name);
            if (Modifier.isAbstract(type.getModifiers()))
                // do not return ObjectId class if abstract
                type = null;
        }
        else {
            JDOClass superclass = getPersistenceCapableSuperclass();
View Full Code Here

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

        if (declaredObjectIdClassName != null) {
            // ObjectId is declared, but it might not be qualified
            int index = declaredObjectIdClassName.indexOf('.');
            if (index == -1) {
                // not qualified => try to resolve it
                JavaType type = TypeSupport.resolveType(getDeclaringModel(),
                    declaredObjectIdClassName, getPackagePrefix());
                if (type == null) {
                    throw new ModelFatalException(
                        msg.msg("EXC_CannotResolveObjectIdClass", //NOI18N
                                declaredObjectIdClassName, getName()));
                }
                this.declaredObjectIdClassName = type.getName();
            }
        }
        else {
            // not declared, check for single field ObjectId class
            JDOField[] declaredPKFields = getDeclaredPrimaryKeyFields();
            if ((declaredPKFields != null) && (declaredPKFields.length == 1)) {
                // there is one pk field declared by this class =>
                // check the type
                JavaType fieldType = declaredPKFields[0].getType();
                if (fieldType != null) {
                    return TypeSupport.getSingleFieldObjectIdClassName(
                        fieldType.getName());
                }
            }
        }
        return declaredObjectIdClassName;
    }
View Full Code Here

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

        if (pcSuperclassName != null) {
            // pcSuperclassName is declared, but it might not be qualified
            int index = pcSuperclassName.indexOf('.');
            if (index == -1) {
                // not qualified => try to resolve it
                JavaType type = TypeSupport.resolveType(getDeclaringModel(),
                    pcSuperclassName, getPackagePrefix());
                if (type == null) {
                    throw new ModelFatalException(
                        msg.msg("EXC_CannotResolvePCSuperClass", //NOI18N
                                pcSuperclassName, getName()));
                }
                this.pcSuperclassName = type.getName();
            }
        }
        return pcSuperclassName;
    }
View Full Code Here

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

        }
       
        // not set => try to resolve persistence capable superclass
        String name = getPersistenceCapableSuperclassName();
        if (pcSuperclassName != null) {
            JavaType type = TypeSupport.resolveType(
                getDeclaringModel(), pcSuperclassName, getPackagePrefix());
            if (type == null) {
                throw new ModelFatalException(
                    msg.msg("EXC_CannotResolvePCSuperClass", //NOI18N
                            pcSuperclassName, getName()));
            }
            JDOClass jdoClass = type.getJDOClass();
            // pcSuperclassName might be unqualified
            this.pcSuperclassName = type.getName();
            return jdoClass;
        }

        return null;
    }
View Full Code Here

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

     * @return the JavaType representing the component type of this
     * JavaType if this class is an array; <code>null</code> otherwise.
     */
    public JavaType getArrayComponentType()
    {
        JavaType componentType = null;
        if (isArray()) {
            Class componentClass = clazz.getComponentType();
            if (componentClass != null)
                componentType = getJavaTypeForClass(componentClass);
        }
View Full Code Here

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

    public JavaField getJavaField(String fieldName)
    {
        JavaField javaField = getDeclaredJavaField(fieldName);
        if (javaField == null) {
            // check superclass
            JavaType superclass = getSuperclass();
            if ((superclass != null) &&
                (superclass != PredefinedType.objectType)) {
                javaField = superclass.getJavaField(fieldName);
            }
        }
        return javaField;
    }
View Full Code Here

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

     * @return the component type of the property type in case of an array or
     * collection.
     */
    public JavaType getComponentType()
    {
        JavaType componentType = null;
        JavaType type = getType();
        if (type.isArray())
            componentType = type.getArrayComponentType();
        else if (type.isJDOSupportedCollection())
            componentType = PredefinedType.objectType;
        return componentType;
    }
View Full Code Here

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

    public JavaProperty getJavaProperty(String name)
    {
        JavaProperty javaProperty = getDeclaredJavaProperty(name);
        if (javaProperty == null) {
            // check superclass
            JavaType superclass = getSuperclass();
            if ((superclass != null) &&
                (superclass != PredefinedType.objectType)) {
                javaProperty = superclass.getJavaProperty(name);
            }
        }
        return javaProperty;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.