return;
}
ValueType valueType = jsonValue.getValueType();
if (valueType == ValueType.ARRAY) {
JsonArray jsonArray = (JsonArray) jsonValue;
String parentLocalName = name;
if (attributePrefix != null && parentLocalName.startsWith(attributePrefix)) {
// do nothing;
return;
}
String uri = Constants.EMPTY_STRING;
if (namespaceAware && namespaces != null) {
if (parentLocalName.length() > 2) {
int nsIndex = parentLocalName.indexOf(namespaceSeparator, 1);
if (nsIndex > -1) {
String prefix = parentLocalName.substring(0, nsIndex);
uri = namespaces.resolveNamespacePrefix(prefix);
}
if (uri == null) {
uri = namespaces.getDefaultNamespaceURI();
} else {
parentLocalName = parentLocalName.substring(nsIndex + 1);
}
} else {
uri = namespaces.getDefaultNamespaceURI();
}
}
boolean isTextValue = isTextValue(parentLocalName);
int arraySize = jsonArray.size();
if (arraySize == 0) {
if (contentHandler instanceof UnmarshalRecord) {
UnmarshalRecord ur = (UnmarshalRecord) contentHandler;
XPathNode node = ur.getNonAttributeXPathNode(uri, parentLocalName, parentLocalName, null);
if (node != null) {
NodeValue nv = node.getNodeValue();
if (nv == null && node.getTextNode() != null) {
nv = node.getTextNode().getUnmarshalNodeValue();
}
if (nv != null && nv.isContainerValue()) {
ur.getContainerInstance(((ContainerValue) nv));
}
}
}
}
startCollection();
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 i = 0; i < arraySize; i++) {
JsonValue nextArrayValue = jsonArray.get(i);
if (nextArrayValue.getValueType() == ValueType.NULL) {
((UnmarshalRecord) contentHandler).setNil(true);
}
if (!isTextValue) {