param.setAttribute("array", Boolean.toString(isarray));
String javatype;
if (element.getSchemaType() instanceof XmlSchemaSimpleType) {
// simple type translates to format element in binding
FormatElement format = (FormatElement)simpleTypeMap.get(typename);
if (format == null) {
throw new RuntimeException("Cannot unwrap element " +
qname + ": no format definition found for type " +
typename + " (used by element " + itemname + ')');
}
javatype = format.getTypeName();
param.setAttribute("form", "simple");
param.setAttribute("serializer", format.getSerializerName());
param.setAttribute("deserializer", format.getDeserializerName());
// convert primitive types to wrapper types for nillable
if (element.isNillable() && s_wrapperMap.containsKey(javatype)) {
param.setAttribute("wrapped-primitive", "true");
param.setAttribute("value-method", javatype + "Value");
javatype = (String)s_wrapperMap.get(javatype);
} else {
param.setAttribute("wrapped-primitive", "false");
String dflt = element.getDefaultValue();
if (dflt == null) {
dflt = format.getDefaultText();
}
if (dflt != null) {
param.setAttribute("default", dflt);
}
}