|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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(String namespace,
String localName,
DeserializationContext context)
endElement is called when the end element tag is reached. |
javax.xml.namespace.QName |
getDefaultType()
|
Object |
getValue()
Get the deserialized value. |
Object |
getValue(Object hint)
If the deserializer has component values (like ArrayDeserializer) this method gets the specific component via the hint. |
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(String namespace,
String localName,
DeserializationContext context)
onEndElement is called by endElement. |
SOAPHandler |
onStartChild(String namespace,
String localName,
String prefix,
Attributes attributes,
DeserializationContext context)
onStartChild is called on each child element. |
void |
onStartElement(String namespace,
String localName,
String prefix,
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(Object value,
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(Object value)
Set the deserialized value. |
void |
startElement(String namespace,
String localName,
String qName,
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 |
public Object getValue()
public void setValue(Object value)
value
- Object representing deserialized valuepublic Object getValue(Object hint)
public void setChildValue(Object value, Object hint) throws SAXException
value
- Object representing deserialized value or null
SAXException
public void setDefaultType(javax.xml.namespace.QName qName)
public javax.xml.namespace.QName getDefaultType()
public void registerValueTarget(Target target)
target
- Targetpublic Vector getValueTargets()
public void removeValueTargets()
public void moveValueTargets(Deserializer other)
other
- is the Deserializer to copy targets from.public boolean componentsReady()
public void valueComplete() throws SAXException
SAXException
public void startElement(String namespace, String localName, String qName, Attributes attributes, DeserializationContext context) throws SAXException
namespace
- is the namespace of the elementlocalName
- is the name of the elementqName
- is the prefixed qName of the elementattributes
- are the attributes on the element...used to get the typecontext
- is the DeserializationContext
Normally a specific Deserializer (FooDeserializer) should extend DeserializerImpl.
Here is the flow that will occur in such cases:
1) DeserializerImpl.startElement(...) will be called and do the id/href/nill stuff.
2) If real deserialization needs to take place DeserializerImpl.onStartElement will be
invoked, which will attempt to install the specific Deserializer (FooDeserializer)
3) The FooDeserializer.startElement(...) will be called to do the Foo specific stuff.
This results in a call to FooDeserializer.onStartElement(...) if startElement was
not overridden.
4) The onChildElement(...) method is called for each child element. Nothing occurs
if not overridden. The FooDeserializer.onStartChild(...) method should return
the deserializer for the child element.
5) When the end tag is reached, the endElement(..) method is invoked. The default
behavior is to handle hrefs/ids, call onEndElement and then call the Deserializer
valueComplete method.
So the methods that you potentially want to override are:
onStartElement, onStartChild, componentsReady, set(object, hint)
You probably should not override startElement or endElement.
If you need specific behaviour at the end of the element consider overriding
onEndElement.
See the pre-existing Deserializers for more information.
SAXException
public void onStartElement(String namespace, String localName, String prefix, Attributes attributes, DeserializationContext context) throws SAXException
namespace
- is the namespace of the elementlocalName
- is the name of the elementprefix
- is the prefix of the elementattributes
- are the attributes on the element...used to get the typecontext
- is the DeserializationContext
SAXException
public SOAPHandler onStartChild(String namespace, String localName, String prefix, Attributes attributes, DeserializationContext context) throws SAXException
namespace
- is the namespace of the child elementlocalName
- is the local name of the child elementprefix
- is the prefix used on the name of the child elementattributes
- are the attributes of the child elementcontext
- is the deserialization context.
SAXException
public void endElement(String namespace, String localName, DeserializationContext context) throws SAXException
namespace
- is the namespace of the child elementlocalName
- is the local name of the child elementcontext
- is the deserialization context
SAXException
public void onEndElement(String namespace, String localName, DeserializationContext context) throws SAXException
namespace
- is the namespace of the child elementlocalName
- is the local name of the child elementcontext
- is the deserialization context
SAXException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |