Search in sources :

Example 61 with Field

use of org.eclipse.persistence.internal.oxm.mappings.Field in project eclipselink by eclipse-ee4j.

the class MappingsGenerator method generateMappingForReferenceProperty.

public Mapping generateMappingForReferenceProperty(Property property, Descriptor descriptor, NamespaceInfo namespaceInfo) {
    boolean isCollection = helper.isCollectionType(property.getType()) || property.getType().isArray();
    Mapping mapping;
    if (isCollection) {
        mapping = new XMLChoiceCollectionMapping();
        initializeXMLContainerMapping((ChoiceCollectionMapping) mapping, property.getType().isArray());
        JavaClass collectionType = property.getType();
        collectionType = containerClassImpl(collectionType);
        ((ChoiceCollectionMapping) mapping).useCollectionClassName(collectionType.getRawName());
        JAXBElementRootConverter jaxbERConverter = new JAXBElementRootConverter(Object.class);
        if (property.isSetXmlJavaTypeAdapter()) {
            JavaClass adapterClass = helper.getJavaClass(property.getXmlJavaTypeAdapter().getValue());
            jaxbERConverter.setNestedConverter(new XMLJavaTypeConverter(adapterClass.getQualifiedName()));
        }
        ((ChoiceCollectionMapping) mapping).setConverter(jaxbERConverter);
        if (property.isSetWriteOnly()) {
            ((ChoiceCollectionMapping) mapping).setIsWriteOnly(property.isWriteOnly());
        }
        if (property.isSetXmlElementWrapper()) {
            ((ChoiceCollectionMapping) mapping).setWrapperNullPolicy(getWrapperNullPolicyFromProperty(property));
        }
    } else {
        mapping = new XMLChoiceObjectMapping();
        JAXBElementRootConverter jaxbERConverter = new JAXBElementRootConverter(Object.class);
        if (property.isSetXmlJavaTypeAdapter()) {
            JavaClass adapterClass = helper.getJavaClass(property.getXmlJavaTypeAdapter().getValue());
            jaxbERConverter.setNestedConverter(new XMLJavaTypeConverter(adapterClass.getQualifiedName()));
        }
        ((ChoiceObjectMapping) mapping).setConverter(jaxbERConverter);
        if (property.isSetWriteOnly()) {
            ((ChoiceObjectMapping) mapping).setIsWriteOnly(property.isWriteOnly());
        }
    }
    initializeXMLMapping((XMLMapping) mapping, property);
    List<ElementDeclaration> referencedElements = property.getReferencedElements();
    JavaClass propertyType = property.getType();
    if (propertyType.isArray()) {
        JAXBArrayAttributeAccessor accessor = new JAXBArrayAttributeAccessor(mapping.getAttributeAccessor(), mapping.getContainerPolicy(), helper.getClassLoader());
        accessor.setComponentClassName(property.getType().getComponentType().getQualifiedName());
        JavaClass componentType = propertyType.getComponentType();
        if (componentType.isArray()) {
            Class<?> adaptedClass = classToGeneratedClasses.get(componentType.getQualifiedName());
            accessor.setAdaptedClassName(adaptedClass.getName());
        }
        mapping.setAttributeAccessor(accessor);
    }
    String wrapperXPath = "";
    // handle XmlElementWrapper
    if (property.isSetXmlElementWrapper()) {
        XmlElementWrapper wrapper = property.getXmlElementWrapper();
        String namespace = wrapper.getNamespace();
        if (namespace.equals(XMLProcessor.DEFAULT)) {
            if (namespaceInfo.isElementFormQualified()) {
                namespace = namespaceInfo.getNamespace();
            } else {
                namespace = "";
            }
        }
        if (namespace.equals("")) {
            wrapperXPath += (wrapper.getName() + "/");
        } else {
            String prefix = getPrefixForNamespace(namespace, getNamespaceResolverForDescriptor(namespaceInfo));
            wrapperXPath += getQualifiedString(prefix, wrapper.getName() + "/");
        }
    }
    if (property.isMixedContent() && isCollection) {
        if (wrapperXPath.length() == 0) {
            ((ChoiceCollectionMapping) mapping).setMixedContent(true);
        } else {
            ((ChoiceCollectionMapping) mapping).setMixedContent(wrapperXPath.substring(0, wrapperXPath.length() - 1));
        }
    }
    for (ElementDeclaration element : referencedElements) {
        QName elementName = element.getElementName();
        JavaClass pType = element.getJavaType();
        String pTypeName = element.getJavaTypeName();
        boolean isBinaryType = (areEquals(pType, AnnotationsProcessor.JAVAX_ACTIVATION_DATAHANDLER) || areEquals(pType, byte[].class) || areEquals(pType, Image.class) || areEquals(pType, Source.class) || areEquals(pType, AnnotationsProcessor.JAVAX_MAIL_INTERNET_MIMEMULTIPART));
        boolean isText = pType.isEnum() || (!isBinaryType && !(this.typeInfo.containsKey(element.getJavaTypeName())) && !(element.getJavaTypeName().equals(OBJECT_CLASS_NAME)));
        String xPath = wrapperXPath;
        Field xmlField = this.getXPathForElement(xPath, elementName, namespaceInfo, isText);
        // ensure byte[] goes to base64 instead of the default hex.
        if (helper.getXMLToJavaTypeMap().get(pType.getRawName()) == Constants.BASE_64_BINARY_QNAME) {
            xmlField.setSchemaType(Constants.BASE_64_BINARY_QNAME);
        }
        if (areEquals(pType, Object.class)) {
            setTypedTextField(xmlField);
        }
        Mapping nestedMapping;
        AbstractNullPolicy nullPolicy = null;
        if (isCollection) {
            ChoiceCollectionMapping xmlChoiceCollectionMapping = (ChoiceCollectionMapping) mapping;
            xmlChoiceCollectionMapping.addChoiceElement(xmlField, pTypeName);
            nestedMapping = (Mapping) xmlChoiceCollectionMapping.getChoiceElementMappings().get(xmlField);
            if (nestedMapping.isAbstractCompositeCollectionMapping()) {
                ((CompositeCollectionMapping) nestedMapping).setKeepAsElementPolicy(UnmarshalKeepAsElementPolicy.KEEP_UNKNOWN_AS_ELEMENT);
                nullPolicy = ((CompositeCollectionMapping) nestedMapping).getNullPolicy();
            }
            if (nestedMapping.isAbstractCompositeDirectCollectionMapping()) {
                DirectCollectionMapping nestedCompositeDirectCollectionMapping = (DirectCollectionMapping) nestedMapping;
                nullPolicy = nestedCompositeDirectCollectionMapping.getNullPolicy();
                if (pType.isEnum()) {
                    TypeInfo enumTypeInfo = typeInfo.get(pType.getQualifiedName());
                    nestedCompositeDirectCollectionMapping.setValueConverter(buildJAXBEnumTypeConverter(nestedCompositeDirectCollectionMapping, (EnumTypeInfo) enumTypeInfo));
                }
                if (element.isList()) {
                    XMLListConverter listConverter = new XMLListConverter();
                    listConverter.setObjectClassName(pType.getQualifiedName());
                    ((DirectCollectionMapping) nestedMapping).setValueConverter(listConverter);
                }
            } else if (nestedMapping instanceof BinaryDataCollectionMapping) {
                nullPolicy = ((BinaryDataCollectionMapping) nestedMapping).getNullPolicy();
                if (element.isList()) {
                    ((XMLField) nestedMapping.getField()).setUsesSingleNode(true);
                }
            }
        } else {
            ChoiceObjectMapping xmlChoiceObjectMapping = (ChoiceObjectMapping) mapping;
            xmlChoiceObjectMapping.addChoiceElement(xmlField, pTypeName);
            nestedMapping = (Mapping) xmlChoiceObjectMapping.getChoiceElementMappings().get(xmlField);
            if (pType.isEnum()) {
                TypeInfo enumTypeInfo = typeInfo.get(pType.getQualifiedName());
                ((DirectMapping) nestedMapping).setConverter(buildJAXBEnumTypeConverter(nestedMapping, (EnumTypeInfo) enumTypeInfo));
            }
            if (nestedMapping.isAbstractCompositeObjectMapping()) {
                ((CompositeObjectMapping) nestedMapping).setKeepAsElementPolicy(UnmarshalKeepAsElementPolicy.KEEP_UNKNOWN_AS_ELEMENT);
                nullPolicy = ((CompositeObjectMapping) nestedMapping).getNullPolicy();
            } else if (nestedMapping instanceof BinaryDataMapping) {
                nullPolicy = ((BinaryDataMapping) nestedMapping).getNullPolicy();
            } else if (nestedMapping instanceof DirectMapping) {
                nullPolicy = ((DirectMapping) nestedMapping).getNullPolicy();
            }
        }
        if (nullPolicy != null) {
            nullPolicy.setNullRepresentedByEmptyNode(false);
            nullPolicy.setMarshalNullRepresentation(XMLNullRepresentationType.XSI_NIL);
            nullPolicy.setNullRepresentedByXsiNil(true);
            nullPolicy.setIgnoreAttributesForNil(false);
        }
        if (!element.isXmlRootElement()) {
            Class<?> scopeClass = element.getScopeClass();
            if (scopeClass == jakarta.xml.bind.annotation.XmlElementDecl.GLOBAL.class) {
                scopeClass = JAXBElement.GlobalScope.class;
            }
            Class<?> declaredType = null;
            if (element.getAdaptedJavaType() != null) {
                declaredType = org.eclipse.persistence.internal.helper.Helper.getClassFromClasseName(element.getAdaptedJavaType().getQualifiedName(), helper.getClassLoader());
            } else {
                declaredType = org.eclipse.persistence.internal.helper.Helper.getClassFromClasseName(pType.getQualifiedName(), helper.getClassLoader());
            }
            JAXBElementConverter converter = new JAXBElementConverter(xmlField, declaredType, scopeClass);
            if (isCollection) {
                ChoiceCollectionMapping xmlChoiceCollectionMapping = (ChoiceCollectionMapping) mapping;
                if (element.getJavaTypeAdapterClass() != null) {
                    converter.setNestedConverter(new XMLJavaTypeConverter(element.getJavaTypeAdapterClass().getName()));
                } else {
                    CoreConverter originalConverter = xmlChoiceCollectionMapping.getConverter(xmlField);
                    converter.setNestedConverter(originalConverter);
                }
                xmlChoiceCollectionMapping.addConverter(xmlField, converter);
            } else {
                ChoiceObjectMapping xmlChoiceObjectMapping = (ChoiceObjectMapping) mapping;
                if (element.getJavaTypeAdapterClass() != null) {
                    converter.setNestedConverter(new XMLJavaTypeConverter(element.getJavaTypeAdapterClass().getName()));
                } else {
                    CoreConverter originalConverter = xmlChoiceObjectMapping.getConverter(xmlField);
                    converter.setNestedConverter(originalConverter);
                }
                xmlChoiceObjectMapping.addConverter(xmlField, converter);
            }
        }
    }
    if (property.isAny()) {
        if (isCollection) {
            XMLChoiceCollectionMapping xmlChoiceCollectionMapping = (XMLChoiceCollectionMapping) mapping;
            xmlChoiceCollectionMapping.setIsAny(true);
        }
    }
    return mapping;
}
Also used : XMLChoiceObjectMapping(org.eclipse.persistence.oxm.mappings.XMLChoiceObjectMapping) JAXBArrayAttributeAccessor(org.eclipse.persistence.internal.jaxb.many.JAXBArrayAttributeAccessor) XMLVariableXPathObjectMapping(org.eclipse.persistence.oxm.mappings.XMLVariableXPathObjectMapping) AnyObjectMapping(org.eclipse.persistence.internal.oxm.mappings.AnyObjectMapping) XMLChoiceCollectionMapping(org.eclipse.persistence.oxm.mappings.XMLChoiceCollectionMapping) XMLCompositeObjectMapping(org.eclipse.persistence.oxm.mappings.XMLCompositeObjectMapping) VariableXPathCollectionMapping(org.eclipse.persistence.internal.oxm.mappings.VariableXPathCollectionMapping) DirectCollectionMapping(org.eclipse.persistence.internal.oxm.mappings.DirectCollectionMapping) ChoiceCollectionMapping(org.eclipse.persistence.internal.oxm.mappings.ChoiceCollectionMapping) ChoiceObjectMapping(org.eclipse.persistence.internal.oxm.mappings.ChoiceObjectMapping) XMLVariableXPathCollectionMapping(org.eclipse.persistence.oxm.mappings.XMLVariableXPathCollectionMapping) XMLAnyObjectMapping(org.eclipse.persistence.oxm.mappings.XMLAnyObjectMapping) XMLDirectMapping(org.eclipse.persistence.oxm.mappings.XMLDirectMapping) XMLChoiceObjectMapping(org.eclipse.persistence.oxm.mappings.XMLChoiceObjectMapping) XMLMapping(org.eclipse.persistence.oxm.mappings.XMLMapping) CompositeCollectionMapping(org.eclipse.persistence.internal.oxm.mappings.CompositeCollectionMapping) XMLBinaryDataMapping(org.eclipse.persistence.oxm.mappings.XMLBinaryDataMapping) VariableXPathObjectMapping(org.eclipse.persistence.internal.oxm.mappings.VariableXPathObjectMapping) DirectMapping(org.eclipse.persistence.internal.oxm.mappings.DirectMapping) CollectionReferenceMapping(org.eclipse.persistence.internal.oxm.mappings.CollectionReferenceMapping) CompositeObjectMapping(org.eclipse.persistence.internal.oxm.mappings.CompositeObjectMapping) TransformationMapping(org.eclipse.persistence.internal.oxm.mappings.TransformationMapping) ObjectReferenceMapping(org.eclipse.persistence.internal.oxm.mappings.ObjectReferenceMapping) XMLAnyAttributeMapping(org.eclipse.persistence.oxm.mappings.XMLAnyAttributeMapping) XMLInverseReferenceMapping(org.eclipse.persistence.oxm.mappings.XMLInverseReferenceMapping) InverseReferenceMapping(org.eclipse.persistence.internal.oxm.mappings.InverseReferenceMapping) XMLTransformationMapping(org.eclipse.persistence.oxm.mappings.XMLTransformationMapping) CoreMapping(org.eclipse.persistence.core.mappings.CoreMapping) AnyCollectionMapping(org.eclipse.persistence.internal.oxm.mappings.AnyCollectionMapping) XMLBinaryDataCollectionMapping(org.eclipse.persistence.oxm.mappings.XMLBinaryDataCollectionMapping) DatabaseMapping(org.eclipse.persistence.mappings.DatabaseMapping) XMLCompositeCollectionMapping(org.eclipse.persistence.oxm.mappings.XMLCompositeCollectionMapping) XMLAnyCollectionMapping(org.eclipse.persistence.oxm.mappings.XMLAnyCollectionMapping) XMLCompositeDirectCollectionMapping(org.eclipse.persistence.oxm.mappings.XMLCompositeDirectCollectionMapping) Mapping(org.eclipse.persistence.internal.oxm.mappings.Mapping) XMLObjectReferenceMapping(org.eclipse.persistence.oxm.mappings.XMLObjectReferenceMapping) AnyAttributeMapping(org.eclipse.persistence.internal.oxm.mappings.AnyAttributeMapping) BinaryDataMapping(org.eclipse.persistence.internal.oxm.mappings.BinaryDataMapping) XMLContainerMapping(org.eclipse.persistence.internal.oxm.mappings.XMLContainerMapping) BinaryDataCollectionMapping(org.eclipse.persistence.internal.oxm.mappings.BinaryDataCollectionMapping) XMLCollectionReferenceMapping(org.eclipse.persistence.oxm.mappings.XMLCollectionReferenceMapping) XMLChoiceCollectionMapping(org.eclipse.persistence.oxm.mappings.XMLChoiceCollectionMapping) XMLBinaryDataCollectionMapping(org.eclipse.persistence.oxm.mappings.XMLBinaryDataCollectionMapping) BinaryDataCollectionMapping(org.eclipse.persistence.internal.oxm.mappings.BinaryDataCollectionMapping) XMLChoiceCollectionMapping(org.eclipse.persistence.oxm.mappings.XMLChoiceCollectionMapping) ChoiceCollectionMapping(org.eclipse.persistence.internal.oxm.mappings.ChoiceCollectionMapping) Source(javax.xml.transform.Source) DirectCollectionMapping(org.eclipse.persistence.internal.oxm.mappings.DirectCollectionMapping) XMLCompositeDirectCollectionMapping(org.eclipse.persistence.oxm.mappings.XMLCompositeDirectCollectionMapping) XMLField(org.eclipse.persistence.oxm.XMLField) DatabaseField(org.eclipse.persistence.internal.helper.DatabaseField) Field(org.eclipse.persistence.internal.oxm.mappings.Field) JavaField(org.eclipse.persistence.jaxb.javamodel.JavaField) XMLDirectMapping(org.eclipse.persistence.oxm.mappings.XMLDirectMapping) DirectMapping(org.eclipse.persistence.internal.oxm.mappings.DirectMapping) CoreConverter(org.eclipse.persistence.core.mappings.converters.CoreConverter) XmlElementWrapper(org.eclipse.persistence.jaxb.xmlmodel.XmlElementWrapper) XMLJavaTypeConverter(org.eclipse.persistence.internal.jaxb.XMLJavaTypeConverter) XmlAbstractNullPolicy(org.eclipse.persistence.jaxb.xmlmodel.XmlAbstractNullPolicy) AbstractNullPolicy(org.eclipse.persistence.oxm.mappings.nullpolicy.AbstractNullPolicy) QName(javax.xml.namespace.QName) JAXBElementConverter(org.eclipse.persistence.internal.jaxb.JAXBElementConverter) JAXBElement(jakarta.xml.bind.JAXBElement) XMLBinaryDataMapping(org.eclipse.persistence.oxm.mappings.XMLBinaryDataMapping) BinaryDataMapping(org.eclipse.persistence.internal.oxm.mappings.BinaryDataMapping) XMLListConverter(org.eclipse.persistence.oxm.mappings.converters.XMLListConverter) JAXBElementRootConverter(org.eclipse.persistence.internal.jaxb.JAXBElementRootConverter) JavaClass(org.eclipse.persistence.jaxb.javamodel.JavaClass) CompositeCollectionMapping(org.eclipse.persistence.internal.oxm.mappings.CompositeCollectionMapping) XMLCompositeCollectionMapping(org.eclipse.persistence.oxm.mappings.XMLCompositeCollectionMapping) XMLCompositeObjectMapping(org.eclipse.persistence.oxm.mappings.XMLCompositeObjectMapping) CompositeObjectMapping(org.eclipse.persistence.internal.oxm.mappings.CompositeObjectMapping) ChoiceObjectMapping(org.eclipse.persistence.internal.oxm.mappings.ChoiceObjectMapping) XMLChoiceObjectMapping(org.eclipse.persistence.oxm.mappings.XMLChoiceObjectMapping)

Example 62 with Field

use of org.eclipse.persistence.internal.oxm.mappings.Field in project eclipselink by eclipse-ee4j.

the class MappingsGenerator method generateXMLCollectionReferenceMapping.

/**
 * Create an XMLCollectionReferenceMapping and add it to the descriptor.
 */
public CollectionReferenceMapping generateXMLCollectionReferenceMapping(Property property, Descriptor descriptor, NamespaceInfo namespaceInfo, JavaClass referenceClass) {
    CollectionReferenceMapping<AbstractSession, AttributeAccessor, ContainerPolicy, ClassDescriptor, DatabaseField, UnmarshalRecord, XMLField, XMLRecord> mapping = new XMLCollectionReferenceMapping();
    initializeXMLMapping((XMLMapping) mapping, property);
    initializeXMLContainerMapping(mapping, property.getType().isArray());
    mapping.setUsesSingleNode(property.isXmlList() || (property.isAttribute() && (property.getXmlPath() == null || !property.getXmlPath().contains("/"))));
    String referenceClassName = referenceClass.getQualifiedName();
    JavaClass collectionType = property.getType();
    if (collectionType.isArray()) {
        JAXBArrayAttributeAccessor accessor = new JAXBArrayAttributeAccessor(mapping.getAttributeAccessor(), mapping.getContainerPolicy(), helper.getClassLoader());
        JavaClass componentType = collectionType.getComponentType();
        if (componentType.isArray()) {
            Class<?> adaptedClass = classToGeneratedClasses.get(componentType.getName());
            referenceClassName = adaptedClass.getName();
            accessor.setAdaptedClassName(referenceClassName);
            JavaClass baseComponentType = getBaseComponentType(componentType);
            if (baseComponentType.isPrimitive()) {
                Class<Object> primitiveClass = XMLConversionManager.getDefaultManager().convertClassNameToClass(baseComponentType.getRawName());
                accessor.setComponentClass(primitiveClass);
            } else {
                accessor.setComponentClassName(baseComponentType.getQualifiedName());
            }
        } else {
            accessor.setComponentClassName(componentType.getQualifiedName());
        }
        mapping.setAttributeAccessor(accessor);
    }
    collectionType = containerClassImpl(collectionType);
    mapping.useCollectionClassName(collectionType.getRawName());
    mapping.setReferenceClassName(referenceClassName);
    // here we need to setup source/target key field associations
    if (property.isSetXmlJoinNodes()) {
        for (XmlJoinNode xmlJoinNode : property.getXmlJoinNodes().getXmlJoinNode()) {
            validateJoinNode(descriptor.getJavaClassName(), property, xmlJoinNode.getReferencedXmlPath(), referenceClass);
            mapping.addSourceToTargetKeyFieldAssociation(xmlJoinNode.getXmlPath(), xmlJoinNode.getReferencedXmlPath());
        }
    } else {
        // here we need to setup source/target key field associations
        TypeInfo referenceType = typeInfo.get(referenceClass.getQualifiedName());
        String tgtXPath = null;
        if (null != referenceType && referenceType.isIDSet()) {
            Property prop = referenceType.getIDProperty();
            tgtXPath = getXPathForField(prop, namespaceInfo, !prop.isAttribute(), false).getXPath();
        }
        // if the XPath is set (via xml-path) use it
        Field srcXPath;
        if (property.getXmlPath() != null) {
            srcXPath = new XMLField(property.getXmlPath());
        } else {
            srcXPath = getXPathForField(property, namespaceInfo, true, false);
        }
        mapping.addSourceToTargetKeyFieldAssociation(srcXPath.getXPath(), tgtXPath);
    }
    if (property.getInverseReferencePropertyName() != null) {
        mapping.getInverseReferenceMapping().setAttributeName(property.getInverseReferencePropertyName());
        JavaClass backPointerPropertyType = null;
        if (property.getInverseReferencePropertyGetMethodName() != null && property.getInverseReferencePropertySetMethodName() != null && !property.getInverseReferencePropertyGetMethodName().equals("") && !property.getInverseReferencePropertySetMethodName().equals("")) {
            mapping.getInverseReferenceMapping().setGetMethodName(property.getInverseReferencePropertySetMethodName());
            mapping.getInverseReferenceMapping().setSetMethodName(property.getInverseReferencePropertySetMethodName());
            JavaMethod getMethod = referenceClass.getDeclaredMethod(mapping.getInverseReferenceMapping().getGetMethodName(), new JavaClass[] {});
            if (getMethod != null) {
                backPointerPropertyType = getMethod.getReturnType();
            }
        } else {
            JavaField backpointerField = referenceClass.getDeclaredField(property.getInverseReferencePropertyName());
            if (backpointerField != null) {
                backPointerPropertyType = backpointerField.getResolvedType();
            }
        }
        if (helper.isCollectionType(backPointerPropertyType)) {
            mapping.getInverseReferenceMapping().setContainerPolicy(ContainerPolicy.buildDefaultPolicy());
        }
    }
    return mapping;
}
Also used : XMLField(org.eclipse.persistence.oxm.XMLField) ClassDescriptor(org.eclipse.persistence.descriptors.ClassDescriptor) JAXBArrayAttributeAccessor(org.eclipse.persistence.internal.jaxb.many.JAXBArrayAttributeAccessor) XMLCollectionReferenceMapping(org.eclipse.persistence.oxm.mappings.XMLCollectionReferenceMapping) XMLRecord(org.eclipse.persistence.oxm.record.XMLRecord) XmlJoinNode(org.eclipse.persistence.jaxb.xmlmodel.XmlJoinNodes.XmlJoinNode) XMLField(org.eclipse.persistence.oxm.XMLField) DatabaseField(org.eclipse.persistence.internal.helper.DatabaseField) Field(org.eclipse.persistence.internal.oxm.mappings.Field) JavaField(org.eclipse.persistence.jaxb.javamodel.JavaField) ContainerPolicy(org.eclipse.persistence.internal.queries.ContainerPolicy) JavaField(org.eclipse.persistence.jaxb.javamodel.JavaField) JavaClass(org.eclipse.persistence.jaxb.javamodel.JavaClass) DatabaseField(org.eclipse.persistence.internal.helper.DatabaseField) UnmarshalRecord(org.eclipse.persistence.internal.oxm.record.UnmarshalRecord) JavaMethod(org.eclipse.persistence.jaxb.javamodel.JavaMethod) VirtualAttributeAccessor(org.eclipse.persistence.internal.descriptors.VirtualAttributeAccessor) CustomAccessorAttributeAccessor(org.eclipse.persistence.internal.jaxb.CustomAccessorAttributeAccessor) JAXBSetMethodAttributeAccessor(org.eclipse.persistence.internal.jaxb.JAXBSetMethodAttributeAccessor) AttributeAccessor(org.eclipse.persistence.mappings.AttributeAccessor) JAXBArrayAttributeAccessor(org.eclipse.persistence.internal.jaxb.many.JAXBArrayAttributeAccessor) MapValueAttributeAccessor(org.eclipse.persistence.internal.jaxb.many.MapValueAttributeAccessor) MethodAttributeAccessor(org.eclipse.persistence.internal.descriptors.MethodAttributeAccessor) InstanceVariableAttributeAccessor(org.eclipse.persistence.internal.descriptors.InstanceVariableAttributeAccessor) AbstractSession(org.eclipse.persistence.internal.sessions.AbstractSession)

Example 63 with Field

use of org.eclipse.persistence.internal.oxm.mappings.Field in project eclipselink by eclipse-ee4j.

the class MappingsGenerator method generateDirectMapping.

public DirectMapping generateDirectMapping(Property property, Descriptor descriptor, NamespaceInfo namespaceInfo) {
    DirectMapping mapping = new XMLDirectMapping();
    mapping.setNullValueMarshalled(true);
    String fixedValue = property.getFixedValue();
    if (fixedValue != null) {
        mapping.setIsWriteOnly(true);
    }
    initializeXMLMapping((XMLMapping) mapping, property);
    // if the XPath is set (via xml-path) use it; otherwise figure it out
    Field xmlField = getXPathForField(property, namespaceInfo, true, false);
    mapping.setField(xmlField);
    if (property.getDefaultValue() != null) {
        mapping.setNullValue(property.getDefaultValue());
    }
    if (property.isXmlId()) {
        mapping.setCollapsingStringValues(true);
    }
    // handle null policy set via xml metadata
    if (property.isSetNullPolicy()) {
        mapping.setNullPolicy(getNullPolicyFromProperty(property, getNamespaceResolverForDescriptor(namespaceInfo)));
    } else {
        if (property.isNillable()) {
            mapping.getNullPolicy().setNullRepresentedByXsiNil(true);
            mapping.getNullPolicy().setMarshalNullRepresentation(XMLNullRepresentationType.XSI_NIL);
        }
        mapping.getNullPolicy().setNullRepresentedByEmptyNode(false);
        if (!mapping.getXPath().equals("text()")) {
            ((NullPolicy) mapping.getNullPolicy()).setSetPerformedForAbsentNode(false);
        }
    }
    if (property.isRequired()) {
        ((Field) mapping.getField()).setRequired(true);
    }
    if (property.getType() != null) {
        String theClass = null;
        String targetClass = null;
        if (property.isSetXmlJavaTypeAdapter()) {
            theClass = property.getOriginalType().getQualifiedName();
            targetClass = property.getType().getQualifiedName();
        } else {
            theClass = property.getType().getQualifiedName();
        }
        // Try to get the actual Class
        try {
            JavaClass actualJavaClass = helper.getJavaClass(theClass);
            Class<?> actualClass = org.eclipse.persistence.internal.helper.Helper.getClassFromClasseName(actualJavaClass.getQualifiedName(), helper.getClassLoader());
            mapping.setAttributeClassification(actualClass);
            if (targetClass != null) {
                Class<?> fieldClass = org.eclipse.persistence.internal.helper.Helper.getClassFromClasseName(targetClass, helper.getClassLoader());
                mapping.getField().setType(fieldClass);
            }
        } catch (Exception e) {
            // Couldn't find Class (Dynamic?), so set class name instead.
            mapping.setAttributeClassificationName(theClass);
        }
    }
    if (Constants.QNAME_QNAME.equals(property.getSchemaType())) {
        ((Field) mapping.getField()).setSchemaType(Constants.QNAME_QNAME);
    }
    // handle cdata set via metadata
    if (property.isSetCdata()) {
        mapping.setIsCDATA(property.isCdata());
    }
    return mapping;
}
Also used : IsSetNullPolicy(org.eclipse.persistence.oxm.mappings.nullpolicy.IsSetNullPolicy) XmlIsSetNullPolicy(org.eclipse.persistence.jaxb.xmlmodel.XmlIsSetNullPolicy) NullPolicy(org.eclipse.persistence.oxm.mappings.nullpolicy.NullPolicy) XmlNullPolicy(org.eclipse.persistence.jaxb.xmlmodel.XmlNullPolicy) XmlAbstractNullPolicy(org.eclipse.persistence.jaxb.xmlmodel.XmlAbstractNullPolicy) AbstractNullPolicy(org.eclipse.persistence.oxm.mappings.nullpolicy.AbstractNullPolicy) XMLField(org.eclipse.persistence.oxm.XMLField) DatabaseField(org.eclipse.persistence.internal.helper.DatabaseField) Field(org.eclipse.persistence.internal.oxm.mappings.Field) JavaField(org.eclipse.persistence.jaxb.javamodel.JavaField) XMLDirectMapping(org.eclipse.persistence.oxm.mappings.XMLDirectMapping) JavaClass(org.eclipse.persistence.jaxb.javamodel.JavaClass) XMLDirectMapping(org.eclipse.persistence.oxm.mappings.XMLDirectMapping) DirectMapping(org.eclipse.persistence.internal.oxm.mappings.DirectMapping) JAXBException(org.eclipse.persistence.exceptions.JAXBException) DescriptorException(org.eclipse.persistence.exceptions.DescriptorException)

Example 64 with Field

use of org.eclipse.persistence.internal.oxm.mappings.Field in project eclipselink by eclipse-ee4j.

the class MappingsGenerator method generateDirectCollectionMapping.

public DirectCollectionMapping generateDirectCollectionMapping(Property property, Descriptor descriptor, NamespaceInfo namespaceInfo) {
    DirectCollectionMapping mapping = new XMLCompositeDirectCollectionMapping();
    initializeXMLMapping((XMLMapping) mapping, property);
    initializeXMLContainerMapping(mapping, property.getType().isArray());
    JavaClass collectionType = property.getType();
    if (collectionType.isArray()) {
        JAXBArrayAttributeAccessor accessor = new JAXBArrayAttributeAccessor(mapping.getAttributeAccessor(), mapping.getContainerPolicy(), helper.getClassLoader());
        String componentClassName = collectionType.getComponentType().getQualifiedName();
        if (collectionType.getComponentType().isPrimitive()) {
            Class<?> primitiveClass = XMLConversionManager.getDefaultManager().convertClassNameToClass(componentClassName);
            accessor.setComponentClass(primitiveClass);
            mapping.setAttributeAccessor(accessor);
            Class<?> declaredClass = XMLConversionManager.getObjectClass(primitiveClass);
            mapping.setAttributeElementClass(declaredClass);
        } else {
            accessor.setComponentClassName(componentClassName);
            mapping.setAttributeAccessor(accessor);
            JavaClass componentType = collectionType.getComponentType();
            try {
                Class<?> declaredClass = PrivilegedAccessHelper.getClassForName(componentType.getRawName(), false, helper.getClassLoader());
                mapping.setAttributeElementClass(declaredClass);
            } catch (Exception e) {
            }
        }
    } else if (helper.isCollectionType(collectionType)) {
        Collection args = collectionType.getActualTypeArguments();
        if (args.size() > 0) {
            JavaClass itemType = (JavaClass) args.iterator().next();
            try {
                Class<?> declaredClass = PrivilegedAccessHelper.getClassForName(itemType.getRawName(), false, helper.getClassLoader());
                if (declaredClass != String.class) {
                    mapping.setAttributeElementClass(declaredClass);
                }
            } catch (Exception e) {
            }
        }
    }
    collectionType = containerClassImpl(collectionType);
    mapping.useCollectionClassName(collectionType.getRawName());
    if (property.getDefaultValue() != null) {
        mapping.setNullValue(property.getDefaultValue());
    }
    // if the XPath is set (via xml-path) use it; otherwise figure it out
    Field xmlField = getXPathForField(property, namespaceInfo, true, false);
    mapping.setField(xmlField);
    if (helper.isAnnotationPresent(property.getElement(), XmlMixed.class)) {
        xmlField.setXPath("text()");
    }
    if (Constants.QNAME_QNAME.equals(property.getSchemaType())) {
        ((Field) mapping.getField()).setSchemaType(Constants.QNAME_QNAME);
    }
    // handle null policy set via xml metadata
    if (property.isSetNullPolicy()) {
        mapping.setNullPolicy(getNullPolicyFromProperty(property, getNamespaceResolverForDescriptor(namespaceInfo)));
    } else if (property.isNillable()) {
        mapping.getNullPolicy().setNullRepresentedByXsiNil(true);
        mapping.getNullPolicy().setMarshalNullRepresentation(XMLNullRepresentationType.XSI_NIL);
    }
    mapping.getNullPolicy().setNullRepresentedByEmptyNode(false);
    if (property.isSetXmlElementWrapper()) {
        mapping.setWrapperNullPolicy(getWrapperNullPolicyFromProperty(property));
    }
    if (property.isRequired()) {
        ((Field) mapping.getField()).setRequired(true);
    }
    if (property.isXmlElementType() && property.getGenericType() != null) {
        Class<?> theClass = org.eclipse.persistence.internal.helper.Helper.getClassFromClasseName(property.getGenericType().getQualifiedName(), helper.getClassLoader());
        mapping.setAttributeElementClass(theClass);
    }
    if (xmlField.getXPathFragment().isAttribute() || property.isXmlList() || xmlField.getXPathFragment().nameIsText()) {
        mapping.setUsesSingleNode(true);
    }
    // handle cdata set via metadata
    if (property.isSetCdata()) {
        mapping.setIsCDATA(property.isCdata());
    }
    return mapping;
}
Also used : XMLField(org.eclipse.persistence.oxm.XMLField) DatabaseField(org.eclipse.persistence.internal.helper.DatabaseField) Field(org.eclipse.persistence.internal.oxm.mappings.Field) JavaField(org.eclipse.persistence.jaxb.javamodel.JavaField) JavaClass(org.eclipse.persistence.jaxb.javamodel.JavaClass) JAXBArrayAttributeAccessor(org.eclipse.persistence.internal.jaxb.many.JAXBArrayAttributeAccessor) Collection(java.util.Collection) XMLCompositeDirectCollectionMapping(org.eclipse.persistence.oxm.mappings.XMLCompositeDirectCollectionMapping) JavaClass(org.eclipse.persistence.jaxb.javamodel.JavaClass) JAXBException(org.eclipse.persistence.exceptions.JAXBException) DescriptorException(org.eclipse.persistence.exceptions.DescriptorException) DirectCollectionMapping(org.eclipse.persistence.internal.oxm.mappings.DirectCollectionMapping) XMLCompositeDirectCollectionMapping(org.eclipse.persistence.oxm.mappings.XMLCompositeDirectCollectionMapping)

Example 65 with Field

use of org.eclipse.persistence.internal.oxm.mappings.Field in project eclipselink by eclipse-ee4j.

the class MappingsGenerator method generateChoiceCollectionMapping.

public ChoiceCollectionMapping generateChoiceCollectionMapping(Property property, Descriptor descriptor, NamespaceInfo namespace) {
    ChoiceCollectionMapping mapping = new XMLChoiceCollectionMapping();
    initializeXMLContainerMapping(mapping, property.getType().isArray());
    initializeXMLMapping((XMLChoiceCollectionMapping) mapping, property);
    JavaClass collectionType = property.getType();
    if (collectionType.isArray()) {
        JAXBArrayAttributeAccessor accessor = new JAXBArrayAttributeAccessor(mapping.getAttributeAccessor(), mapping.getContainerPolicy(), helper.getClassLoader());
        JavaClass componentType = collectionType.getComponentType();
        if (componentType.isArray()) {
            JavaClass baseComponentType = getBaseComponentType(componentType);
            if (baseComponentType.isPrimitive()) {
                Class<?> primitiveClass = XMLConversionManager.getDefaultManager().convertClassNameToClass(baseComponentType.getRawName());
                accessor.setComponentClass(primitiveClass);
            } else {
                accessor.setComponentClassName(baseComponentType.getQualifiedName());
            }
        } else {
            accessor.setComponentClassName(componentType.getQualifiedName());
        }
        mapping.setAttributeAccessor(accessor);
    }
    collectionType = containerClassImpl(collectionType);
    mapping.useCollectionClassName(collectionType.getRawName());
    if (property.isSetXmlElementWrapper()) {
        mapping.setWrapperNullPolicy(getWrapperNullPolicyFromProperty(property));
    }
    boolean isIdRef = property.isXmlIdRef();
    Iterator<Property> choiceProperties = property.getChoiceProperties().iterator();
    while (choiceProperties.hasNext()) {
        Property next = choiceProperties.next();
        JavaClass type = next.getType();
        JavaClass originalType = next.getType();
        Converter converter = null;
        Field xmlField = null;
        TypeInfo info = typeInfo.get(type.getName());
        if (info != null) {
            XmlJavaTypeAdapter adapter = info.getXmlJavaTypeAdapter();
            if (adapter != null) {
                String adapterValue = adapter.getValue();
                JavaClass adapterClass = helper.getJavaClass(adapterValue);
                JavaClass theClass = CompilerHelper.getTypeFromAdapterClass(adapterClass, helper);
                type = theClass;
                converter = new XMLJavaTypeConverter(adapterClass.getQualifiedName());
            }
        }
        if (next.getXmlJoinNodes() != null) {
            // handle XmlJoinNodes
            List<Field> srcFlds = new ArrayList<>();
            List<Field> tgtFlds = new ArrayList<>();
            for (XmlJoinNode xmlJoinNode : next.getXmlJoinNodes().getXmlJoinNode()) {
                srcFlds.add(new XMLField(xmlJoinNode.getXmlPath()));
                tgtFlds.add(new XMLField(xmlJoinNode.getReferencedXmlPath()));
            }
            mapping.addChoiceElement(srcFlds, type.getQualifiedName(), tgtFlds);
        } else if (isIdRef) {
            // handle IDREF
            String tgtXPath = null;
            TypeInfo referenceType = typeInfo.get(type.getQualifiedName());
            if (null != referenceType && referenceType.isIDSet()) {
                Property prop = referenceType.getIDProperty();
                tgtXPath = getXPathForField(prop, namespace, !prop.isAttribute(), false).getXPath();
            }
            // if the XPath is set (via xml-path) use it, otherwise figure it out
            Field srcXPath;
            if (next.getXmlPath() != null) {
                srcXPath = new XMLField(next.getXmlPath());
            } else {
                srcXPath = getXPathForField(next, namespace, true, false);
            }
            mapping.addChoiceElement(srcXPath.getXPath(), type.getQualifiedName(), tgtXPath);
        } else {
            Field xpath;
            if (next.getXmlPath() != null) {
                xpath = new XMLField(next.getXmlPath());
            } else {
                xpath = getXPathForField(next, namespace, (!(this.typeInfo.containsKey(type.getQualifiedName()))) || type.isEnum(), false);
            }
            xmlField = xpath;
            mapping.addChoiceElement(xpath.getName(), type.getQualifiedName());
            if (!originalType.getQualifiedName().equals(type.getQualifiedName())) {
                mapping.getClassNameToFieldMappings().putIfAbsent(originalType.getQualifiedName(), xpath);
                mapping.addConverter(xpath, converter);
            }
        }
        if (xmlField != null) {
            Mapping nestedMapping = (Mapping) mapping.getChoiceElementMappings().get(xmlField);
            if (nestedMapping.isAbstractCompositeCollectionMapping()) {
                // handle null policy set via xml metadata
                if (property.isSetNullPolicy()) {
                    ((CompositeCollectionMapping) nestedMapping).setNullPolicy(getNullPolicyFromProperty(property, getNamespaceResolverForDescriptor(namespace)));
                } else if (next.isNillable() && property.isNillable()) {
                    ((CompositeCollectionMapping) nestedMapping).getNullPolicy().setNullRepresentedByXsiNil(true);
                    ((CompositeCollectionMapping) nestedMapping).getNullPolicy().setMarshalNullRepresentation(XMLNullRepresentationType.XSI_NIL);
                }
            } else if (nestedMapping.isAbstractCompositeDirectCollectionMapping()) {
                if (next.isSetNullPolicy()) {
                    ((DirectCollectionMapping) nestedMapping).setNullPolicy(getNullPolicyFromProperty(next, getNamespaceResolverForDescriptor(namespace)));
                } else if (next.isNillable() && property.isNillable()) {
                    ((DirectCollectionMapping) nestedMapping).getNullPolicy().setNullRepresentedByXsiNil(true);
                    ((DirectCollectionMapping) nestedMapping).getNullPolicy().setMarshalNullRepresentation(XMLNullRepresentationType.XSI_NIL);
                }
                ((DirectCollectionMapping) nestedMapping).getNullPolicy().setNullRepresentedByEmptyNode(false);
                if (type.isEnum()) {
                    ((DirectCollectionMapping) nestedMapping).setValueConverter(buildJAXBEnumTypeConverter(nestedMapping, (EnumTypeInfo) info));
                }
            } else if (nestedMapping instanceof BinaryDataCollectionMapping) {
                if (next.isSetNullPolicy()) {
                    ((BinaryDataCollectionMapping) nestedMapping).setNullPolicy(getNullPolicyFromProperty(next, getNamespaceResolverForDescriptor(namespace)));
                } else if (next.isNillable() && property.isNillable()) {
                    ((BinaryDataCollectionMapping) nestedMapping).getNullPolicy().setNullRepresentedByXsiNil(true);
                    ((BinaryDataCollectionMapping) nestedMapping).getNullPolicy().setMarshalNullRepresentation(XMLNullRepresentationType.XSI_NIL);
                }
            }
        }
    }
    return mapping;
}
Also used : XMLField(org.eclipse.persistence.oxm.XMLField) JAXBArrayAttributeAccessor(org.eclipse.persistence.internal.jaxb.many.JAXBArrayAttributeAccessor) XmlJavaTypeAdapter(org.eclipse.persistence.jaxb.xmlmodel.XmlJavaTypeAdapter) ArrayList(java.util.ArrayList) XMLVariableXPathObjectMapping(org.eclipse.persistence.oxm.mappings.XMLVariableXPathObjectMapping) AnyObjectMapping(org.eclipse.persistence.internal.oxm.mappings.AnyObjectMapping) XMLChoiceCollectionMapping(org.eclipse.persistence.oxm.mappings.XMLChoiceCollectionMapping) XMLCompositeObjectMapping(org.eclipse.persistence.oxm.mappings.XMLCompositeObjectMapping) VariableXPathCollectionMapping(org.eclipse.persistence.internal.oxm.mappings.VariableXPathCollectionMapping) DirectCollectionMapping(org.eclipse.persistence.internal.oxm.mappings.DirectCollectionMapping) ChoiceCollectionMapping(org.eclipse.persistence.internal.oxm.mappings.ChoiceCollectionMapping) ChoiceObjectMapping(org.eclipse.persistence.internal.oxm.mappings.ChoiceObjectMapping) XMLVariableXPathCollectionMapping(org.eclipse.persistence.oxm.mappings.XMLVariableXPathCollectionMapping) XMLAnyObjectMapping(org.eclipse.persistence.oxm.mappings.XMLAnyObjectMapping) XMLDirectMapping(org.eclipse.persistence.oxm.mappings.XMLDirectMapping) XMLChoiceObjectMapping(org.eclipse.persistence.oxm.mappings.XMLChoiceObjectMapping) XMLMapping(org.eclipse.persistence.oxm.mappings.XMLMapping) CompositeCollectionMapping(org.eclipse.persistence.internal.oxm.mappings.CompositeCollectionMapping) XMLBinaryDataMapping(org.eclipse.persistence.oxm.mappings.XMLBinaryDataMapping) VariableXPathObjectMapping(org.eclipse.persistence.internal.oxm.mappings.VariableXPathObjectMapping) DirectMapping(org.eclipse.persistence.internal.oxm.mappings.DirectMapping) CollectionReferenceMapping(org.eclipse.persistence.internal.oxm.mappings.CollectionReferenceMapping) CompositeObjectMapping(org.eclipse.persistence.internal.oxm.mappings.CompositeObjectMapping) TransformationMapping(org.eclipse.persistence.internal.oxm.mappings.TransformationMapping) ObjectReferenceMapping(org.eclipse.persistence.internal.oxm.mappings.ObjectReferenceMapping) XMLAnyAttributeMapping(org.eclipse.persistence.oxm.mappings.XMLAnyAttributeMapping) XMLInverseReferenceMapping(org.eclipse.persistence.oxm.mappings.XMLInverseReferenceMapping) InverseReferenceMapping(org.eclipse.persistence.internal.oxm.mappings.InverseReferenceMapping) XMLTransformationMapping(org.eclipse.persistence.oxm.mappings.XMLTransformationMapping) CoreMapping(org.eclipse.persistence.core.mappings.CoreMapping) AnyCollectionMapping(org.eclipse.persistence.internal.oxm.mappings.AnyCollectionMapping) XMLBinaryDataCollectionMapping(org.eclipse.persistence.oxm.mappings.XMLBinaryDataCollectionMapping) DatabaseMapping(org.eclipse.persistence.mappings.DatabaseMapping) XMLCompositeCollectionMapping(org.eclipse.persistence.oxm.mappings.XMLCompositeCollectionMapping) XMLAnyCollectionMapping(org.eclipse.persistence.oxm.mappings.XMLAnyCollectionMapping) XMLCompositeDirectCollectionMapping(org.eclipse.persistence.oxm.mappings.XMLCompositeDirectCollectionMapping) Mapping(org.eclipse.persistence.internal.oxm.mappings.Mapping) XMLObjectReferenceMapping(org.eclipse.persistence.oxm.mappings.XMLObjectReferenceMapping) AnyAttributeMapping(org.eclipse.persistence.internal.oxm.mappings.AnyAttributeMapping) BinaryDataMapping(org.eclipse.persistence.internal.oxm.mappings.BinaryDataMapping) XMLContainerMapping(org.eclipse.persistence.internal.oxm.mappings.XMLContainerMapping) BinaryDataCollectionMapping(org.eclipse.persistence.internal.oxm.mappings.BinaryDataCollectionMapping) XMLCollectionReferenceMapping(org.eclipse.persistence.oxm.mappings.XMLCollectionReferenceMapping) XMLChoiceCollectionMapping(org.eclipse.persistence.oxm.mappings.XMLChoiceCollectionMapping) XMLBinaryDataCollectionMapping(org.eclipse.persistence.oxm.mappings.XMLBinaryDataCollectionMapping) BinaryDataCollectionMapping(org.eclipse.persistence.internal.oxm.mappings.BinaryDataCollectionMapping) XMLChoiceCollectionMapping(org.eclipse.persistence.oxm.mappings.XMLChoiceCollectionMapping) ChoiceCollectionMapping(org.eclipse.persistence.internal.oxm.mappings.ChoiceCollectionMapping) XmlJoinNode(org.eclipse.persistence.jaxb.xmlmodel.XmlJoinNodes.XmlJoinNode) DirectCollectionMapping(org.eclipse.persistence.internal.oxm.mappings.DirectCollectionMapping) XMLCompositeDirectCollectionMapping(org.eclipse.persistence.oxm.mappings.XMLCompositeDirectCollectionMapping) XMLField(org.eclipse.persistence.oxm.XMLField) DatabaseField(org.eclipse.persistence.internal.helper.DatabaseField) Field(org.eclipse.persistence.internal.oxm.mappings.Field) JavaField(org.eclipse.persistence.jaxb.javamodel.JavaField) JavaClass(org.eclipse.persistence.jaxb.javamodel.JavaClass) CompositeCollectionMapping(org.eclipse.persistence.internal.oxm.mappings.CompositeCollectionMapping) XMLCompositeCollectionMapping(org.eclipse.persistence.oxm.mappings.XMLCompositeCollectionMapping) CoreConverter(org.eclipse.persistence.core.mappings.converters.CoreConverter) JAXBEnumTypeConverter(org.eclipse.persistence.jaxb.JAXBEnumTypeConverter) JAXBElementConverter(org.eclipse.persistence.internal.jaxb.JAXBElementConverter) XMLListConverter(org.eclipse.persistence.oxm.mappings.converters.XMLListConverter) XMLConverter(org.eclipse.persistence.oxm.mappings.converters.XMLConverter) Converter(org.eclipse.persistence.mappings.converters.Converter) DefaultElementConverter(org.eclipse.persistence.internal.jaxb.DefaultElementConverter) DomHandlerConverter(org.eclipse.persistence.internal.jaxb.DomHandlerConverter) JAXBElementRootConverter(org.eclipse.persistence.internal.jaxb.JAXBElementRootConverter) XMLJavaTypeConverter(org.eclipse.persistence.internal.jaxb.XMLJavaTypeConverter) XMLJavaTypeConverter(org.eclipse.persistence.internal.jaxb.XMLJavaTypeConverter)

Aggregations

Field (org.eclipse.persistence.internal.oxm.mappings.Field)65 DatabaseField (org.eclipse.persistence.internal.helper.DatabaseField)20 XMLField (org.eclipse.persistence.oxm.XMLField)20 QName (javax.xml.namespace.QName)18 Descriptor (org.eclipse.persistence.internal.oxm.mappings.Descriptor)18 JavaField (org.eclipse.persistence.jaxb.javamodel.JavaField)16 DirectMapping (org.eclipse.persistence.internal.oxm.mappings.DirectMapping)14 JavaClass (org.eclipse.persistence.jaxb.javamodel.JavaClass)13 CompositeObjectMapping (org.eclipse.persistence.internal.oxm.mappings.CompositeObjectMapping)12 ArrayList (java.util.ArrayList)11 Mapping (org.eclipse.persistence.internal.oxm.mappings.Mapping)11 AbstractNullPolicy (org.eclipse.persistence.oxm.mappings.nullpolicy.AbstractNullPolicy)11 List (java.util.List)10 BinaryDataMapping (org.eclipse.persistence.internal.oxm.mappings.BinaryDataMapping)10 CoreMapping (org.eclipse.persistence.core.mappings.CoreMapping)9 ClassDescriptor (org.eclipse.persistence.descriptors.ClassDescriptor)8 SAXException (org.xml.sax.SAXException)8 CoreConverter (org.eclipse.persistence.core.mappings.converters.CoreConverter)7 XPathFragment (org.eclipse.persistence.internal.oxm.XPathFragment)7 BinaryDataCollectionMapping (org.eclipse.persistence.internal.oxm.mappings.BinaryDataCollectionMapping)7