use of org.eclipse.persistence.oxm.mappings.XMLDirectMapping in project eclipselink by eclipse-ee4j.
the class EclipseLinkObjectPersistenceRuntimeXMLProject method buildXMLFieldDescriptor.
@Override
protected ClassDescriptor buildXMLFieldDescriptor() {
XMLDescriptor descriptor = (XMLDescriptor) super.buildXMLFieldDescriptor();
XMLDirectMapping isRequiredMapping = new XMLDirectMapping();
isRequiredMapping.setAttributeName("isRequired");
isRequiredMapping.setGetMethodName("isRequired");
isRequiredMapping.setSetMethodName("setRequired");
isRequiredMapping.setXPath(getPrimaryNamespaceXPath() + "@is-required");
isRequiredMapping.setNullValue(Boolean.FALSE);
descriptor.addMapping(isRequiredMapping);
return descriptor;
}
use of org.eclipse.persistence.oxm.mappings.XMLDirectMapping in project eclipselink by eclipse-ee4j.
the class EclipseLinkObjectPersistenceRuntimeXMLProject method buildXMLChoiceCollectionMappingDescriptor.
@Override
protected ClassDescriptor buildXMLChoiceCollectionMappingDescriptor() {
XMLDescriptor descriptor = (XMLDescriptor) super.buildXMLChoiceCollectionMappingDescriptor();
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;
}
use of org.eclipse.persistence.oxm.mappings.XMLDirectMapping in project eclipselink by eclipse-ee4j.
the class EclipseLinkObjectPersistenceRuntimeXMLProject method buildXMLCompositeObjectMappingDescriptor.
@Override
protected ClassDescriptor buildXMLCompositeObjectMappingDescriptor() {
ClassDescriptor descriptor = super.buildXMLCompositeObjectMappingDescriptor();
// Add container accessor mapping
XMLDirectMapping containerAttributeMapping = new XMLDirectMapping();
containerAttributeMapping.setAttributeName("containerAttributeName");
containerAttributeMapping.setGetMethodName("getContainerAttributeName");
containerAttributeMapping.setSetMethodName("setContainerAttributeName");
containerAttributeMapping.setXPath("container-attribute/text()");
((NullPolicy) containerAttributeMapping.getNullPolicy()).setSetPerformedForAbsentNode(false);
descriptor.addMapping(containerAttributeMapping);
XMLDirectMapping containerGetMethodMapping = new XMLDirectMapping();
containerGetMethodMapping.setAttributeName("containerGetMethodName");
containerGetMethodMapping.setGetMethodName("getContainerGetMethodName");
containerGetMethodMapping.setSetMethodName("setContainerGetMethodName");
containerGetMethodMapping.setXPath("container-get-method/text()");
((NullPolicy) containerGetMethodMapping.getNullPolicy()).setSetPerformedForAbsentNode(false);
descriptor.addMapping(containerGetMethodMapping);
XMLDirectMapping containerSetMethodMapping = new XMLDirectMapping();
containerSetMethodMapping.setAttributeName("containerSetMethodName");
containerSetMethodMapping.setGetMethodName("getContainerSetMethodName");
containerSetMethodMapping.setSetMethodName("setContainerSetMethodName");
containerSetMethodMapping.setXPath("container-set-method/text()");
((NullPolicy) containerSetMethodMapping.getNullPolicy()).setSetPerformedForAbsentNode(false);
descriptor.addMapping(containerSetMethodMapping);
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 buildXMLListConverterDescriptor.
protected ClassDescriptor buildXMLListConverterDescriptor() {
XMLDescriptor descriptor = new XMLDescriptor();
descriptor.setJavaClass(XMLListConverter.class);
descriptor.getInheritancePolicy().setParentClass(Converter.class);
XMLDirectMapping fieldSubElementClassNameMapping = new XMLDirectMapping();
fieldSubElementClassNameMapping.setAttributeName("objectClassName");
fieldSubElementClassNameMapping.setGetMethodName("getObjectClassName");
fieldSubElementClassNameMapping.setSetMethodName("setObjectClassName");
fieldSubElementClassNameMapping.setXPath(getPrimaryNamespaceXPath() + "object-class-name");
descriptor.addMapping(fieldSubElementClassNameMapping);
return descriptor;
}
use of org.eclipse.persistence.oxm.mappings.XMLDirectMapping in project eclipselink by eclipse-ee4j.
the class EclipseLinkObjectPersistenceRuntimeXMLProject method buildXMLAnyAttributeMappingDescriptor.
@Override
protected ClassDescriptor buildXMLAnyAttributeMappingDescriptor() {
ClassDescriptor descriptor = super.buildXMLAnyAttributeMappingDescriptor();
XMLDirectMapping includeNamespaceDeclarationMapping = new XMLDirectMapping();
includeNamespaceDeclarationMapping.setAttributeName("isNamespaceDeclarationIncluded");
includeNamespaceDeclarationMapping.setGetMethodName("isNamespaceDeclarationIncluded");
includeNamespaceDeclarationMapping.setSetMethodName("setNamespaceDeclarationIncluded");
includeNamespaceDeclarationMapping.setXPath(getPrimaryNamespaceXPath() + "include-namespace-declaration/text()");
descriptor.addMapping(includeNamespaceDeclarationMapping);
XMLDirectMapping includeSchemaInstanceMapping = new XMLDirectMapping();
includeSchemaInstanceMapping.setAttributeName("isSchemaInstanceIncluded");
includeSchemaInstanceMapping.setGetMethodName("isSchemaInstanceIncluded");
includeSchemaInstanceMapping.setSetMethodName("setSchemaInstanceIncluded");
includeSchemaInstanceMapping.setXPath(getPrimaryNamespaceXPath() + "include-schema-instance/text()");
descriptor.addMapping(includeSchemaInstanceMapping);
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