private void marshalElementType(String elementNs,
String elementLocal,
XSTypeDefinition type,
boolean declareNs,
boolean nillable,
boolean declareXsiType)
{
switch(type.getTypeCategory())
{
case XSTypeDefinition.SIMPLE_TYPE:
marshalSimpleType(elementNs,
elementLocal,
(XSSimpleTypeDefinition)type,
declareNs,
nillable,
declareXsiType
);
break;
case XSTypeDefinition.COMPLEX_TYPE:
marshalComplexType(elementNs, elementLocal, (XSComplexTypeDefinition)type, declareNs, declareXsiType);
break;
default:
throw new IllegalStateException("Unexpected type category: " + type.getTypeCategory());
}
}