use of org.eclipse.persistence.oxm.mappings.XMLAnyObjectMapping in project eclipselink by eclipse-ee4j.
the class AnyObjectAndAnyCollectionUC06NoDefaultRootComplexChildrenTestCases method buildRootDescriptor.
protected //
ClassDescriptor buildRootDescriptor(//
boolean firstMappingIsAnyCollection, //
boolean firstMappingXPathSet, //
boolean secondMappingIsAnyCollection, boolean secondMappingXPathSet) {
//
XMLDescriptor descriptor = new XMLDescriptor();
descriptor.setJavaClass(Customer.class);
descriptor.setDefaultRootElement("customer");
DatabaseMapping anyMapping1 = null;
// First Mapping
if (!firstMappingIsAnyCollection) {
anyMapping1 = new XMLAnyObjectMapping();
anyMapping1.setAttributeName("anyObject");
// ((XMLAnyObjectMapping) anyMapping1).setSetMethodName("setAnyObject");
if (firstMappingXPathSet) {
// set first mapping XPath
((XMLAnyObjectMapping) anyMapping1).setXPath(MAPPING_XPATH_OBJ);
}
descriptor.addMapping(anyMapping1);
} else {
anyMapping1 = new XMLAnyCollectionMapping();
anyMapping1.setAttributeName("contactMethods");
// ((XMLAnyCollectionMapping) anyMapping1).setSetMethodName("setAnyCollection");
if (firstMappingXPathSet) {
// set first mapping XPath
((XMLAnyCollectionMapping) anyMapping1).setXPath(MAPPING_XPATH);
}
descriptor.addMapping(anyMapping1);
}
// Second Mapping
DatabaseMapping anyMapping2 = null;
if (!secondMappingIsAnyCollection) {
anyMapping2 = new XMLAnyObjectMapping();
anyMapping2.setAttributeName("anyObject");
// ((XMLAnyObjectMapping) anyMapping2).setSetMethodName("setAnyObject");
if (secondMappingXPathSet) {
// set second mapping XPath
((XMLAnyObjectMapping) anyMapping2).setXPath(MAPPING_XPATH_OBJ);
}
descriptor.addMapping(anyMapping2);
} else {
anyMapping2 = new XMLAnyCollectionMapping();
anyMapping2.setAttributeName("contactMethods");
// ((XMLAnyCollectionMapping) anyMapping2).setSetMethodName("setAnyCollection");
if (secondMappingXPathSet) {
// set second mapping XPath
((XMLAnyCollectionMapping) anyMapping2).setXPath(MAPPING_XPATH);
}
descriptor.addMapping(anyMapping2);
}
return descriptor;
}
use of org.eclipse.persistence.oxm.mappings.XMLAnyObjectMapping in project eclipselink by eclipse-ee4j.
the class AnyObjectNoDefaultRootWithoutGroupingElementProject method buildRootDescriptor.
@Override
public ClassDescriptor buildRootDescriptor() {
XMLDescriptor descriptor = new XMLDescriptor();
descriptor.setJavaClass(Root.class);
descriptor.setDefaultRootElement("root");
XMLAnyObjectMapping anyObjectMapping = new XMLAnyObjectMapping();
anyObjectMapping.setXPath("nested");
anyObjectMapping.setAttributeName("any");
anyObjectMapping.setGetMethodName("getAny");
anyObjectMapping.setSetMethodName("setAny");
descriptor.addMapping(anyObjectMapping);
return descriptor;
}
use of org.eclipse.persistence.oxm.mappings.XMLAnyObjectMapping in project eclipselink by eclipse-ee4j.
the class AnyObjectAndAnyCollectionUC01NoDefaultRootComplexChildrenTestCases method buildRootDescriptor.
protected //
ClassDescriptor buildRootDescriptor(//
boolean firstMappingIsAnyCollection, //
boolean firstMappingXPathSet, //
boolean secondMappingIsAnyCollection, boolean secondMappingXPathSet) {
//
XMLDescriptor descriptor = new XMLDescriptor();
descriptor.setJavaClass(Customer.class);
descriptor.setDefaultRootElement("customer");
DatabaseMapping anyMapping1 = null;
// First Mapping
if (!firstMappingIsAnyCollection) {
anyMapping1 = new XMLAnyObjectMapping();
anyMapping1.setAttributeName("anyObject");
anyMapping1.setGetMethodName("getAnyObject");
anyMapping1.setSetMethodName("setAnyObject");
if (firstMappingXPathSet) {
// set first mapping XPath
((XMLAnyObjectMapping) anyMapping1).setXPath(MAPPING_XPATH_OBJ);
}
descriptor.addMapping(anyMapping1);
} else {
anyMapping1 = new XMLAnyCollectionMapping();
anyMapping1.setAttributeName("contactMethods");
anyMapping1.setGetMethodName("getContactMethods");
anyMapping1.setSetMethodName("setContactMethods");
if (firstMappingXPathSet) {
// set first mapping XPath
((XMLAnyCollectionMapping) anyMapping1).setXPath(MAPPING_XPATH);
}
descriptor.addMapping(anyMapping1);
}
// Second Mapping
DatabaseMapping anyMapping2 = null;
if (!secondMappingIsAnyCollection) {
anyMapping2 = new XMLAnyObjectMapping();
anyMapping2.setAttributeName("anyObject");
anyMapping2.setGetMethodName("getAnyObject");
anyMapping2.setSetMethodName("setAnyObject");
if (secondMappingXPathSet) {
// set second mapping XPath
((XMLAnyObjectMapping) anyMapping2).setXPath(MAPPING_XPATH_OBJ);
}
descriptor.addMapping(anyMapping2);
} else {
anyMapping2 = new XMLAnyCollectionMapping();
anyMapping2.setAttributeName("contactMethods");
anyMapping2.setGetMethodName("getContactMethods");
anyMapping2.setSetMethodName("setContactMethods");
if (secondMappingXPathSet) {
// set second mapping XPath
((XMLAnyCollectionMapping) anyMapping2).setXPath(MAPPING_XPATH);
}
descriptor.addMapping(anyMapping2);
}
return descriptor;
}
use of org.eclipse.persistence.oxm.mappings.XMLAnyObjectMapping in project eclipselink by eclipse-ee4j.
the class AnyObjectAndAnyCollectionUC02NoDefaultRootComplexChildrenTestCases method buildRootDescriptor.
protected //
ClassDescriptor buildRootDescriptor(//
boolean firstMappingIsAnyCollection, //
boolean firstMappingXPathSet, //
boolean secondMappingIsAnyCollection, boolean secondMappingXPathSet) {
//
XMLDescriptor descriptor = new XMLDescriptor();
descriptor.setJavaClass(Customer.class);
descriptor.setDefaultRootElement("customer");
DatabaseMapping anyMapping1 = null;
// First Mapping
if (!firstMappingIsAnyCollection) {
anyMapping1 = new XMLAnyObjectMapping();
anyMapping1.setAttributeName("anyObject");
// ((XMLAnyObjectMapping) anyMapping1).setSetMethodName("setAnyObject");
if (firstMappingXPathSet) {
// set first mapping XPath
((XMLAnyObjectMapping) anyMapping1).setXPath(MAPPING_XPATH_OBJ);
}
descriptor.addMapping(anyMapping1);
} else {
anyMapping1 = new XMLAnyCollectionMapping();
anyMapping1.setAttributeName("contactMethods");
// ((XMLAnyCollectionMapping) anyMapping1).setSetMethodName("setAnyCollection");
if (firstMappingXPathSet) {
// set first mapping XPath
((XMLAnyCollectionMapping) anyMapping1).setXPath(MAPPING_XPATH);
}
descriptor.addMapping(anyMapping1);
}
// Second Mapping
DatabaseMapping anyMapping2 = null;
if (!secondMappingIsAnyCollection) {
anyMapping2 = new XMLAnyObjectMapping();
anyMapping2.setAttributeName("anyObject");
// ((XMLAnyObjectMapping) anyMapping2).setSetMethodName("setAnyObject");
if (secondMappingXPathSet) {
// set second mapping XPath
((XMLAnyObjectMapping) anyMapping2).setXPath(MAPPING_XPATH_OBJ);
}
descriptor.addMapping(anyMapping2);
} else {
anyMapping2 = new XMLAnyCollectionMapping();
anyMapping2.setAttributeName("contactMethods");
// ((XMLAnyCollectionMapping) anyMapping2).setSetMethodName("setAnyCollection");
if (secondMappingXPathSet) {
// set second mapping XPath
((XMLAnyCollectionMapping) anyMapping2).setXPath(MAPPING_XPATH);
}
descriptor.addMapping(anyMapping2);
}
return descriptor;
}
use of org.eclipse.persistence.oxm.mappings.XMLAnyObjectMapping in project eclipselink by eclipse-ee4j.
the class AnyObjectAndAnyCollectionUC08NoDefaultRootComplexChildrenTestCases method buildRootDescriptor.
protected //
ClassDescriptor buildRootDescriptor(//
boolean firstMappingIsAnyCollection, //
boolean firstMappingXPathSet, //
boolean secondMappingIsAnyCollection, boolean secondMappingXPathSet) {
//
XMLDescriptor descriptor = new XMLDescriptor();
descriptor.setJavaClass(Customer.class);
descriptor.setDefaultRootElement("customer");
DatabaseMapping anyMapping1 = null;
// First Mapping
if (!firstMappingIsAnyCollection) {
anyMapping1 = new XMLAnyObjectMapping();
anyMapping1.setAttributeName("anyObject");
// ((XMLAnyObjectMapping) anyMapping1).setSetMethodName("setAnyObject");
if (firstMappingXPathSet) {
// set first mapping XPath
((XMLAnyObjectMapping) anyMapping1).setXPath(MAPPING_XPATH_OBJ);
}
descriptor.addMapping(anyMapping1);
} else {
anyMapping1 = new XMLAnyCollectionMapping();
anyMapping1.setAttributeName("contactMethods");
// ((XMLAnyCollectionMapping) anyMapping1).setSetMethodName("setAnyCollection");
if (firstMappingXPathSet) {
// set first mapping XPath
((XMLAnyCollectionMapping) anyMapping1).setXPath(MAPPING_XPATH);
}
descriptor.addMapping(anyMapping1);
}
// Second Mapping
DatabaseMapping anyMapping2 = null;
if (!secondMappingIsAnyCollection) {
anyMapping2 = new XMLAnyObjectMapping();
anyMapping2.setAttributeName("anyObject");
// ((XMLAnyObjectMapping) anyMapping2).setSetMethodName("setAnyObject");
if (secondMappingXPathSet) {
// set second mapping XPath
((XMLAnyObjectMapping) anyMapping2).setXPath(MAPPING_XPATH_OBJ);
}
descriptor.addMapping(anyMapping2);
} else {
anyMapping2 = new XMLAnyCollectionMapping();
anyMapping2.setAttributeName("contactMethods");
// ((XMLAnyCollectionMapping) anyMapping2).setSetMethodName("setAnyCollection");
if (secondMappingXPathSet) {
// set second mapping XPath
((XMLAnyCollectionMapping) anyMapping2).setXPath(MAPPING_XPATH);
}
descriptor.addMapping(anyMapping2);
}
return descriptor;
}
Aggregations