return mapping;
}
public void generateDirectEnumerationMapping(Property property, XMLDescriptor descriptor, NamespaceInfo namespaceInfo, EnumTypeInfo enumInfo) {
XMLDirectMapping mapping = new XMLDirectMapping();
JAXBEnumTypeConverter converter = new JAXBEnumTypeConverter(mapping, enumInfo.getClassName(), false);
mapping.setConverter(converter);
mapping.setAttributeName(property.getPropertyName());
if(property.isMethodProperty()) {
mapping.setGetMethodName(property.getGetMethodName());
mapping.setSetMethodName(property.getSetMethodName());
}
mapping.setField(getXPathForField(property, namespaceInfo, true));
HashMap<Object, String> enumValuesMap = enumInfo.getObjectValuesToFieldValues();
for (Object o : enumValuesMap.keySet()) {
String fieldValue = enumValuesMap.get(o);
converter.addConversionValue(fieldValue, o);
}
descriptor.addMapping(mapping);
}