xmlMapping.setAttributeAccessor(temporaryAccessor); if(!className.equals("java.lang.Object")){ xmlMapping.setReferenceClassName(className);
private void addChoiceElementMapping(XMLField xmlField, String className){ if (xmlField.getLastXPathFragment().nameIsText()) { XMLDirectMapping xmlMapping = new XMLDirectMapping(); xmlMapping.setAttributeAccessor(temporaryAccessor); Class theClass = XMLConversionManager.getDefaultXMLManager().convertClassNameToClass(className); xmlMapping.setAttributeClassification(theClass); xmlMapping.setField(xmlField); this.choiceElementMappings.put(xmlField, xmlMapping); } else { XMLCompositeObjectMapping xmlMapping = new XMLCompositeObjectMapping(); xmlMapping.setAttributeAccessor(temporaryAccessor); if(!className.equals("java.lang.Object")){ xmlMapping.setReferenceClassName(className); } xmlMapping.setField(xmlField); this.choiceElementMappings.put(xmlField, xmlMapping); } }
xmlMapping.setAttributeAccessor(temporaryAccessor); if(!className.equals("java.lang.Object")){ xmlMapping.setReferenceClassName(className);
private DatabaseMapping buildXMLCompositeObjectMapping(String mappingUri) { XMLCompositeObjectMapping mapping = new XMLCompositeObjectMapping(); mapping.setAttributeName(getName()); String xpath = getQualifiedXPath(mappingUri, false); mapping.setXPath(xpath); if (!getType().isDataObjectType()) { QName schemaContext = getType().getXmlDescriptor().getSchemaReference().getSchemaContextAsQName(getType().getXmlDescriptor().getNamespaceResolver()); ((XMLField)mapping.getField()).setLeafElementType(schemaContext); mapping.setReferenceClassName(getType().getImplClassName()); mapping.setReferenceClass(getType().getImplClass()); }else{ if(getXsdType()!= null){ ((XMLField)mapping.getField()).setLeafElementType(getXsdType()); } } // Handle nillable element support via the nullable property if (nullable) { setIsSetNillablePolicyOnMapping(mapping, propertyName); } else { // elements or attributes setIsSetOptionalPolicyOnMapping(mapping, propertyName); } return mapping; }
private DatabaseMapping buildXMLCompositeObjectMapping(String mappingUri) { XMLCompositeObjectMapping mapping = new XMLCompositeObjectMapping(); mapping.setAttributeName(getName()); String xpath = getQualifiedXPath(mappingUri, false); mapping.setXPath(xpath); if (!getType().isDataObjectType()) { QName schemaContext = getType().getXmlDescriptor().getSchemaReference().getSchemaContextAsQName(getType().getXmlDescriptor().getNamespaceResolver()); ((XMLField)mapping.getField()).setLeafElementType(schemaContext); mapping.setReferenceClassName(getType().getImplClassName()); mapping.setReferenceClass(getType().getImplClass()); }else{ if(getXsdType()!= null){ ((XMLField)mapping.getField()).setLeafElementType(getXsdType()); } } // Handle nillable element support via the nullable property if (nullable) { setIsSetNillablePolicyOnMapping(mapping, propertyName); } else { // elements or attributes setIsSetOptionalPolicyOnMapping(mapping, propertyName); } return mapping; }