Package org.apache.jdo.model.java

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


            }

            // field not known by JDOClass (not specified in JDO XML)
            // apply model's method of default calculation without
            // changing the model's state
            JavaType fieldType = javaModel.getJavaType(javaModel.getTypeName(fieldSig));
            affirm(fieldType != null,
                   "cannot get java type for: " + fieldSig);
            return !TypeSupport.isPersistenceFieldType(fieldType);
        } catch (ModelFatalException ex) {
            throw new EnhancerMetaDataUserException(ex);
View Full Code Here


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

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

     * Get the JDOClass corresponding to the type or element of this
     * relationship.
     * @return the related class
     */
    public JDOClass getRelatedJDOClass() {
        JavaType relatedType = getRelatedJavaType();

        if (relatedType != null) {
            JDOClass myClass = getDeclaringField().getDeclaringClass();
            String relatedTypeName = relatedType.getName();

            if (relatedTypeName.equals(myClass.getName()))
                return myClass;
       
            return myClass.getDeclaringModel().getJDOClass(relatedTypeName);
View Full Code Here

        if (field != null) {
            return new BaseReflectionJavaField(field, this);
        }
       
        // check superclass, if available and other than Object
        JavaType superclass = getSuperclass();
        if ((superclass != null) && (superclass != PredefinedType.objectType)) {
            return superclass.getJavaField(fieldName);
        }
       
        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

    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

     * <code>null</code> if not present in this model instance.
     */
    public JavaType getJavaType(String name)
    {
        synchronized (types) {
            JavaType javaType = (JavaType)types.get(name);
            if (javaType == null) {
                try {
                    final boolean initialize = false;
                    Class clazz = ReflectionJavaModelFactory.forNamePrivileged(
                        name, initialize, classLoader);
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.