Class GenericObjectSerializer
- All Implemented Interfaces:
CombinedSerializer,Initializable,JAXRPCDeserializer,JAXRPCSerializer,SerializerConstants,Serializable,javax.xml.rpc.encoding.Deserializer,javax.xml.rpc.encoding.Serializer
- Direct Known Subclasses:
ValueTypeSerializer
- Author:
- JAX-RPC Development Team
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic classstatic interfaceprotected class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Mapprotected Listprotected InternalTypeMappingRegistryprotected Classprotected MapFields inherited from class com.sun.xml.rpc.encoding.SerializerBase
encodeType, encodingStyle, isNullable, typeFields inherited from interface com.sun.xml.rpc.encoding.SerializerConstants
DONT_ENCODE_TYPE, DONT_SERIALIZE_AS_REF, ENCODE_TYPE, NOT_NULLABLE, NOT_REFERENCEABLE, NULLABLE, REFERENCEABLE, REFERENCED_INSTANCE, SERIALIZE_AS_REF, UNREFERENCED_INSTANCE -
Constructor Summary
ConstructorsConstructorDescriptionGenericObjectSerializer(QName type, boolean encodeType, boolean isNullable, String encodingStyle) GenericObjectSerializer(QName type, boolean encodeType, boolean isNullable, String encodingStyle, SOAPVersion ver) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddTypeRelation(Class javaType, QName xmlType) voidprotected ObjectdoDeserialize(SOAPDeserializationState state, XMLReader reader, SOAPDeserializationContext context) Deserialize each element coming out ofreaderintostatewith the aid ofcontextprotected voiddoSerializeInstance(Object instance, XMLWriter writer, SOAPSerializationContext context) Serialize each data member ofobjintowriterwith the aid ofcontextprotected voiddoSetTargetClass(Class targetClass) protected ListgetMemberOrder(Object instance, List membersAlphabetically) voidinitialize(InternalTypeMappingRegistry registry) Allows the implementors to retrieve and cache serializers during system intializationvoidsetTargetClass(Class targetClass) Methods inherited from class com.sun.xml.rpc.encoding.ObjectSerializerBase
deserialize, doSerializeAttributes, registerWithMemberState, serialize, serializeNullMethods inherited from class com.sun.xml.rpc.encoding.SerializerBase
decodeBoolean, deserialize, getEncodeType, getEncodingStyle, getID, getInnermostSerializer, getMechanismType, getName, getNullStatus, getType, getXmlType, isAcceptableType, isNullable, skipEmptyContent, typeIsEmpty, verifyName, verifyType
-
Field Details
-
targetClass
-
members
-
xmlToJavaType
-
javaToXmlType
-
registry
-
-
Constructor Details
-
GenericObjectSerializer
-
GenericObjectSerializer
public GenericObjectSerializer(QName type, boolean encodeType, boolean isNullable, String encodingStyle, SOAPVersion ver)
-
-
Method Details
-
addTypeRelation
-
setTargetClass
-
doSetTargetClass
-
initialize
Description copied from interface:InitializableAllows the implementors to retrieve and cache serializers during system intialization- Specified by:
initializein interfaceInitializable- Throws:
Exception- This exception may be thrown if there is a problem initializing
-
clearMembers
public void clearMembers() -
addMember
- Throws:
Exception
-
doSerializeInstance
protected void doSerializeInstance(Object instance, XMLWriter writer, SOAPSerializationContext context) throws Exception Description copied from class:ObjectSerializerBaseSerialize each data member ofobjintowriterwith the aid ofcontext- Specified by:
doSerializeInstancein classObjectSerializerBase- Throws:
Exception
-
doDeserialize
protected Object doDeserialize(SOAPDeserializationState state, XMLReader reader, SOAPDeserializationContext context) throws Exception Description copied from class:ObjectSerializerBaseDeserialize each element coming out ofreaderintostatewith the aid ofcontextExample:
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); }- Specified by:
doDeserializein classObjectSerializerBase- Throws:
Exception
-
getMemberOrder
-