|
|||||||||
| Home >> All >> org >> apache >> axis >> [ encoding overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.apache.axis.encoding
Interface Deserializer

- All Superinterfaces:
- Callback, javax.xml.rpc.encoding.Deserializer, java.io.Serializable
- All Known Implementing Classes:
- DeserializerImpl
- public interface Deserializer
- extends javax.xml.rpc.encoding.Deserializer, Callback
This interface describes the AXIS Deserializer. A compliant implementiation must extend either the AXIS SoapHandler (org.apache.axis.message.SOAPHandler) or the AXIS DeserializerImpl (org.apache.axis.encoding.DeserializerImpl) The DeserializerImpl provides a lot of the default behavior including the support for id/href. So you may want to try extending it as opposed to extending SoapHandler. An Axis compliant Deserializer must provide one or more of the following methods: public <constructor>(Class javaType, QName xmlType) public <constructo>() This will allow for construction of generic factories that introspect the class to determine how to construct a deserializer. The xmlType, javaType arguments are filled in with the values known by the factory.
| Method Summary | |
boolean |
componentsReady()
Some deserializers (ArrayDeserializer) require all of the component values to be known before the value is complete. |
void |
endElement(java.lang.String namespace,
java.lang.String localName,
DeserializationContext context)
endElement is called when the end element tag is reached. |
javax.xml.namespace.QName |
getDefaultType()
|
java.lang.Object |
getValue()
Get the deserialized value. |
java.lang.Object |
getValue(java.lang.Object hint)
If the deserializer has component values (like ArrayDeserializer) this method gets the specific component via the hint. |
java.util.Vector |
getValueTargets()
Get the Value Targets of the Deserializer. |
void |
moveValueTargets(Deserializer other)
Move someone else's targets to our own (see DeserializationContext) The DeserializationContext only allows one Deserializer to wait for a unknown multi-ref'ed value. |
void |
onEndElement(java.lang.String namespace,
java.lang.String localName,
DeserializationContext context)
onEndElement is called by endElement. |
org.apache.axis.message.SOAPHandler |
onStartChild(java.lang.String namespace,
java.lang.String localName,
java.lang.String prefix,
org.xml.sax.Attributes attributes,
DeserializationContext context)
onStartChild is called on each child element. |
void |
onStartElement(java.lang.String namespace,
java.lang.String localName,
java.lang.String prefix,
org.xml.sax.Attributes attributes,
DeserializationContext context)
This method is invoked after startElement when the element requires deserialization (i.e. |
void |
registerValueTarget(Target target)
For deserializers of non-primitives, the value may not be known until later (due to multi-referencing). |
void |
removeValueTargets()
Remove the Value Targets of the Deserializer. |
void |
setChildValue(java.lang.Object value,
java.lang.Object hint)
If the deserializer has component values (like ArrayDeserializer) this method sets the specific component via the hint. |
void |
setDefaultType(javax.xml.namespace.QName qName)
In some circumstances an element may not have a type attribute, but a default type qname is known from information in the container. |
void |
setValue(java.lang.Object value)
Set the deserialized value. |
void |
startElement(java.lang.String namespace,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes attributes,
DeserializationContext context)
This method is invoked when an element start tag is encountered. |
void |
valueComplete()
The valueComplete() method is invoked when the end tag of the element is read. |
| Methods inherited from interface javax.xml.rpc.encoding.Deserializer |
getMechanismType |
| Methods inherited from interface org.apache.axis.encoding.Callback |
setValue |
| Method Detail |
getValue
public java.lang.Object getValue()
- Get the deserialized value.
setValue
public void setValue(java.lang.Object value)
- Set the deserialized value.
getValue
public java.lang.Object getValue(java.lang.Object hint)
- If the deserializer has component values (like ArrayDeserializer)
this method gets the specific component via the hint.
The default implementation returns null.
setChildValue
public void setChildValue(java.lang.Object value, java.lang.Object hint) throws org.xml.sax.SAXException
- If the deserializer has component values (like ArrayDeserializer)
this method sets the specific component via the hint.
The default implementation does nothing.
setDefaultType
public void setDefaultType(javax.xml.namespace.QName qName)
- In some circumstances an element may not have
a type attribute, but a default type qname is known from
information in the container. For example,
an element of an array may not have a type= attribute,
so the default qname is the component type of the array.
This method is used to communicate the default type information
to the deserializer.
getDefaultType
public javax.xml.namespace.QName getDefaultType()
registerValueTarget
public void registerValueTarget(Target target)
- For deserializers of non-primitives, the value may not be
known until later (due to multi-referencing). In such
cases the deserializer registers Target object(s). When
the value is known, the set(value) will be invoked for
each Target registered with the Deserializer. The Target
object abstracts the function of setting a target with a
value. See the Target interface for more info.
getValueTargets
public java.util.Vector getValueTargets()
- Get the Value Targets of the Deserializer.
removeValueTargets
public void removeValueTargets()
- Remove the Value Targets of the Deserializer.
moveValueTargets
public void moveValueTargets(Deserializer other)
- Move someone else's targets to our own (see DeserializationContext)
The DeserializationContext only allows one Deserializer to
wait for a unknown multi-ref'ed value. So to ensure
that all of the targets are updated, this method is invoked
to copy the Target objects to the waiting Deserializer.
componentsReady
public boolean componentsReady()
- Some deserializers (ArrayDeserializer) require
all of the component values to be known before the
value is complete.
(For the ArrayDeserializer this is important because
the elements are stored in an ArrayList, and all values
must be known before the ArrayList is converted into the
expected array.
This routine is used to indicate when the components are ready.
The default (true) is useful for most Deserializers.
valueComplete
public void valueComplete()
throws org.xml.sax.SAXException
- The valueComplete() method is invoked when the
end tag of the element is read. This results
in the setting of all registered Targets (see
registerValueTarget).
Note that the valueComplete() only processes
the Targets if componentReady() returns true.
So if you override componentReady(), then your
specific Deserializer will need to call valueComplete()
when your components are ready (See ArrayDeserializer)
startElement
public void startElement(java.lang.String namespace, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attributes, DeserializationContext context) throws org.xml.sax.SAXException
- This method is invoked when an element start tag is encountered.
DeserializerImpl provides default behavior, which involves the following:
- directly handling the deserialization of a nill value
- handling the registration of the id value.
- handling the registration of a fixup if this element is an href.
- calling onStartElement to do the actual deserialization if not nill or href cases.
onStartElement
public void onStartElement(java.lang.String namespace, java.lang.String localName, java.lang.String prefix, org.xml.sax.Attributes attributes, DeserializationContext context) throws org.xml.sax.SAXException
- This method is invoked after startElement when the element requires
deserialization (i.e. the element is not an href and the value is not nil.)
DeserializerImpl provides default behavior, which simply
involves obtaining a correct Deserializer and plugging its handler.
onStartChild
public org.apache.axis.message.SOAPHandler onStartChild(java.lang.String namespace, java.lang.String localName, java.lang.String prefix, org.xml.sax.Attributes attributes, DeserializationContext context) throws org.xml.sax.SAXException
- onStartChild is called on each child element.
The default behavior supplied by DeserializationImpl is to do nothing.
A specific deserializer may perform other tasks. For example a
BeanDeserializer will construct a deserializer for the indicated
property and return it.
endElement
public void endElement(java.lang.String namespace, java.lang.String localName, DeserializationContext context) throws org.xml.sax.SAXException
- endElement is called when the end element tag is reached.
It handles href/id information for multi-ref processing
and invokes the valueComplete() method of the deserializer
which sets the targets with the deserialized value.
onEndElement
public void onEndElement(java.lang.String namespace, java.lang.String localName, DeserializationContext context) throws org.xml.sax.SAXException
- onEndElement is called by endElement. It is not called
if the element has an href.
|
|||||||||
| Home >> All >> org >> apache >> axis >> [ encoding overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC