public class SAXUnmarshallerHandlerImpl extends Object implements SAXUnmarshallerHandler, UnmarshallingContext
UnmarshallerHandler
.
This object converts SAX events into unmarshaller events and
cooridnates the entire unmarshalling process.Constructor and Description |
---|
SAXUnmarshallerHandlerImpl(UnmarshallerImpl _parent,
GrammarInfo _gi) |
Modifier and Type | Method and Description |
---|---|
void |
addPatcher(Runnable job)
Adds a job that will be executed at the last of the unmarshalling.
|
String |
addToIdTable(String id)
Adds the object which is currently being unmarshalled
to the ID table.
|
void |
characters(char[] buf,
int start,
int len) |
void |
consumeAttribute(int idx)
Fires an attribute event for the specified attribute,
and marks the attribute as "used".
|
protected void |
consumeText(String str,
boolean ignorable) |
String |
eatAttribute(int idx)
Marks the attribute as "used" and return the value of the attribute.
|
void |
endDocument() |
void |
endElement(String uri,
String local,
String qname) |
void |
endPrefixMapping(String prefix) |
String[] |
getAllDeclaredPrefixes()
Returns a list of all in-scope prefixes.
|
int |
getAttribute(String uri,
String local)
Gets the index of the attribute with the specified name.
|
String |
getBaseUri() |
UnmarshallingEventHandler |
getCurrentHandler()
Gets the current handler.
|
GrammarInfo |
getGrammarInfo()
Obtains a reference to the current grammar info.
|
Locator |
getLocator()
Gets the current source location information.
|
String |
getNamespaceURI(String prefix) |
String[] |
getNewlyDeclaredPrefixes()
Returns a list of prefixes newly declared on this element.
|
Object |
getObjectFromId(String id)
Looks up the ID table and gets associated object.
|
String |
getPrefix(String uri) |
Iterator |
getPrefixes(String uri) |
Object |
getResult() |
com.sun.xml.bind.unmarshaller.Tracer |
getTracer()
Gets a tracer object.
|
Attributes |
getUnconsumedAttributes()
Gets all the unconsumed attributes.
|
void |
handleEvent(ValidationEvent event,
boolean canRecover)
Reports an error to the user, and asks if s/he wants
to recover.
|
void |
ignorableWhitespace(char[] buf,
int start,
int len) |
boolean |
isNotation(String s) |
boolean |
isUnparsedEntity(String s) |
void |
popAttributes()
Discards the previously stored attribute set.
|
void |
popContentHandler()
Pops a content handler from the stack and registers
it as the current content handler.
|
void |
processingInstruction(String target,
String data) |
void |
pushAttributes(Attributes atts,
boolean collectTextFlag)
Stores a new attribute set.
|
void |
pushContentHandler(UnmarshallingEventHandler handler,
int memento)
Pushes the current content handler into the stack
and registers the newly specified content handler so
that it can receive SAX events.
|
String |
resolveNamespacePrefix(String prefix) |
void |
setDocumentLocator(Locator loc) |
void |
setTracer(com.sun.xml.bind.unmarshaller.Tracer t) |
void |
skippedEntity(String name) |
void |
startDocument() |
void |
startElement(String uri,
String local,
String qname,
Attributes atts) |
void |
startPrefixMapping(String prefix,
String uri) |
public SAXUnmarshallerHandlerImpl(UnmarshallerImpl _parent, GrammarInfo _gi)
public GrammarInfo getGrammarInfo()
UnmarshallingContext
getGrammarInfo
in interface UnmarshallingContext
public void startDocument() throws SAXException
startDocument
in interface ContentHandler
SAXException
public void endDocument() throws SAXException
endDocument
in interface ContentHandler
SAXException
public void startElement(String uri, String local, String qname, Attributes atts) throws SAXException
startElement
in interface ContentHandler
SAXException
public final void endElement(String uri, String local, String qname) throws SAXException
endElement
in interface ContentHandler
SAXException
public Object getResult() throws UnmarshalException
getResult
in interface UnmarshallerHandler
UnmarshalException
public void pushContentHandler(UnmarshallingEventHandler handler, int memento)
UnmarshallingContext
pushContentHandler
in interface UnmarshallingContext
memento
- When this newly specified handler will be removed from the stack,
the leaveChild event will be fired to the parent handler
with this memento.public void popContentHandler() throws SAXException
UnmarshallingContext
This method will also fire the leaveChild event with the associated memento.
popContentHandler
in interface UnmarshallingContext
SAXException
public UnmarshallingEventHandler getCurrentHandler()
UnmarshallingContext
getCurrentHandler
in interface UnmarshallingContext
protected void consumeText(String str, boolean ignorable) throws SAXException
SAXException
public final void characters(char[] buf, int start, int len)
characters
in interface ContentHandler
public final void ignorableWhitespace(char[] buf, int start, int len)
ignorableWhitespace
in interface ContentHandler
public void startPrefixMapping(String prefix, String uri)
startPrefixMapping
in interface ContentHandler
public void endPrefixMapping(String prefix)
endPrefixMapping
in interface ContentHandler
public String resolveNamespacePrefix(String prefix)
resolveNamespacePrefix
in interface UnmarshallingContext
public String[] getNewlyDeclaredPrefixes()
UnmarshallingContext
UnmarshallingContext.pushAttributes(org.xml.sax.Attributes, boolean)
method is called.getNewlyDeclaredPrefixes
in interface UnmarshallingContext
public String[] getAllDeclaredPrefixes()
UnmarshallingContext
getAllDeclaredPrefixes
in interface UnmarshallingContext
public Iterator getPrefixes(String uri)
getPrefixes
in interface NamespaceContext
public String getPrefix(String uri)
getPrefix
in interface NamespaceContext
public String getNamespaceURI(String prefix)
getNamespaceURI
in interface NamespaceContext
public void pushAttributes(Attributes atts, boolean collectTextFlag)
UnmarshallingContext
pushAttributes
in interface UnmarshallingContext
collectTextFlag
- false if the context doesn't need to fire text events
for texts inside this element. True otherwise.public void popAttributes()
UnmarshallingContext
popAttributes
in interface UnmarshallingContext
public Attributes getUnconsumedAttributes()
UnmarshallingContext
getUnconsumedAttributes
in interface UnmarshallingContext
public int getAttribute(String uri, String local)
UnmarshallingContext
getAttribute
in interface UnmarshallingContext
uri,local
- has to be interned.public void consumeAttribute(int idx) throws SAXException
UnmarshallingContext
consumeAttribute
in interface UnmarshallingContext
SAXException
public String eatAttribute(int idx) throws SAXException
UnmarshallingContext
eatAttribute
in interface UnmarshallingContext
SAXException
public void addPatcher(Runnable job)
UnmarshallingContext
addPatcher
in interface UnmarshallingContext
job
- The run method of this object is called.public String addToIdTable(String id)
UnmarshallingContext
addToIdTable
in interface UnmarshallingContext
public Object getObjectFromId(String id)
UnmarshallingContext
getObjectFromId
in interface UnmarshallingContext
public void skippedEntity(String name)
skippedEntity
in interface ContentHandler
public void processingInstruction(String target, String data)
processingInstruction
in interface ContentHandler
public void setDocumentLocator(Locator loc)
setDocumentLocator
in interface ContentHandler
public Locator getLocator()
UnmarshallingContext
getLocator
in interface UnmarshallingContext
public void handleEvent(ValidationEvent event, boolean canRecover) throws SAXException
SAXUnmarshallerHandler
handleEvent
in interface SAXUnmarshallerHandler
handleEvent
in interface UnmarshallingContext
SAXException
public String getBaseUri()
getBaseUri
in interface UnmarshallingContext
public boolean isUnparsedEntity(String s)
isUnparsedEntity
in interface UnmarshallingContext
public boolean isNotation(String s)
isNotation
in interface UnmarshallingContext
public void setTracer(com.sun.xml.bind.unmarshaller.Tracer t)
public com.sun.xml.bind.unmarshaller.Tracer getTracer()
UnmarshallingContext
getTracer
in interface UnmarshallingContext
Copyright © 2010–2025 Open Identity Platform Community. All rights reserved.