1 21 package oracle.toplink.essentials.internal.ejb.cmp3.xml.accessors; 23 24 import oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.ClassAccessor; 25 import oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.EmbeddedAccessor; 26 27 import oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.objects.MetadataAccessibleObject; 28 import oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.objects.MetadataClass; 29 30 import oracle.toplink.essentials.internal.ejb.cmp3.metadata.MetadataDescriptor; 31 32 import oracle.toplink.essentials.internal.ejb.cmp3.xml.columns.XMLColumn; 33 34 import oracle.toplink.essentials.internal.ejb.cmp3.xml.XMLConstants; 35 import oracle.toplink.essentials.internal.ejb.cmp3.xml.XMLHelper; 36 37 import oracle.toplink.essentials.mappings.AggregateObjectMapping; 38 39 import org.w3c.dom.Node ; 40 import org.w3c.dom.NodeList ; 41 42 48 public class XMLEmbeddedAccessor extends EmbeddedAccessor { 49 protected Node m_node; 50 protected XMLHelper m_helper; 51 52 55 public XMLEmbeddedAccessor(MetadataAccessibleObject accessibleObject, Node node, XMLClassAccessor classAccessor, boolean isEmbeddedId) { 56 super(accessibleObject, classAccessor, isEmbeddedId); 57 m_node = node; 58 m_helper = classAccessor.getHelper(); 59 } 60 61 64 protected void processAttributeOverrides(AggregateObjectMapping mapping) { 65 NodeList nodes = m_helper.getNodes(m_node, XMLConstants.ATTRIBUTE_OVERRIDE); 66 67 if (nodes != null) { 68 for (int i = 0; i < nodes.getLength(); i++) { 69 processAttributeOverride(mapping, new XMLColumn(nodes.item(i), m_helper, getAnnotatedElement())); 70 } 71 } 72 73 } 75 76 86 protected ClassAccessor processAccessor(MetadataDescriptor descriptor) { 87 Node node = m_helper.locateEntityNode(descriptor.getJavaClass()); 88 89 if (node != null) { 90 XMLClassAccessor accessor = new XMLClassAccessor(new MetadataClass(descriptor.getJavaClass()), node, m_helper, m_processor, descriptor); 91 descriptor.setClassAccessor(accessor); 92 accessor.process(); 93 accessor.setIsProcessed(); 94 return accessor; 95 } else { 96 return super.processAccessor(descriptor); 97 } 98 } 99 } 100 | Popular Tags |