Package org.apache.jdo.model.java

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


     * @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

    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

     * @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

    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

        if (descrs != null) {
            for (int i = 0; i < descrs.length; i++) {
                PropertyDescriptor descr = descrs[i];
                if (descr == null) continue;
                String name = descr.getName();
                JavaType type =
                    beanClass.getJavaTypeForClass(descr.getPropertyType());
                Method getter = descr.getReadMethod();
                JavaMethod javaGetter = (getter == null) ? null :
                    beanClass.createJavaMethod(getter);
                Method setter = descr.getWriteMethod();
View Full Code Here

            // return embeddedKey, if explicitly set by the setter
            return embeddedKey.booleanValue();
        }
       
        // not set => calculate
        JavaType type = getKeyType();
        return (type != null) ?
            TypeSupport.isEmbeddedElementType(type) : false;
    }
View Full Code Here

            // return keyType, if explicitly set by the setter
            return keyType;
        }
   
        // not set => calculate
        JavaType type = null;
        if (keyTypeName != null) {
            JDOField jdoField = getDeclaringField();
            JDOClass jdoClass = jdoField.getDeclaringClass();
            JDOModel jdoModel = jdoClass.getDeclaringModel();
            type = TypeSupport.resolveType(jdoModel, keyTypeName,
View Full Code Here

            // return embeddedKey, if explicitly set by the setter
            return embeddedValue.booleanValue();
        }
       
        // not set => calculate
        JavaType type = getValueType();
        return (type != null) ?
            TypeSupport.isEmbeddedElementType(type) : false;
    }
View Full Code Here

            // return valueType, if explicitly set by the setter
            return valueType;
        }
   
        // not set => calculate
        JavaType type = null;
        if (valueTypeName != null) {
            JDOField jdoField = getDeclaringField();
            JDOClass jdoClass = jdoField.getDeclaringClass();
            JDOModel jdoModel = jdoClass.getDeclaringModel();
            type = TypeSupport.resolveType(jdoModel, valueTypeName,
View Full Code Here

TOP

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

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.