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;
}
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;
}
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;
}
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;
}
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;
}
Aggregations