Class componentClass = javaClass.getComponentType();
if (javaClass.isArray() && javaClass != ClassConstants.APBYTE && javaClass != ClassConstants.ABYTE && XMLConversionManager.getDefaultJavaTypes().get(componentClass) != null) {
// Top-level array. Descriptor will be for an EL-generated class, containing one DirectCollection mapping.
XMLCompositeDirectCollectionMapping mapping = (XMLCompositeDirectCollectionMapping) xmlDescriptor.getMappings().get(0);
XMLStreamReaderReader staxReader = new XMLStreamReaderReader(xmlUnmarshaller);
staxReader.setErrorHandler(xmlUnmarshaller.getErrorHandler());
PrimitiveArrayContentHandler primitiveArrayContentHandler = new PrimitiveArrayContentHandler(javaClass, componentClass, mapping.usesSingleNode());
staxReader.setContentHandler(primitiveArrayContentHandler);
XMLStreamReaderInputSource inputSource = new XMLStreamReaderInputSource(streamReader);
staxReader.parse(inputSource);
return primitiveArrayContentHandler.getJaxbElement();
}
}
if(null != xmlDescriptor && null == getSchema()) {
RootLevelXmlAdapter adapter= null;
if(jaxbContext.getTypeMappingInfoToJavaTypeAdapters().size() >0){
adapter = jaxbContext.getTypeMappingInfoToJavaTypeAdapters().get(type);
}
UnmarshalRecord unmarshalRecord = (UnmarshalRecord) xmlDescriptor.getObjectBuilder().createRecord((AbstractSession) xmlUnmarshaller.getXMLContext().getSession(0));
XMLStreamReaderReader staxReader = new XMLStreamReaderReader(xmlUnmarshaller);
unmarshalRecord.setUnmarshaller(xmlUnmarshaller);
unmarshalRecord.setXMLReader(staxReader);
staxReader.setContentHandler(unmarshalRecord);
staxReader.parse(streamReader);
Object value = null;
if(unmarshalRecord.isNil()) {
value = null;
} else {
value = unmarshalRecord.getCurrentObject();