use of org.apache.cxf.aegis.custom.service.NoDefaultConstructorBeanKeyImpl in project cxf by apache.
the class NoDefaultConstructorBeanKeyType method readObject.
@Override
public Object readObject(MessageReader reader, Context context) throws DatabindingException {
BeanTypeInfo inf = getTypeInfo();
try {
String key = null;
// Read child elements
while (reader.hasMoreElementReaders()) {
MessageReader childReader = reader.getNextElementReader();
if (childReader.isXsiNil()) {
childReader.readToEnd();
continue;
}
QName name = childReader.getName();
AegisType defaultType = inf.getType(name);
AegisType type = TypeUtil.getReadType(childReader.getXMLStreamReader(), context.getGlobalContext(), defaultType);
if (type != null) {
String value = (String) type.readObject(childReader, context);
if ("key".equals(name.getLocalPart())) {
key = value;
}
} else {
childReader.readToEnd();
}
}
return new NoDefaultConstructorBeanKeyImpl(key);
} catch (IllegalArgumentException e) {
throw new DatabindingException("Illegal argument. " + e.getMessage(), e);
}
}
Aggregations