Package org.eclipse.persistence.internal.jpa.metadata.accessors.objects

Examples of org.eclipse.persistence.internal.jpa.metadata.accessors.objects.MetadataField


    /**
     * Return the class which is the source of the attribute.
     * i.e. the class that defines the attribute in its class file.
     */
    private MetadataClass getAttributeDeclaringClass(MetadataClass metadataClass, String attributeName) {      
        MetadataField field = metadataClass.getField(attributeName);
        return field.getDeclaringClass();
    }
View Full Code Here


            if (method == null) {
                return null;
            }
            return method.getMetadataClass(method.getReturnType());
        } else {
            MetadataField field = metadataClass.getField(attributeName, checkSuperclass);
            if (field == null) {
                return null;
            }
            return field.getMetadataClass(field.getType());
        }
    }
View Full Code Here

     * INTERNAL:
     * Return the accessible field for the given mapping accessor. Validation is
     * performed on the existence of the field.
     */
    protected MetadataField getAccessibleField(MappingAccessor accessor) {
        MetadataField field = getJavaClass().getField(accessor.getName());
       
        if (field == null) {
            throw ValidationException.invalidFieldForClass(accessor.getName(), getJavaClass());
        } else {
            // True will force an exception to be thrown if it is not a valid
            // field. However, if it is a transient accessor, don't validate it
            // and return.
            if (accessor.isTransient() || field.isValidPersistenceField(getDescriptor(), true)) {
                return field;   
            }
           
            return null;
        }
View Full Code Here

    /**
     * Return the class which is the source of the attribute.
     * i.e. the class that defines the attribute in its class file.
     */
    private MetadataClass getAttributeDeclaringClass(MetadataClass metadataClass, String attributeName) {      
        MetadataField field = metadataClass.getField(attributeName);
        return field.getDeclaringClass();
    }
View Full Code Here

            if (method == null) {
                return null;
            }
            return method.getMetadataClass(method.getReturnType());
        } else {
            MetadataField field = metadataClass.getField(attributeName, checkSuperclass);
            if (field == null) {
                return null;
            }
            return field.getMetadataClass(field.getType());
        }
    }
View Full Code Here

    /**
     * Return the class which is the source of the attribute.
     * i.e. the class that defines the attribute in its class file.
     */
    private MetadataClass getAttributeDeclaringClass(MetadataClass metadataClass, String attributeName) {      
        MetadataField field = metadataClass.getField(attributeName);
        return field.getDeclaringClass();
    }
View Full Code Here

            if (method == null) {
                return null;
            }
            return method.getMetadataClass(method.getReturnType());
        } else {
            MetadataField field = metadataClass.getField(attributeName, checkSuperclass);
            if (field == null) {
                return null;
            }
            return field.getMetadataClass(field.getType());
        }
    }
View Full Code Here

                                accessibleObject = method;
                            }
                        } 
                    }
                } else {
                    MetadataField field = getJavaClass().getField(accessor.getName());
               
                    if (field == null) {
                        throw ValidationException.invalidFieldForClass(accessor.getName(), getJavaClass());
                    } else {
                        // True will force an exception to be thrown if it is
                        // not a valid field. However, if it is a transient
                        // accessor, don't validate it and just let it through.
                        if (accessor.isTransient() || field.isValidPersistenceField(getDescriptor(), true)) {
                            accessibleObject = field;
                        }
                    }
                }
               
View Full Code Here

     * INTERNAL:
     * Visit a variable and create a MetadataField object.
     */
    @Override
    public MetadataField visitVariable(VariableElement variableElement, MetadataClass metadataClass) {
        MetadataField field = new MetadataField(metadataClass);
       
        // Set the name.
        field.setName(variableElement.getSimpleName().toString());
       
        // Set the attribute name (same as name in this case)
        field.setAttributeName(field.getName());
       
        // Visit the variable element for type and generic type.
        variableElement.asType().accept(typeVisitor, field);
       
        // Set the modifiers.
        field.setModifiers(getModifiers(variableElement.getModifiers()));

        // Set the annotations.
        buildMetadataAnnotations(field, variableElement.getAnnotationMirrors());
       
        // Add the field to the class and return the field.
View Full Code Here

    /**
     * Return the class which is the source of the attribute.
     * i.e. the class that defines the attribute in its class file.
     */
    private MetadataClass getAttributeDeclaringClass(MetadataClass metadataClass, String attributeName) {      
        MetadataField field = metadataClass.getField(attributeName);
        return field.getDeclaringClass();
    }
View Full Code Here

TOP

Related Classes of org.eclipse.persistence.internal.jpa.metadata.accessors.objects.MetadataField

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.