public class DeserializationContext extends Object implements ContentHandler, DTDHandler, DeserializationContext, LexicalHandler
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
haveSeenSchemaNS |
protected InputSource |
inputSource |
protected static org.apache.commons.logging.Log |
log |
protected MessageContext |
msgContext |
protected int |
startOfMappingsPos |
| Constructor and Description |
|---|
DeserializationContext(InputSource is,
MessageContext ctx,
String messageType)
Construct Deserializer
|
DeserializationContext(InputSource is,
MessageContext ctx,
String messageType,
SOAPEnvelope env)
Construct Deserializer
|
DeserializationContext(MessageContext ctx,
SOAPHandler initialHandler)
Construct Deserializer using MessageContext and EnvelopeBuilder handler
|
| Modifier and Type | Method and Description |
|---|---|
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 #).
|
void |
characters(char[] p1,
int p2,
int p3) |
void |
comment(char[] ch,
int start,
int length) |
void |
deserializing(boolean isDeserializing) |
void |
endCDATA() |
void |
endDocument()
endDocument is invoked at the end of the document.
|
void |
endDTD() |
void |
endElement(String namespace,
String localName,
String qName)
endElement is called at the end tag of an element
|
void |
endEntity(String name) |
void |
endPrefixMapping(String prefix) |
MessageElement |
getCurElement()
Get current MessageElement
|
ArrayList |
getCurrentNSMappings()
Get the Namespace Mappings.
|
int |
getCurrentRecordPos()
Get the current position in the record.
|
Deserializer |
getDeserializer(Class cls,
QName xmlType)
Get a Deserializer which can turn a given xml type into a given
Java type
|
Deserializer |
getDeserializerForClass(Class cls)
Convenience method to get the Deserializer for a specific
java class from its meta data.
|
Deserializer |
getDeserializerForType(QName xmlType)
Convenience method to get the Deserializer for a specific
xmlType.
|
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
|
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.
|
String |
getEncodingStyle()
Returns this context's encoding style.
|
SOAPEnvelope |
getEnvelope()
Get Envelope
|
MessageContext |
getMessageContext()
Get MessageContext
|
String |
getNamespaceURI(String prefix)
Get the Namespace for a particular prefix
|
Object |
getObjectByRef(String href)
Gets the MessageElement or actual Object value associated with the href value.
|
QName |
getQNameFromString(String qNameStr)
Construct a QName from a string of the form
|
SAX2EventRecorder |
getRecorder()
Get Event Recorder
|
SOAPConstants |
getSOAPConstants()
returns the soap constants.
|
int |
getStartOfMappingsPos()
Get the start of the mapping position
|
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.
|
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.
|
TypeMapping |
getTypeMapping()
Get the TypeMapping for this DeserializationContext
|
TypeMappingRegistry |
getTypeMappingRegistry()
Get the TypeMappingRegistry we're using.
|
boolean |
hasElementsByID()
Return true if any ids are being tracked by this DeserializationContext
|
void |
ignorableWhitespace(char[] p1,
int p2,
int p3) |
boolean |
isDoneParsing()
Return if done parsing document.
|
boolean |
isNil(Attributes attrs)
Convenenience method that returns true if the value is nil
(due to the xsi:nil) attribute.
|
boolean |
isProcessingRef() |
void |
notationDecl(String name,
String publicId,
String systemId) |
void |
parse()
Create a parser and parse the inputSource
|
SOAPHandler |
popElementHandler() |
void |
processingInstruction(String p1,
String p2) |
void |
pushElementHandler(SOAPHandler handler)
Management of sub-handlers (deserializers)
|
void |
pushNewElement(MessageElement elem)
Push the MessageElement into the recorder
|
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.
|
void |
registerFixup(String href,
Deserializer dser)
During deserialization, an element with an href=#id
|
void |
registerResolverForID(String id,
IDResolver resolver)
Each id can have its own kind of resolver.
|
void |
replaceElementHandler(SOAPHandler handler)
Replace the handler at the top of the stack.
|
void |
setCurElement(MessageElement el)
Set current MessageElement
|
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
|
void |
setDocumentLocator(Locator locator) |
void |
setProcessingRef(boolean ref) |
void |
setRecorder(SAX2EventRecorder recorder)
Set Event Recorder
|
void |
skippedEntity(String p1) |
void |
startCDATA() |
void |
startDocument()
SAX event handlers
|
void |
startDTD(String name,
String publicId,
String systemId) |
void |
startElement(String namespace,
String localName,
String qName,
Attributes attributes)
startElement is called when an element is read.
|
void |
startEntity(String name) |
void |
startPrefixMapping(String prefix,
String uri)
Record the current set of prefix mappings in the nsMappings table.
!!!
|
void |
unparsedEntityDecl(String name,
String publicId,
String systemId,
String notationName) |
protected static org.apache.commons.logging.Log log
protected MessageContext msgContext
protected InputSource inputSource
protected int startOfMappingsPos
protected boolean haveSeenSchemaNS
public DeserializationContext(MessageContext ctx, SOAPHandler initialHandler)
ctx - is the MessageContextinitialHandler - is the EnvelopeBuilder handlerpublic DeserializationContext(InputSource is, MessageContext ctx, String messageType)
is - is the InputSourcectx - is the MessageContextmessageType - is the MessageType to construct an EnvelopeBuilderpublic DeserializationContext(InputSource is, MessageContext ctx, String messageType, SOAPEnvelope env)
is - is the InputSourcectx - is the MessageContextmessageType - is the MessageType to construct an EnvelopeBuilderenv - is the SOAPEnvelope to construct an EnvelopeBuilderpublic void deserializing(boolean isDeserializing)
public SOAPConstants getSOAPConstants()
public void parse()
throws SAXException
SAXExceptionpublic MessageElement getCurElement()
public void setCurElement(MessageElement el)
public MessageContext getMessageContext()
public String getEncodingStyle()
String valuepublic SOAPEnvelope getEnvelope()
public SAX2EventRecorder getRecorder()
public void setRecorder(SAX2EventRecorder recorder)
public ArrayList getCurrentNSMappings()
public String getNamespaceURI(String prefix)
public QName getQNameFromString(String qNameStr)
qNameStr - is the prefixed name from the xml textpublic QName getTypeFromXSITypeAttr(String namespace, String localName, Attributes attrs)
namespace - of the elementlocalName - is the local name of the elementattrs - are the attributes on the elementpublic QName getTypeFromAttributes(String namespace, String localName, Attributes attrs)
namespace - of the elementlocalName - is the local name of the elementattrs - are the attributes on the elementpublic boolean isNil(Attributes attrs)
attrs - are the element attributes.public final Deserializer getDeserializer(Class cls, QName xmlType)
public Deserializer getDeserializerForClass(Class cls)
cls - is the Class used to find the deserializerpublic void setDestinationClass(Class destClass)
destClass - is the Class of the component to be deserializedpublic Class getDestinationClass()
public final Deserializer getDeserializerForType(QName xmlType)
xmlType - is QName for a type to deserializepublic TypeMapping getTypeMapping()
public TypeMappingRegistry getTypeMappingRegistry()
public MessageElement getElementByID(String id)
id - is the value of an href attributepublic Object getObjectByRef(String href)
href - is the value of an href attribute (or an Attachment id)public void addObjectById(String id, Object obj)
id - (id name without the #)obj - is the deserialized object for this id.public void registerFixup(String href, Deserializer dser)
href - (#id syntax)dser - is the deserializer of the elementpublic void registerElementByID(String id, MessageElement elem)
id - (id name without the #)elem - is the MessageElementpublic void registerResolverForID(String id, IDResolver resolver)
public boolean hasElementsByID()
public int getCurrentRecordPos()
public int getStartOfMappingsPos()
public void pushNewElement(MessageElement elem)
public void pushElementHandler(SOAPHandler handler)
public void replaceElementHandler(SOAPHandler handler)
public SOAPHandler popElementHandler()
public void setProcessingRef(boolean ref)
public boolean isProcessingRef()
public void startDocument()
throws SAXException
startDocument in interface ContentHandlerSAXExceptionpublic void endDocument()
throws SAXException
endDocument in interface ContentHandlerSAXExceptionpublic boolean isDoneParsing()
public void startPrefixMapping(String prefix, String uri) throws SAXException
startPrefixMapping in interface ContentHandlerSAXExceptionpublic void endPrefixMapping(String prefix) throws SAXException
endPrefixMapping in interface ContentHandlerSAXExceptionpublic void setDocumentLocator(Locator locator)
setDocumentLocator in interface ContentHandlerpublic void characters(char[] p1,
int p2,
int p3)
throws SAXException
characters in interface ContentHandlerSAXExceptionpublic void ignorableWhitespace(char[] p1,
int p2,
int p3)
throws SAXException
ignorableWhitespace in interface ContentHandlerSAXExceptionpublic void processingInstruction(String p1, String p2) throws SAXException
processingInstruction in interface ContentHandlerSAXExceptionpublic void skippedEntity(String p1) throws SAXException
skippedEntity in interface ContentHandlerSAXExceptionpublic void startElement(String namespace, String localName, String qName, Attributes attributes) throws SAXException
startElement in interface ContentHandlerSAXExceptionpublic void endElement(String namespace, String localName, String qName) throws SAXException
endElement in interface ContentHandlerSAXExceptionpublic void startDTD(String name, String publicId, String systemId) throws SAXException
startDTD in interface LexicalHandlerSAXExceptionpublic void notationDecl(String name, String publicId, String systemId) throws SAXException
notationDecl in interface DTDHandlerSAXExceptionpublic void unparsedEntityDecl(String name, String publicId, String systemId, String notationName) throws SAXException
unparsedEntityDecl in interface DTDHandlerSAXExceptionpublic void endDTD()
throws SAXException
endDTD in interface LexicalHandlerSAXExceptionpublic void startEntity(String name) throws SAXException
startEntity in interface LexicalHandlerSAXExceptionpublic void endEntity(String name) throws SAXException
endEntity in interface LexicalHandlerSAXExceptionpublic void startCDATA()
throws SAXException
startCDATA in interface LexicalHandlerSAXExceptionpublic void endCDATA()
throws SAXException
endCDATA in interface LexicalHandlerSAXExceptionpublic void comment(char[] ch,
int start,
int length)
throws SAXException
comment in interface LexicalHandlerSAXExceptionCopyright © The Apache Software Foundation. All Rights Reserved.