}
private String determineArrayType
(SAXEventBuffer buf, SerializationContext context)
throws SAXException {
HandlerStack hs = new HandlerStack (new ArrayTypeExtractor(context));
hs.setContextData("types", new HashSet ());
hs.setContextData ("items", new Integer (0));
hs.setContextData ("typesValid", Boolean.TRUE);
hs.contentHandler().startElement
("", "root", "root", new AttributesImpl ());
buf.emit (hs.contentHandler());
hs.contentHandler().endElement ("", "root", "root");
Set types = (Set)hs.getContextData("types");
String xsdPref = context.getPrefixForURI(XMLUtil.XMLNS_SCHEMA);
String arrayType;
String dim = "[" + (Integer)hs.getContextData("items") + "]";
if (!((Boolean)hs.getContextData ("typesValid")).booleanValue()
|| types.size () > 1) {
arrayType = xsdPref + ":" + "ur-type" + dim;
} else {
Iterator i = types.iterator();
NsAndLocal type = (NsAndLocal)i.next ();