}
}
startCollection();
if(size == 1){
CommonTree ct = (CommonTree) tree.getChild(0);
if(ct != null && ct.getType() == JSONLexer.NULL){
contentHandler.setNil(true);
}
if(!isTextValue){
contentHandler.startElement(uri, parentLocalName, parentLocalName, attributes.setTree(ct, attributePrefix, namespaces, namespaceSeparator, namespaceAware));
}
parse(ct);
if(!isTextValue){
contentHandler.endElement(uri, parentLocalName, parentLocalName);
}
}else{
XPathFragment groupingXPathFragment = null;
XPathFragment itemXPathFragment = null;
if(contentHandler instanceof UnmarshalRecord) {
UnmarshalRecord unmarshalRecord = (UnmarshalRecord) contentHandler;
if(unmarshalRecord.getUnmarshaller().isWrapperAsCollectionName()) {
XPathNode unmarshalRecordXPathNode = unmarshalRecord.getXPathNode();
if(null != unmarshalRecordXPathNode) {
XPathFragment currentFragment = new XPathFragment();
currentFragment.setLocalName(parentLocalName);
currentFragment.setNamespaceURI(uri);
currentFragment.setNamespaceAware(namespaceAware);
XPathNode groupingXPathNode = unmarshalRecordXPathNode.getNonAttributeChildrenMap().get(currentFragment);
if(groupingXPathNode != null) {
if(groupingXPathNode.getUnmarshalNodeValue() instanceof CollectionGroupingElementNodeValue) {
groupingXPathFragment = groupingXPathNode.getXPathFragment();
contentHandler.startElement(uri, parentLocalName, parentLocalName, new AttributesImpl());
XPathNode itemXPathNode = groupingXPathNode.getNonAttributeChildren().get(0);
itemXPathFragment = itemXPathNode.getXPathFragment();
} else if(groupingXPathNode.getUnmarshalNodeValue() == null) {
XPathNode itemXPathNode = groupingXPathNode.getNonAttributeChildren().get(0);
if(itemXPathNode != null) {
if(((MappingNodeValue)itemXPathNode.getUnmarshalNodeValue()).isContainerValue()) {
groupingXPathFragment = groupingXPathNode.getXPathFragment();
contentHandler.startElement(uri, parentLocalName, parentLocalName, new AttributesImpl());
itemXPathFragment = itemXPathNode.getXPathFragment();
}
}
}
}
}
}
}
for(int x=0; x<size; x++) {
CommonTree nextChildTree = (CommonTree) tree.getChild(x);
if(nextChildTree.getType() == JSONLexer.NULL){
((UnmarshalRecord)contentHandler).setNil(true);
}
if(!isTextValue){
if(null != itemXPathFragment) {
contentHandler.startElement(itemXPathFragment.getNamespaceURI(), itemXPathFragment.getLocalName(), itemXPathFragment.getLocalName(), attributes.setTree(nextChildTree, attributePrefix, namespaces, namespaceSeparator, namespaceAware));