* @param workingSchema
* @param converter
*/
protected void processEnumeration(String schemaTypeString, XPathFragment frag, DirectMapping mapping, Sequence seq, ComplexType ct, Schema workingSchema, CoreConverter converter) {
Element elem = null;
Attribute attr = null;
if (frag.isAttribute()) {
attr = buildAttribute(mapping, schemaTypeString);
} else {
elem = buildElement(frag, schemaTypeString, Occurs.ZERO, null);
}
Collection<String> fieldValues = ((EnumTypeConverter) converter).getAttributeToFieldValues().values();
ArrayList facets = new ArrayList();
for (String field : fieldValues) {
facets.add(field);
}
Restriction restriction = new Restriction();
restriction.setEnumerationFacets(facets);
SimpleType st = new SimpleType();
st.setRestriction(restriction);
if (frag.isAttribute()) {
attr.setSimpleType(st);
ct.getOrderedAttributes().add(attr);
} else {
elem.setSimpleType(st);
seq.addElement(elem);
}