| de.danet.an.workflow.tools.soapclient.JDOMAxisDeserializer
JDOMAxisDeserializer | public class JDOMAxisDeserializer extends SOAPHandler implements Deserializer(Code) | | General purpose serializer/deserializerFactory for JDOM in the AXIS
implementation of the JAX-RPC interface.
Creates a simple org.jdom.Element for the parsed xml content,
preserving the stucture and text content.
This class uses a stack to notice the created nodes. So we do not
need to generate new instances of this class for every recursive
descent (initialized by the onStartChild() call).
|
Method Summary | |
public void | characters(char[] chars, int start, int end) Gets called when the text of an XML element handled by this
deserializer is reached. | public boolean | componentsReady() Some deserializers (ArrayDeserializer) require
all of the component values to be known before the
value is complete. | public void | endElement(String namespace, String localName, DeserializationContext context) endElement is called when the end element tag is reached. | public QName | getDefaultType() Return the default type. | public String | getMechanismType() JAX-RPC compliant method which returns mechanism type. | public Object | getValue() Get the deserialized value. | public Object | getValue(Object hint) If the deserializer has component values (like ArrayDeserializer)
this method gets the specific component via the hint. | public Vector | getValueTargets() Get the Value Targets of the Deserializer. | 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. | public void | onEndElement(String namespace, String localName, DeserializationContext context) onEndElement is called by endElement. | public SOAPHandler | onStartChild(String namespace, String localName, String prefix, Attributes attributes, DeserializationContext context) onStartChild is called on each child element.
The default behavior supplied by DeserializationImpl is to do nothing.
A specific deserializer may perform other tasks. | public 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. | public void | registerValueTarget(Target target) For deserializers of non-primitives, the value may not be
known until later (due to multi-referencing). | public void | removeValueTargets() Remove the Value Targets of the Deserializer. | public void | setChildValue(Object value, Object hint) If the deserializer has component values (like ArrayDeserializer)
this method sets the specific component via the hint. | public void | setDefaultType(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. | public void | setValue(Object value) Set the deserialized value. | public void | setValue(Object value, Object hint) From axis callback interface. | public void | startElement(String namespace, String localName, String prefix, Attributes attributes, DeserializationContext context) This method is invoked when an element start tag is encountered. | public void | valueComplete() The valueComplete() method is invoked when the
end tag of the element is read. |
JDOMAxisDeserializer | public JDOMAxisDeserializer()(Code) | | Default constructor.
|
characters | public void characters(char[] chars, int start, int end) throws SAXException(Code) | | Gets called when the text of an XML element handled by this
deserializer is reached.
We simply add the current text to a text buffer. The completed
buffer will be evaluated in the onEndElement() method.
Parameters: chars - characters Parameters: start - start Parameters: end - end throws: SAXException - SAXException |
componentsReady | public boolean componentsReady()(Code) | | 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.
true if component ready |
endElement | public void endElement(String namespace, String localName, DeserializationContext context) throws SAXException(Code) | | 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.
Parameters: namespace - is the namespace of the child element Parameters: localName - is the local name of the child element Parameters: context - is the deserialization context throws: SAXException - not thrown |
getMechanismType | public String getMechanismType()(Code) | | JAX-RPC compliant method which returns mechanism type.
the mechanism |
getValue | public Object getValue()(Code) | | Get the deserialized value.
Object representing deserialized value or null |
getValue | public Object getValue(Object hint)(Code) | | If the deserializer has component values (like ArrayDeserializer)
this method gets the specific component via the hint.
The default implementation returns null.
Object representing deserialized value or null Parameters: hint - a hint |
getValueTargets | public Vector getValueTargets()(Code) | | Get the Value Targets of the Deserializer.
Vector of Target objects or null |
moveValueTargets | public void moveValueTargets(Deserializer other)(Code) | | 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.
Parameters: other - is the Deserializer to copy targets from. |
onEndElement | public void onEndElement(String namespace, String localName, DeserializationContext context) throws SAXException(Code) | | onEndElement is called by endElement. It is not called
if the element has an href.
Parameters: namespace - is the namespace of the child element Parameters: localName - is the local name of the child element Parameters: context - is the deserialization context throws: SAXException - not thrown |
onStartChild | public SOAPHandler onStartChild(String namespace, String localName, String prefix, Attributes attributes, DeserializationContext context) throws SAXException(Code) | | 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.
Parameters: namespace - is the namespace of the child element Parameters: localName - is the local name of the child element Parameters: prefix - is the prefix used on the name of the child element Parameters: attributes - are the attributes of the child element Parameters: context - is the deserialization context. is a Deserializer to use to deserialize a child (must bea derived class of SOAPHandler) or null if no deserialization shouldbe performed. throws: SAXException - not thrown |
onStartElement | public void onStartElement(String namespace, String localName, String prefix, Attributes attributes, DeserializationContext context) throws SAXException(Code) | | 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.
Parameters: namespace - is the namespace of the element Parameters: localName - is the name of the element Parameters: prefix - is the prefix of the element Parameters: attributes - are the attributes on the element Parameters: context - is the DeserializationContext throws: SAXException - not thrown |
registerValueTarget | public void registerValueTarget(Target target)(Code) | | 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.
Parameters: target - Target |
removeValueTargets | public void removeValueTargets()(Code) | | Remove the Value Targets of the Deserializer.
|
setChildValue | public void setChildValue(Object value, Object hint) throws SAXException(Code) | | If the deserializer has component values (like ArrayDeserializer)
this method sets the specific component via the hint.
The default implementation does nothing.
Parameters: value - Object representing deserialized value or null throws: SAXException - if an error occurs Parameters: hint - a hint |
setDefaultType | public void setDefaultType(QName qName)(Code) | | 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.
Parameters: qName - default type |
setValue | public void setValue(Object value)(Code) | | Set the deserialized value.
Parameters: value - Object representing deserialized value |
startElement | public void startElement(String namespace, String localName, String prefix, Attributes attributes, DeserializationContext context) throws SAXException(Code) | | This method is invoked when an element start tag is encountered.
Parameters: namespace - is the namespace of the element Parameters: localName - is the name of the element Parameters: prefix - is the prefix Parameters: attributes - are the attributes on the element Parameters: context - is the DeserializationContext throws: SAXException - not thrown |
valueComplete | public void valueComplete() throws SAXException(Code) | | 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)
throws: SAXException - not thrown |
|
|