use of org.eclipse.persistence.oxm.mappings.XMLDirectMapping in project eclipselink by eclipse-ee4j.
the class XMLEntityMappingsMappingProject method buildAccessMethodsDescriptor.
/**
* INTERNAL:
* XSD: access-methods
*/
protected ClassDescriptor buildAccessMethodsDescriptor() {
XMLDescriptor descriptor = new XMLDescriptor();
descriptor.setJavaClass(AccessMethodsMetadata.class);
XMLDirectMapping getMethodMapping = new XMLDirectMapping();
getMethodMapping.setAttributeName("m_getMethodName");
getMethodMapping.setGetMethodName("getGetMethodName");
getMethodMapping.setSetMethodName("setGetMethodName");
getMethodMapping.setXPath("@get-method");
descriptor.addMapping(getMethodMapping);
XMLDirectMapping setMethodMapping = new XMLDirectMapping();
setMethodMapping.setAttributeName("m_setMethodName");
setMethodMapping.setGetMethodName("getSetMethodName");
setMethodMapping.setSetMethodName("setSetMethodName");
setMethodMapping.setXPath("@set-method");
descriptor.addMapping(setMethodMapping);
return descriptor;
}
use of org.eclipse.persistence.oxm.mappings.XMLDirectMapping in project eclipselink by eclipse-ee4j.
the class XMLEntityMappingsMappingProject method getClassTypeAttributeMapping.
/**
* INTERNAL:
*/
protected XMLDirectMapping getClassTypeAttributeMapping() {
XMLDirectMapping mapping = new XMLDirectMapping();
mapping.setAttributeName("m_typeName");
mapping.setGetMethodName("getTypeName");
mapping.setSetMethodName("setTypeName");
mapping.setXPath("@class");
return mapping;
}
use of org.eclipse.persistence.oxm.mappings.XMLDirectMapping in project eclipselink by eclipse-ee4j.
the class XMLEntityMappingsMappingProject method getQueryParameterAttributeMapping.
/**
* INTERNAL:
*/
protected XMLDirectMapping getQueryParameterAttributeMapping() {
XMLDirectMapping queryParameterMapping = new XMLDirectMapping();
queryParameterMapping.setAttributeName("m_queryParameter");
queryParameterMapping.setGetMethodName("getQueryParameter");
queryParameterMapping.setSetMethodName("setQueryParameter");
queryParameterMapping.setXPath("@query-parameter");
return queryParameterMapping;
}
use of org.eclipse.persistence.oxm.mappings.XMLDirectMapping in project eclipselink by eclipse-ee4j.
the class XMLEntityMappingsMappingProject method getLengthAttributeMapping.
/**
* INTERNAL:
*/
protected XMLDirectMapping getLengthAttributeMapping() {
XMLDirectMapping lengthMapping = new XMLDirectMapping();
lengthMapping.setAttributeName("m_length");
lengthMapping.setGetMethodName("getLength");
lengthMapping.setSetMethodName("setLength");
lengthMapping.setXPath("@length");
return lengthMapping;
}
use of org.eclipse.persistence.oxm.mappings.XMLDirectMapping in project eclipselink by eclipse-ee4j.
the class MappingsGenerator method generateDirectEnumerationMapping.
public DirectMapping generateDirectEnumerationMapping(Property property, Descriptor descriptor, NamespaceInfo namespaceInfo, EnumTypeInfo enumInfo) {
DirectMapping mapping = new XMLDirectMapping();
initializeXMLMapping((XMLMapping) mapping, property);
mapping.setNullValueMarshalled(true);
mapping.setConverter(buildJAXBEnumTypeConverter(mapping, enumInfo));
// 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.setField(getXPathForField(property, namespaceInfo, true, false));
if (!mapping.getXPath().equals("text()")) {
((NullPolicy) mapping.getNullPolicy()).setSetPerformedForAbsentNode(false);
}
return mapping;
}
Aggregations