Search in sources :

Example 21 with XMLDirectMapping

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

the class OXMObjectPersistenceRuntimeXMLProject method buildXMLBinaryDataCollectionMappingDescriptor.

public ClassDescriptor buildXMLBinaryDataCollectionMappingDescriptor() {
    XMLDescriptor descriptor = new XMLDescriptor();
    descriptor.setJavaClass(XMLBinaryDataCollectionMapping.class);
    descriptor.getInheritancePolicy().setParentClass(XMLCompositeDirectCollectionMapping.class);
    XMLDirectMapping swaRefMapping = new XMLDirectMapping();
    swaRefMapping.setAttributeName("isSwaRef");
    swaRefMapping.setXPath(getPrimaryNamespaceXPath() + "is-swa-ref/text()");
    descriptor.addMapping(swaRefMapping);
    XMLDirectMapping mimeTypeMapping = new XMLDirectMapping();
    mimeTypeMapping.setAttributeName("mimeTypePolicy");
    mimeTypeMapping.setGetMethodName("getMimeType");
    mimeTypeMapping.setSetMethodName("setMimeType");
    mimeTypeMapping.setXPath(getPrimaryNamespaceXPath() + "mime-type/text()");
    descriptor.addMapping(mimeTypeMapping);
    XMLDirectMapping shouldInlineMapping = new XMLDirectMapping();
    shouldInlineMapping.setAttributeName("shouldInlineBinaryData");
    shouldInlineMapping.setXPath(getPrimaryNamespaceXPath() + "should-inline-data");
    descriptor.addMapping(shouldInlineMapping);
    return descriptor;
}
Also used : XMLDescriptor(org.eclipse.persistence.oxm.XMLDescriptor) XMLDirectMapping(org.eclipse.persistence.oxm.mappings.XMLDirectMapping)

Example 22 with XMLDirectMapping

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

the class OXMObjectPersistenceRuntimeXMLProject method buildXMLBinaryDataMappingDescriptor.

public ClassDescriptor buildXMLBinaryDataMappingDescriptor() {
    XMLDescriptor descriptor = new XMLDescriptor();
    descriptor.setJavaClass(XMLBinaryDataMapping.class);
    descriptor.getInheritancePolicy().setParentClass(XMLDirectMapping.class);
    XMLDirectMapping swaRefMapping = new XMLDirectMapping();
    swaRefMapping.setAttributeName("isSwaRef");
    swaRefMapping.setXPath(getPrimaryNamespaceXPath() + "is-swa-ref/text()");
    descriptor.addMapping(swaRefMapping);
    XMLDirectMapping mimeTypeMapping = new XMLDirectMapping();
    mimeTypeMapping.setAttributeName("mimeTypePolicy");
    mimeTypeMapping.setGetMethodName("getMimeType");
    mimeTypeMapping.setSetMethodName("setMimeType");
    mimeTypeMapping.setXPath(getPrimaryNamespaceXPath() + "mime-type/text()");
    descriptor.addMapping(mimeTypeMapping);
    XMLDirectMapping shouldInlineMapping = new XMLDirectMapping();
    shouldInlineMapping.setAttributeName("shouldInlineBinaryData");
    shouldInlineMapping.setXPath(getPrimaryNamespaceXPath() + "should-inline-data");
    descriptor.addMapping(shouldInlineMapping);
    return descriptor;
}
Also used : XMLDescriptor(org.eclipse.persistence.oxm.XMLDescriptor) XMLDirectMapping(org.eclipse.persistence.oxm.mappings.XMLDirectMapping)

Example 23 with XMLDirectMapping

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

the class ObjectPersistenceRuntimeXMLProject method buildTypeConversionConverterDescriptor.

protected ClassDescriptor buildTypeConversionConverterDescriptor() {
    XMLDescriptor descriptor = new XMLDescriptor();
    descriptor.setJavaClass(TypeConversionConverter.class);
    descriptor.getInheritancePolicy().setParentClass(Converter.class);
    XMLDirectMapping objectClassMapping = new XMLDirectMapping();
    objectClassMapping.setAttributeName("objectClass");
    objectClassMapping.setGetMethodName("getObjectClass");
    objectClassMapping.setSetMethodName("setObjectClass");
    objectClassMapping.setXPath(getPrimaryNamespaceXPath() + "object-class/text()");
    descriptor.addMapping(objectClassMapping);
    XMLDirectMapping dataClassMapping = new XMLDirectMapping();
    dataClassMapping.setAttributeName("dataClass");
    dataClassMapping.setGetMethodName("getDataClass");
    dataClassMapping.setSetMethodName("setDataClass");
    dataClassMapping.setXPath(getPrimaryNamespaceXPath() + "data-class/text()");
    descriptor.addMapping(dataClassMapping);
    return descriptor;
}
Also used : XMLDescriptor(org.eclipse.persistence.oxm.XMLDescriptor) XMLDirectMapping(org.eclipse.persistence.oxm.mappings.XMLDirectMapping)

Example 24 with XMLDirectMapping

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

the class EclipseLinkObjectPersistenceRuntimeXMLProject method buildXMLAnyObjectMappingDescriptor.

@Override
protected ClassDescriptor buildXMLAnyObjectMappingDescriptor() {
    ClassDescriptor descriptor = super.buildXMLAnyObjectMappingDescriptor();
    XMLDirectMapping keepAsElementMapping = new XMLDirectMapping();
    keepAsElementMapping.setAttributeName("keepAsElementPolicy");
    keepAsElementMapping.setGetMethodName("getKeepAsElementPolicy");
    keepAsElementMapping.setSetMethodName("setKeepAsElementPolicy");
    keepAsElementMapping.setXPath(getPrimaryNamespaceXPath() + "keep-as-element-policy");
    EnumTypeConverter converter = new EnumTypeConverter(keepAsElementMapping, UnmarshalKeepAsElementPolicy.class, false);
    keepAsElementMapping.setConverter(converter);
    descriptor.addMapping(keepAsElementMapping);
    return descriptor;
}
Also used : ClassDescriptor(org.eclipse.persistence.descriptors.ClassDescriptor) XMLDirectMapping(org.eclipse.persistence.oxm.mappings.XMLDirectMapping) EnumTypeConverter(org.eclipse.persistence.mappings.converters.EnumTypeConverter)

Example 25 with XMLDirectMapping

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

the class EclipseLinkObjectPersistenceRuntimeXMLProject method buildXMLCompositeDirectCollectionMappingDescriptor.

@Override
protected ClassDescriptor buildXMLCompositeDirectCollectionMappingDescriptor() {
    XMLDescriptor descriptor = (XMLDescriptor) super.buildXMLCompositeDirectCollectionMappingDescriptor();
    XMLCompositeObjectMapping aMapping = new XMLCompositeObjectMapping();
    aMapping.setReferenceClass(AbstractNullPolicy.class);
    aMapping.setAttributeName("nullPolicy");
    aMapping.setXPath(getPrimaryNamespaceXPath() + "null-policy");
    aMapping.setAttributeAccessor(new NullPolicyAttributeAccessor());
    descriptor.addMapping(aMapping);
    XMLDirectMapping reuseContainerMapping = new XMLDirectMapping();
    reuseContainerMapping.setAttributeName("reuseContainer");
    reuseContainerMapping.setGetMethodName("getReuseContainer");
    reuseContainerMapping.setSetMethodName("setReuseContainer");
    reuseContainerMapping.setXPath(getPrimaryNamespaceXPath() + "reuse-container/text()");
    reuseContainerMapping.setNullValue(Boolean.FALSE);
    descriptor.addMapping(reuseContainerMapping);
    return descriptor;
}
Also used : XMLDescriptor(org.eclipse.persistence.oxm.XMLDescriptor) XMLDirectMapping(org.eclipse.persistence.oxm.mappings.XMLDirectMapping) XMLCompositeObjectMapping(org.eclipse.persistence.oxm.mappings.XMLCompositeObjectMapping)

Aggregations

XMLDirectMapping (org.eclipse.persistence.oxm.mappings.XMLDirectMapping)802 XMLDescriptor (org.eclipse.persistence.oxm.XMLDescriptor)630 XMLCompositeObjectMapping (org.eclipse.persistence.oxm.mappings.XMLCompositeObjectMapping)103 XMLField (org.eclipse.persistence.oxm.XMLField)100 XMLCompositeCollectionMapping (org.eclipse.persistence.oxm.mappings.XMLCompositeCollectionMapping)78 NamespaceResolver (org.eclipse.persistence.oxm.NamespaceResolver)74 XMLSchemaClassPathReference (org.eclipse.persistence.oxm.schema.XMLSchemaClassPathReference)53 XMLCompositeDirectCollectionMapping (org.eclipse.persistence.oxm.mappings.XMLCompositeDirectCollectionMapping)41 ClassDescriptor (org.eclipse.persistence.descriptors.ClassDescriptor)35 QName (javax.xml.namespace.QName)33 ObjectTypeConverter (org.eclipse.persistence.mappings.converters.ObjectTypeConverter)28 XMLSchemaURLReference (org.eclipse.persistence.oxm.schema.XMLSchemaURLReference)26 AttributeAccessor (org.eclipse.persistence.mappings.AttributeAccessor)25 ArrayList (java.util.ArrayList)24 XMLObjectReferenceMapping (org.eclipse.persistence.oxm.mappings.XMLObjectReferenceMapping)22 URL (java.net.URL)21 XMLCollectionReferenceMapping (org.eclipse.persistence.oxm.mappings.XMLCollectionReferenceMapping)21 List (java.util.List)15 DatabaseField (org.eclipse.persistence.internal.helper.DatabaseField)14 IsSetNullPolicy (org.eclipse.persistence.oxm.mappings.nullpolicy.IsSetNullPolicy)14