This interface describes the AXIS DeserializationContext, note that
an AXIS compliant DeserializationContext must extend the org.xml.sax.helpers.DefaultHandler.
addObjectById
public void addObjectById(String id,
Object obj)
Add the object associated with this id (where id is the value of an id= attribute,
i.e. it does not start with #).
This routine is called to associate the deserialized object
with the id specified on the XML element.
id
- (id name without the #)obj
- is the deserialized object for this id.
characters
public void characters(char[] p1,
int p2,
int p3)
throws SAXException
comment
public void comment(char[] ch,
int start,
int length)
throws SAXException
deserializing
public void deserializing(boolean isDeserializing)
endCDATA
public void endCDATA()
throws SAXException
endDTD
public void endDTD()
throws SAXException
endDocument
public void endDocument()
throws SAXException
endDocument is invoked at the end of the document.
endElement
public void endElement(String namespace,
String localName,
String qName)
throws SAXException
endElement is called at the end tag of an element
endEntity
public void endEntity(java.lang.String name)
throws SAXException
endPrefixMapping
public void endPrefixMapping(String prefix)
throws SAXException
getCurElement
public MessageElement getCurElement()
Get current MessageElement
getCurrentNSMappings
public ArrayList getCurrentNSMappings()
Get the Namespace Mappings. Returns null if none are present.
getCurrentRecordPos
public int getCurrentRecordPos()
Get the current position in the record.
getDeserializer
public final Deserializer getDeserializer(Class cls,
QName xmlType)
Get a Deserializer which can turn a given xml type into a given
Java type
getDeserializerForClass
public Deserializer getDeserializerForClass(Class cls)
Convenience method to get the Deserializer for a specific
java class from its meta data.
cls
- is the Class used to find the deserializer
- Deserializer
getDeserializerForType
public final Deserializer getDeserializerForType(QName xmlType)
Convenience method to get the Deserializer for a specific
xmlType.
xmlType
- is QName for a type to deserialize
- Deserializer
getDestinationClass
public Class getDestinationClass()
Allows the destination class to be retrieved so that downstream
deserializers like ArrayDeserializer can pick it up when
deserializing its components using getDeserializerForClass
- the Class of the component to be deserialized
getDocumentLocator
public Locator getDocumentLocator()
getElementByID
public MessageElement getElementByID(String id)
Get the MessageElement for the indicated id (where id is the #value of an href)
If the MessageElement has not been processed, the MessageElement will
be returned. If the MessageElement has been processed, the actual object
value is stored with the id and this routine will return null.
id
- is the value of an href attribute
- MessageElement or null
getEncodingStyle
public String getEncodingStyle()
Returns this context's encoding style. If we've got a message
context then we'll get the style from that; otherwise we'll
return a default.
- a
String
value
getMessageContext
public MessageContext getMessageContext()
Get MessageContext
getNamespaceURI
public String getNamespaceURI(String prefix)
Get the Namespace for a particular prefix
getObjectByRef
public Object getObjectByRef(String href)
Gets the MessageElement or actual Object value associated with the href value.
The return of a MessageElement indicates that the referenced element has
not been processed. If it is not a MessageElement, the Object is the
actual deserialized value.
In addition, this method is invoked to get Object values via Attachments.
href
- is the value of an href attribute (or an Attachment id)
- MessageElement other Object or null
getQNameFromString
public QName getQNameFromString(String qNameStr)
Construct a QName from a string of the form
:
qNameStr
- is the prefixed name from the xml text
- QName
getSOAPConstants
public SOAPConstants getSOAPConstants()
returns the soap constants.
getStartOfMappingsPos
public int getStartOfMappingsPos()
Get the start of the mapping position
getTypeFromAttributes
public QName getTypeFromAttributes(String namespace,
String localName,
Attributes attrs)
Create a QName for the type of the element defined by localName and
namespace with the specified attributes.
namespace
- of the elementlocalName
- is the local name of the elementattrs
- are the attributes on the element
getTypeFromXSITypeAttr
public QName getTypeFromXSITypeAttr(String namespace,
String localName,
Attributes attrs)
Create a QName for the type of the element defined by localName and
namespace from the XSI type.
namespace
- of the elementlocalName
- is the local name of the elementattrs
- are the attributes on the element
getTypeMapping
public TypeMapping getTypeMapping()
Get the TypeMapping for this DeserializationContext
getTypeMappingRegistry
public TypeMappingRegistry getTypeMappingRegistry()
Get the TypeMappingRegistry we're using.
- TypeMapping or null
hasElementsByID
public boolean hasElementsByID()
Return true if any ids are being tracked by this DeserializationContext
- true if any ides are being tracked by this DeserializationContext
ignorableWhitespace
public void ignorableWhitespace(char[] p1,
int p2,
int p3)
throws SAXException
isDoneParsing
public boolean isDoneParsing()
Return if done parsing document.
isNil
public boolean isNil(Attributes attrs)
Convenenience method that returns true if the value is nil
(due to the xsi:nil) attribute.
attrs
- are the element attributes.
- true if xsi:nil is true
isProcessingRef
public boolean isProcessingRef()
parse
public void parse()
throws SAXException
Create a parser and parse the inputSource
popElementHandler
public SOAPHandler popElementHandler()
processingInstruction
public void processingInstruction(String p1,
String p2)
throws SAXException
pushElementHandler
public void pushElementHandler(SOAPHandler handler)
Management of sub-handlers (deserializers)
pushNewElement
public void pushNewElement(MessageElement elem)
Push the MessageElement into the recorder
registerElementByID
public void registerElementByID(String id,
MessageElement elem)
Register the MessageElement with this id (where id is id= form without the #)
This routine is called when the MessageElement with an id is read.
If there is a Deserializer in our fixup list (described above),
the 'fixup' deserializer is given to the MessageElement. When the
MessageElement is completed, the 'fixup' deserializer is informed and
it can set its targets.
id
- (id name without the #)elem
- is the MessageElement
registerFixup
public void registerFixup(String href,
Deserializer dser)
During deserialization, an element with an href=#id
may be encountered before the element defining id=id is
read. In these cases, the getObjectByRef method above will
return null. The deserializer is placed in a table keyed
by href (a fixup table). After the element id is processed,
the deserializer is informed of the value so that it can
update its target(s) with the value.
href
- (#id syntax)dser
- is the deserializer of the element
registerResolverForID
public void registerResolverForID(String id,
IDResolver resolver)
Each id can have its own kind of resolver. This registers a
resolver for the id.
replaceElementHandler
public void replaceElementHandler(SOAPHandler handler)
Replace the handler at the top of the stack.
This is only used when we have a placeholder Deserializer
for a referenced object which doesn't know its type until we
hit the referent.
resolveEntity
public InputSource resolveEntity(String publicId,
String systemId)
setCurElement
public void setCurElement(MessageElement el)
Set current MessageElement
setDestinationClass
public void setDestinationClass(Class destClass)
Allows the destination class to be set so that downstream
deserializers like ArrayDeserializer can pick it up when
deserializing its components using getDeserializerForClass
destClass
- is the Class of the component to be deserialized
setDocumentLocator
public void setDocumentLocator(Locator locator)
setProcessingRef
public void setProcessingRef(boolean ref)
skippedEntity
public void skippedEntity(String p1)
throws SAXException
startCDATA
public void startCDATA()
throws SAXException
startDTD
public void startDTD(java.lang.String name,
java.lang.String publicId,
java.lang.String systemId)
throws SAXException
startDocument
public void startDocument()
throws SAXException
SAX event handlers
startElement
public void startElement(String namespace,
String localName,
String qName,
Attributes attributes)
throws SAXException
startElement is called when an element is read. This is the big work-horse.
This guy also handles monitoring the recording depth if we're recording
(so we know when to stop).
startEntity
public void startEntity(java.lang.String name)
throws SAXException
startPrefixMapping
public void startPrefixMapping(String prefix,
String uri)
throws SAXException
Record the current set of prefix mappings in the nsMappings table.
!!! We probably want to have this mapping be associated with the
MessageElements, since they may potentially need access to them
long after the end of the prefix mapping here. (example:
when we need to record a long string of events scanning forward
in the document to find an element with a particular ID.)