public class StructMapSerializer extends ObjectSerializerBase implements Initializable
| Modifier and Type | Class and Description |
|---|---|
protected class |
StructMapSerializer.StructMapBuilder |
| Modifier and Type | Field and Description |
|---|---|
protected InternalTypeMappingRegistry |
registry |
encodeType, encodingStyle, isNullable, typeDONT_ENCODE_TYPE, DONT_SERIALIZE_AS_REF, ENCODE_TYPE, NOT_NULLABLE, NOT_REFERENCEABLE, NULLABLE, REFERENCEABLE, REFERENCED_INSTANCE, SERIALIZE_AS_REF, UNREFERENCED_INSTANCE| Constructor and Description |
|---|
StructMapSerializer(QName type,
boolean encodeType,
boolean isNullable,
String encodingStyle) |
| Modifier and Type | Method and Description |
|---|---|
protected Object |
doDeserialize(SOAPDeserializationState state,
XMLReader reader,
SOAPDeserializationContext context)
Deserialize each element coming out of
reader into state with the aid of context |
protected void |
doSerializeInstance(Object instance,
XMLWriter writer,
SOAPSerializationContext context)
Serialize each data member of
obj into writer with the aid of context |
void |
initialize(InternalTypeMappingRegistry registry)
Allows the implementors to retrieve and cache serializers during
system intialization
|
deserialize, doSerializeAttributes, registerWithMemberState, serialize, serializeNulldecodeBoolean, deserialize, getEncodeType, getEncodingStyle, getID, getInnermostSerializer, getMechanismType, getName, getNullStatus, getType, getXmlType, isAcceptableType, isNullable, skipEmptyContent, typeIsEmpty, verifyName, verifyTypeprotected InternalTypeMappingRegistry registry
public void initialize(InternalTypeMappingRegistry registry) throws Exception
Initializableinitialize in interface InitializableException - This exception may be
thrown if there is a problem initializingprotected void doSerializeInstance(Object instance, XMLWriter writer, SOAPSerializationContext context) throws Exception
ObjectSerializerBaseobj into writer with the aid of contextdoSerializeInstance in class ObjectSerializerBaseExceptionprotected Object doDeserialize(SOAPDeserializationState state, XMLReader reader, SOAPDeserializationContext context) throws Exception
ObjectSerializerBasereader into state with the aid of context
Example:
protected Object doDeserialize(SOAPDeserializationState state, XMLReader reader, SOAPDeserializationContext context)
throws Exception {
Foo instance = new Foo();
Foo_SOAPBuilder builder = null;
Object member;
boolean isComplete = true;
QName elementName;
reader.nextElementContent();
elementName = reader.getName();
if (elementName.equals(FooMember_QNAME)) { // check to see if this is the name of the next expected member
member = FooMemberDeserializer.deserialize(FooMember_QNAME, reader, context);
if (member instanceof SOAPDeserializationState) {
if (builder == null) {
builder = new FooMemberBuilder();
}
state = registerWithMemberState(instance, state, member, MEMBER_INDEX, builder); // MEMBER_INDEX is the index of the member within the object
isComplete = false;
} else {
instance.setMember((FooMember)member); // "setMember" is whatever setter is appropriate for the member
}
}
reader.nextElementContent();
XMLReaderUtil.verifyReaderState(reader, XMLReader.END);
return (isComplete ? (Object)instance : (Object)state);
}
doDeserialize in class ObjectSerializerBaseExceptionCopyright © 2017–2019 Eclipse Foundation. All rights reserved.