Examples of MetadataAccessibleObject


Examples of oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.objects.MetadataAccessibleObject

    /**
     * INTERNAL:
     * Create and return the appropriate accessor based on the given node.
     */
    protected MetadataAccessor buildAccessor(Node node) {
        MetadataAccessibleObject accessibleObject;
       
        // Process the required name attribute.
        String attributeName = m_helper.getNodeValue(node, XMLConstants.ATT_NAME);
       
        // WIP - left to do here is perform validation on the accessors just
        // like the annotation processor does.
        if (m_descriptor.usesPropertyAccess()) {
            Method method = MetadataHelper.getMethodForPropertyName(attributeName, getJavaClass());
           
            if (method == null) {
                m_validator.throwUnableToDetermineClassForProperty(attributeName, getJavaClass());
            }
           
            accessibleObject = new MetadataMethod(method);
        } else {
            Field field = MetadataHelper.getFieldForName(attributeName, getJavaClass());
           
            if (field == null) {
                m_validator.throwUnableToDetermineClassForField(attributeName, getJavaClass());
            }
           
            accessibleObject = new MetadataField(field);
        }
       
        String nodeName = node.getLocalName();
       
        if (nodeName.equals(XMLConstants.ONE_TO_ONE)) {
            return new XMLOneToOneAccessor(accessibleObject, node, this);
        } else if (nodeName.equals(XMLConstants.MANY_TO_ONE)) {
            return new XMLManyToOneAccessor(accessibleObject, node, this);
        } else if (nodeName.equals(XMLConstants.ONE_TO_MANY)) {
            if (MetadataHelper.isSupportedCollectionClass(accessibleObject.getRawClass())) {
                return new XMLOneToManyAccessor(accessibleObject, node, this);       
            } else {
                m_validator.throwInvalidCollectionTypeForRelationship(getJavaClass(), accessibleObject.getRawClass(), getAttributeName());
                return null;
            }
        } else if (nodeName.equals(XMLConstants.MANY_TO_MANY)) {
            if (MetadataHelper.isSupportedCollectionClass(accessibleObject.getRawClass())) {
                return new XMLManyToManyAccessor(accessibleObject, node, this);
            } else {
                m_validator.throwInvalidCollectionTypeForRelationship(getJavaClass(), accessibleObject.getRawClass(), getAttributeName());
                return null;
            }
        } else if (nodeName.equals(XMLConstants.EMBEDDED)) {
            return new XMLEmbeddedAccessor(accessibleObject, node, this);
        } else if (nodeName.equals(XMLConstants.EMBEDDED_ID)) {
View Full Code Here

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

     */
    public void addAccessors() {       
        if (m_attributes != null) {
            for (MappingAccessor accessor : m_attributes.getAccessors()) {
                // Load the accessible object from the class.
                MetadataAccessibleObject accessibleObject = null;
               
                // We must init all xml mapping accessors with a reference
                // of their owning class accessor. The mapping accessors
                // require metatata information from them to ensure they
                // process themselves correctly.
View Full Code Here

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

     */
    protected void processAccessors() {       
        if (m_attributes != null) {
            for (MappingAccessor accessor : m_attributes.getAccessors()) {
                // Load the accessible object from the class.
                MetadataAccessibleObject accessibleObject = null;
           
                if (accessor.usesPropertyAccess(getDescriptor())) {
                    if (accessor.getAccessMethods() != null) {
                        // Can't rely on MappingAccessor's getGetMethodName methods
                        // as they could result in NPE if accessibleObject isn't
View Full Code Here

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

     */
    public void addAccessors() {       
        if (m_attributes != null) {
            for (MappingAccessor accessor : m_attributes.getAccessors()) {
                // Load the accessible object from the class.
                MetadataAccessibleObject accessibleObject = null;
               
                // We must init all xml mapping accessors with a reference
                // of their owning class accessor. The mapping accessors
                // require metatata information from them to ensure they
                // process themselves correctly.
View Full Code Here

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

     */
    public void addAccessors() {     
        if (m_attributes != null) {
            for (MappingAccessor accessor : m_attributes.getAccessors()) {
                // Load the accessible object from the class.
                MetadataAccessibleObject accessibleObject = null;
               
                // We must init all xml mapping accessors with a reference
                // of their owning class accessor. The mapping accessors
                // require metatata information from them to ensure they
                // process themselves correctly.
View Full Code Here

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

     */
    public void addAccessors() {     
        if (m_attributes != null) {
            for (MappingAccessor accessor : m_attributes.getAccessors()) {
                // Load the accessible object from the class.
                MetadataAccessibleObject accessibleObject = null;
               
                // We must init all xml mapping accessors with a reference
                // of their owning class accessor. The mapping accessors
                // require metatata information from them to ensure they
                // process themselves correctly.
View Full Code Here

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

     */
    public void addAccessors() {     
        if (m_attributes != null) {
            for (MappingAccessor accessor : m_attributes.getAccessors()) {
                // Load the accessible object from the class.
                MetadataAccessibleObject accessibleObject = null;
               
                // We must init all xml mapping accessors with a reference
                // of their owning class accessor. The mapping accessors
                // require metatata information from them to ensure they
                // process themselves correctly.
View Full Code Here

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

     */
    public void addAccessors() {     
        if (m_attributes != null) {
            for (MappingAccessor accessor : m_attributes.getAccessors()) {
                // Load the accessible object from the class.
                MetadataAccessibleObject accessibleObject = null;
               
                // We must init all xml mapping accessors with a reference
                // of their owning class accessor. The mapping accessors
                // require metatata information from them to ensure they
                // process themselves correctly.
View Full Code Here

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

     */
    public void addAccessors() {     
        if (m_attributes != null) {
            for (MappingAccessor accessor : m_attributes.getAccessors()) {
                // Load the accessible object from the class.
                MetadataAccessibleObject accessibleObject = null;
               
                // We must init all xml mapping accessors with a reference
                // of their owning class accessor. The mapping accessors
                // require metatata information from them to ensure they
                // process themselves correctly.
View Full Code Here

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

     */
    public void addAccessors() {     
        if (m_attributes != null) {
            for (MappingAccessor accessor : m_attributes.getAccessors()) {
                // Load the accessible object from the class.
                MetadataAccessibleObject accessibleObject = null;
               
                // We must init all xml mapping accessors with a reference
                // of their owning class accessor. The mapping accessors
                // require metatata information from them to ensure they
                // process themselves correctly.
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.