Object value = this.getCharacters();
boolean isHex = Constants.HEX_BINARY_QNAME.equals(((XMLField)this.mapping.getField()).getSchemaType());
Class attributeClassification = null;
AbstractNullPolicy nullPolicy;
boolean isSwaRef = false;
CoreContainerPolicy cp = null;
if(isCollection) {
isSwaRef = ((BinaryDataCollectionMapping)mapping).isSwaRef();
field = (Field)((BinaryDataCollectionMapping)mapping).getField();
attributeClassification =((BinaryDataCollectionMapping)mapping).getAttributeElementClass();
nullPolicy =((BinaryDataCollectionMapping)mapping).getNullPolicy();
cp = ((BinaryDataCollectionMapping)mapping).getContainerPolicy();
} else {
isSwaRef = ((BinaryDataMapping)mapping).isSwaRef();
field = (Field)((BinaryDataMapping)mapping).getField();
attributeClassification =((BinaryDataMapping)mapping).getAttributeClassification();
nullPolicy =((BinaryDataMapping)mapping).getNullPolicy();
}
if (isSwaRef && (parent.getUnmarshaller().getAttachmentUnmarshaller() != null)) {
if(attributeClassification != null && attributeClassification == XMLBinaryDataHelper.getXMLBinaryDataHelper().DATA_HANDLER) {
value = parent.getUnmarshaller().getAttachmentUnmarshaller().getAttachmentAsDataHandler(value.toString());
} else {
value = parent.getUnmarshaller().getAttachmentUnmarshaller().getAttachmentAsByteArray(value.toString());
}
} else {
Object valueFromReader = this.parent.getXMLReader().getValue(getCharacters(), attributeClassification);
if(parent.isNil() && parent.getXMLReader().isNullRepresentedByXsiNil(nullPolicy)){
value = null;
isCollection = isCollection && parent.getXMLReader().isInCollection();
}
else{
if(null != valueFromReader) {
value = valueFromReader;
} else {
String valueString = value.toString();
if(valueString.length() == 0 && nullPolicy.isNullRepresentedByEmptyNode()){
value = null;
}else{
if(field.usesSingleNode()){
if(isHex) {
value = XMLConversionManager.getDefaultXMLManager().convertHexBinaryListToByteArrayList(valueString, cp, parent.getSession());