Package org.apache.jdo.model.java

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


        affirm(classPath);
        affirm(fieldName);
        final String className = classPath.replace('/', '.');
        try {
            final JavaType javaType = javaModel.getJavaType(className);
            final JavaField javaField = javaType.getJavaField(fieldName);
            final JavaType declaringClass = javaField.getDeclaringClass();
            return declaringClass.getName().replace('.', '/');
        } catch (ModelFatalException ex) {
            throw new EnhancerMetaDataUserException(ex);
        }
    }
View Full Code Here


        try {
            final JDOClass clazz = getJDOClass(classPath);
            JavaType javaClass = clazz.getJavaType();
            affirm(javaClass != null,
                   "cannot find class file for class: " + classPath);
            JavaField javaField = javaClass.getJavaField(fieldName);
            affirm(javaField != null,
                   "cannot find java field " + classPath + "." + fieldName);
            JavaType fieldType = javaField.getType();
            JDOField field = clazz.getField(fieldName);
            // if field not known by JDOClass (not specified in JDO XML),
            // create the field only if the model's method of default
            // calculation would yield a persistent field.  We must not
            // change the models state by newly created fields with
View Full Code Here

    /**
     * Get the JavaType representation of the type of the field.
     * @return JavaType representation of the type of this field.
     */
    public JavaType getType() {
        JavaField field = getJavaField();
        return (field == null) ? null : field.getType();
    }
View Full Code Here

     * @return the JavaField instance for the specified field in this class
     * or <code>null</code> if there is no such field.
     */
    public JavaField getJavaField(String fieldName)
    {
        JavaField javaField = getDeclaredJavaField(fieldName);
        if (javaField == null) {
            // check superclass
            JavaType superclass = getSuperclass();
            if ((superclass != null) &&
                (superclass != PredefinedType.objectType)) {
View Full Code Here

     * @param fieldName the name of the field
     * @return the JavaField instance for the specified field in this class
     */
    public synchronized JavaField getDeclaredJavaField(String fieldName)
    {
        JavaField javaField = (JavaField)declaredJavaFields.get(fieldName);
        if (javaField == null) {
            JDOClass jdoClass = getJDOClass();
            if (jdoClass != null) {
                // pc class => look for JDOField first
                if (jdoClass.getDeclaredField(fieldName) != null) {
View Full Code Here

        Field[] fields = ReflectionJavaField.getDeclaredFieldsPrivileged(clazz);
        for (int i = 0; i < fields.length; i++) {
            Field field = fields[i];
            String fieldName = field.getName();
            if (declaredJavaFields.get(fieldName) == null) {
                JavaField javaField = newJavaFieldInstance(field);
                declaredJavaFields.put(fieldName, javaField);
            }
        }
    }
View Full Code Here

        affirm(classPath);
        affirm(fieldName);
        final String className = classPath.replace('/', '.');
        try {
            final JavaType javaType = javaModel.getJavaType(className);
            final JavaField javaField = javaType.getJavaField(fieldName);
            final JavaType declaringClass = javaField.getDeclaringClass();
            return declaringClass.getName().replace('.', '/');
        } catch (ModelFatalException ex) {
            throw new EnhancerMetaDataUserException(ex);
        }
    }
View Full Code Here

        try {
            final JDOClass clazz = getJDOClass(classPath);
            JavaType javaClass = clazz.getJavaType();
            affirm(javaClass != null,
                   "cannot find class file for class: " + classPath);
            JavaField javaField = javaClass.getJavaField(fieldName);
            affirm(javaField != null,
                   "cannot find java field " + classPath + "." + fieldName);
            JavaType fieldType = javaField.getType();
            JDOField field = clazz.getField(fieldName);
            // if field not known by JDOClass (not specified in JDO XML),
            // create the field only if the model's method of default
            // calculation would yield a persistent field.  We must not
            // change the models state by newly created fields with
View Full Code Here

     * @param fieldName the name of the field
     * @return the JavaField instance for the specified field in this class
     */
    public synchronized JavaField getDeclaredJavaField(String fieldName)
    {
        JavaField javaField = (JavaField)declaredJavaFields.get(fieldName);
        if (javaField == null) {
            JDOClass jdoClass = getJDOClass();
            if (jdoClass != null) {
                // pc class => look for JDOField first
                if (jdoClass.getDeclaredField(fieldName) != null) {
View Full Code Here

        Field[] fields = ReflectionJavaField.getDeclaredFieldsPrivileged(clazz);
        for (int i = 0; i < fields.length; i++) {
            Field field = fields[i];
            String fieldName = field.getName();
            if (declaredJavaFields.get(fieldName) == null) {
                JavaField javaField = newJavaFieldInstance(field);
                declaredJavaFields.put(fieldName, javaField);
            }
        }
    }
View Full Code Here

TOP

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

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.