|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectedu.ksi.virtualclassroom.mappers.jaxb.xmlwrapper.impl.runtime.SAXUnmarshallerHandlerImpl
Implementation of UnmarshallerHandler.
*
* This object converts SAX events into unmarshaller events and
* cooridnates the entire unmarshalling process.
*
* @author
* Kohsuke KAWAGUCHI
* @version $Revision$
| Field Summary | |
private boolean |
aborted
Field aborted |
private com.sun.xml.bind.util.AttributesImpl[] |
attStack
Attributes stack. |
private java.lang.StringBuffer |
buffer
Field buffer |
private boolean[] |
collectText
Stack of collectText flag. |
private int |
elementDepth
Element nesting level. |
private GrammarInfo |
grammarInfo
Field grammarInfo |
private int |
handlerLen
Field handlerLen |
private UnmarshallingEventHandler[] |
handlers
Field handlers |
private java.util.Hashtable |
idmap
Records ID->Object map. |
private int[] |
idxStack
Field idxStack |
private boolean |
isUnmarshalInProgress
This flag is set to true at the startDocument event and false at the endDocument event. |
private org.xml.sax.Locator |
locator
Field locator |
private int[] |
mementos
Field mementos |
private java.lang.String[] |
nsBind
Field nsBind |
private int |
nsLen
Field nsLen |
private UnmarshallerImpl |
parent
Field parent |
private java.lang.Runnable[] |
patchers
Submitted patchers in the order they've submitted. |
private int |
patchersLen
Field patchersLen |
private java.lang.Object |
result
Root object that is being unmarshalled. |
private int |
stackTop
Always elementDepth-1. |
private com.sun.xml.bind.unmarshaller.Tracer |
tracer
Field tracer |
| Constructor Summary | |
SAXUnmarshallerHandlerImpl(UnmarshallerImpl _parent,
GrammarInfo _gi)
Constructor for SAXUnmarshallerHandlerImpl |
|
| Method Summary | |
void |
addPatcher(java.lang.Runnable job)
Method addPatcher |
java.lang.String |
addToIdTable(java.lang.String id)
Method addToIdTable |
void |
characters(char[] buf,
int start,
int len)
Method characters |
private java.lang.String |
computeExpectedRootElements()
Computes the names of possible root elements for a better error diagnosis. |
void |
consumeAttribute(int idx)
Method consumeAttribute |
protected void |
consumeText(java.lang.String str,
boolean ignorable)
Method consumeText |
java.lang.String |
eatAttribute(int idx)
Method eatAttribute |
void |
endDocument()
Method endDocument |
void |
endElement(java.lang.String uri,
java.lang.String local,
java.lang.String qname)
Method endElement |
void |
endPrefixMapping(java.lang.String prefix)
Method endPrefixMapping |
java.lang.String[] |
getAllDeclaredPrefixes()
Method getAllDeclaredPrefixes |
private java.util.List |
getAllPrefixesInList(java.lang.String uri)
Method getAllPrefixesInList |
int |
getAttribute(java.lang.String uri,
java.lang.String local)
Gets the index of the attribute with the specified name. |
java.lang.String |
getBaseUri()
Method getBaseUri |
UnmarshallingEventHandler |
getCurrentHandler()
Method getCurrentHandler |
GrammarInfo |
getGrammarInfo()
Method getGrammarInfo |
org.xml.sax.Locator |
getLocator()
Method getLocator |
java.lang.String |
getNamespaceURI(java.lang.String prefix)
Method getNamespaceURI |
java.lang.String[] |
getNewlyDeclaredPrefixes()
Method getNewlyDeclaredPrefixes |
java.lang.Object |
getObjectFromId(java.lang.String id)
Method getObjectFromId |
java.lang.String |
getPrefix(java.lang.String uri)
Method getPrefix |
java.util.Iterator |
getPrefixes(java.lang.String uri)
Method getPrefixes |
private java.lang.String[] |
getPrefixList(int startIndex)
Method getPrefixList |
java.lang.Object |
getResult()
Method getResult |
com.sun.xml.bind.unmarshaller.Tracer |
getTracer()
Method getTracer |
org.xml.sax.Attributes |
getUnconsumedAttributes()
Method getUnconsumedAttributes |
void |
handleEvent(javax.xml.bind.ValidationEvent event,
boolean canRecover)
Method handleEvent |
void |
ignorableWhitespace(char[] buf,
int start,
int len)
Method ignorableWhitespace |
boolean |
isNotation(java.lang.String s)
Method isNotation |
boolean |
isUnparsedEntity(java.lang.String s)
Method isUnparsedEntity |
void |
popAttributes()
Method popAttributes |
void |
popContentHandler()
Method popContentHandler |
void |
processingInstruction(java.lang.String target,
java.lang.String data)
Method processingInstruction |
private void |
processText(boolean ignorable)
Method processText |
void |
pushAttributes(org.xml.sax.Attributes atts,
boolean collectTextFlag)
Method pushAttributes |
void |
pushContentHandler(UnmarshallingEventHandler handler,
int memento)
Method pushContentHandler |
java.lang.String |
resolveNamespacePrefix(java.lang.String prefix)
Method resolveNamespacePrefix |
private void |
runPatchers()
Executes all the patchers. |
void |
setDocumentLocator(org.xml.sax.Locator loc)
Method setDocumentLocator |
void |
setTracer(com.sun.xml.bind.unmarshaller.Tracer t)
Method setTracer |
private boolean |
shouldCollectText()
Returns true if we should be collecting characters in the current element. |
void |
skippedEntity(java.lang.String name)
Method skippedEntity |
void |
startDocument()
Method startDocument |
void |
startElement(java.lang.String uri,
java.lang.String local,
java.lang.String qname,
org.xml.sax.Attributes atts)
Method startElement |
void |
startPrefixMapping(java.lang.String prefix,
java.lang.String uri)
Method startPrefixMapping |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private boolean isUnmarshalInProgress
private final GrammarInfo grammarInfo
private java.lang.Object result
private UnmarshallingEventHandler[] handlers
private int[] mementos
private int handlerLen
private java.lang.StringBuffer buffer
private java.lang.String[] nsBind
private int nsLen
private int[] idxStack
private com.sun.xml.bind.util.AttributesImpl[] attStack
private int elementDepth
private int stackTop
elementDepth-1.
private boolean[] collectText
elementDepth and stackTop to access the array.
private java.lang.Runnable[] patchers
private int patchersLen
private java.util.Hashtable idmap
private org.xml.sax.Locator locator
private final UnmarshallerImpl parent
private boolean aborted
private com.sun.xml.bind.unmarshaller.Tracer tracer
| Constructor Detail |
public SAXUnmarshallerHandlerImpl(UnmarshallerImpl _parent,
GrammarInfo _gi)
_parent - UnmarshallerImpl_gi - GrammarInfo| Method Detail |
public GrammarInfo getGrammarInfo()
getGrammarInfo in interface UnmarshallingContextUnmarshallingContext.getGrammarInfo()private final boolean shouldCollectText()
public void startDocument()
throws org.xml.sax.SAXException
startDocument in interface org.xml.sax.ContentHandlerorg.xml.sax.SAXExceptionContentHandler.startDocument()
public void endDocument()
throws org.xml.sax.SAXException
endDocument in interface org.xml.sax.ContentHandlerorg.xml.sax.SAXExceptionContentHandler.endDocument()
public void startElement(java.lang.String uri,
java.lang.String local,
java.lang.String qname,
org.xml.sax.Attributes atts)
throws org.xml.sax.SAXException
startElement in interface org.xml.sax.ContentHandleruri - Stringlocal - Stringqname - Stringatts - Attributes
org.xml.sax.SAXExceptionContentHandler.startElement(String, String, String, Attributes)
public final void endElement(java.lang.String uri,
java.lang.String local,
java.lang.String qname)
throws org.xml.sax.SAXException
endElement in interface org.xml.sax.ContentHandleruri - Stringlocal - Stringqname - String
org.xml.sax.SAXExceptionContentHandler.endElement(String, String, String)
public java.lang.Object getResult()
throws javax.xml.bind.UnmarshalException
getResult in interface javax.xml.bind.UnmarshallerHandlerjavax.xml.bind.UnmarshalExceptionUnmarshallerHandler.getResult()
public void pushContentHandler(UnmarshallingEventHandler handler,
int memento)
pushContentHandler in interface UnmarshallingContexthandler - UnmarshallingEventHandlermemento - intUnmarshallingContext.pushContentHandler(UnmarshallingEventHandler, int)
public void popContentHandler()
throws org.xml.sax.SAXException
popContentHandler in interface UnmarshallingContextorg.xml.sax.SAXExceptionUnmarshallingContext.popContentHandler()public UnmarshallingEventHandler getCurrentHandler()
getCurrentHandler in interface UnmarshallingContextUnmarshallingContext.getCurrentHandler()
protected void consumeText(java.lang.String str,
boolean ignorable)
throws org.xml.sax.SAXException
str - Stringignorable - boolean
org.xml.sax.SAXException
private void processText(boolean ignorable)
throws org.xml.sax.SAXException
ignorable - boolean
org.xml.sax.SAXException
public final void characters(char[] buf,
int start,
int len)
characters in interface org.xml.sax.ContentHandlerbuf - char[]start - intlen - intContentHandler.characters(char[], int, int)
public final void ignorableWhitespace(char[] buf,
int start,
int len)
ignorableWhitespace in interface org.xml.sax.ContentHandlerbuf - char[]start - intlen - intContentHandler.ignorableWhitespace(char[], int, int)
public void startPrefixMapping(java.lang.String prefix,
java.lang.String uri)
startPrefixMapping in interface org.xml.sax.ContentHandlerprefix - Stringuri - StringContentHandler.startPrefixMapping(String, String)public void endPrefixMapping(java.lang.String prefix)
endPrefixMapping in interface org.xml.sax.ContentHandlerprefix - StringContentHandler.endPrefixMapping(String)public java.lang.String resolveNamespacePrefix(java.lang.String prefix)
resolveNamespacePrefix in interface UnmarshallingContextprefix - String
UnmarshallingContext.resolveNamespacePrefix(String)public java.lang.String[] getNewlyDeclaredPrefixes()
getNewlyDeclaredPrefixes in interface UnmarshallingContextUnmarshallingContext.getNewlyDeclaredPrefixes()public java.lang.String[] getAllDeclaredPrefixes()
getAllDeclaredPrefixes in interface UnmarshallingContextUnmarshallingContext.getAllDeclaredPrefixes()private java.lang.String[] getPrefixList(int startIndex)
startIndex - int
public java.util.Iterator getPrefixes(java.lang.String uri)
getPrefixes in interface javax.xml.namespace.NamespaceContexturi - String
NamespaceContext.getPrefixes(String)private java.util.List getAllPrefixesInList(java.lang.String uri)
uri - String
public java.lang.String getPrefix(java.lang.String uri)
getPrefix in interface javax.xml.namespace.NamespaceContexturi - String
NamespaceContext.getPrefix(String)public java.lang.String getNamespaceURI(java.lang.String prefix)
getNamespaceURI in interface javax.xml.namespace.NamespaceContextprefix - String
NamespaceContext.getNamespaceURI(String)
public void pushAttributes(org.xml.sax.Attributes atts,
boolean collectTextFlag)
pushAttributes in interface UnmarshallingContextatts - AttributescollectTextFlag - booleanUnmarshallingContext.pushAttributes(Attributes, boolean)public void popAttributes()
popAttributes in interface UnmarshallingContextUnmarshallingContext.popAttributes()public org.xml.sax.Attributes getUnconsumedAttributes()
getUnconsumedAttributes in interface UnmarshallingContextUnmarshallingContext.getUnconsumedAttributes()
public int getAttribute(java.lang.String uri,
java.lang.String local)
UnmarshallingContext
getAttribute in interface UnmarshallingContexturi - * has to be interned.local - String
UnmarshallingContext.getAttribute(String, String)
public void consumeAttribute(int idx)
throws org.xml.sax.SAXException
consumeAttribute in interface UnmarshallingContextidx - int
org.xml.sax.SAXExceptionUnmarshallingContext.consumeAttribute(int)
public java.lang.String eatAttribute(int idx)
throws org.xml.sax.SAXException
eatAttribute in interface UnmarshallingContextidx - int
org.xml.sax.SAXExceptionUnmarshallingContext.eatAttribute(int)public void addPatcher(java.lang.Runnable job)
addPatcher in interface UnmarshallingContextjob - RunnableUnmarshallingContext.addPatcher(Runnable)private void runPatchers()
public java.lang.String addToIdTable(java.lang.String id)
addToIdTable in interface UnmarshallingContextid - String
UnmarshallingContext.addToIdTable(String)public java.lang.Object getObjectFromId(java.lang.String id)
getObjectFromId in interface UnmarshallingContextid - String
UnmarshallingContext.getObjectFromId(String)public void skippedEntity(java.lang.String name)
skippedEntity in interface org.xml.sax.ContentHandlername - StringContentHandler.skippedEntity(String)
public void processingInstruction(java.lang.String target,
java.lang.String data)
processingInstruction in interface org.xml.sax.ContentHandlertarget - Stringdata - StringContentHandler.processingInstruction(String, String)public void setDocumentLocator(org.xml.sax.Locator loc)
setDocumentLocator in interface org.xml.sax.ContentHandlerloc - LocatorContentHandler.setDocumentLocator(Locator)public org.xml.sax.Locator getLocator()
getLocator in interface UnmarshallingContextUnmarshallingContext.getLocator()
public void handleEvent(javax.xml.bind.ValidationEvent event,
boolean canRecover)
throws org.xml.sax.SAXException
handleEvent in interface SAXUnmarshallerHandlerevent - ValidationEventcanRecover - boolean
org.xml.sax.SAXExceptionSAXUnmarshallerHandler.handleEvent(ValidationEvent, boolean)public java.lang.String getBaseUri()
getBaseUri in interface UnmarshallingContextUnmarshallingContext.getBaseUri()public boolean isUnparsedEntity(java.lang.String s)
isUnparsedEntity in interface UnmarshallingContexts - String
UnmarshallingContext.isUnparsedEntity(String)public boolean isNotation(java.lang.String s)
isNotation in interface UnmarshallingContexts - String
UnmarshallingContext.isNotation(String)public void setTracer(com.sun.xml.bind.unmarshaller.Tracer t)
t - Tracerpublic com.sun.xml.bind.unmarshaller.Tracer getTracer()
getTracer in interface UnmarshallingContextUnmarshallingContext.getTracer()private java.lang.String computeExpectedRootElements()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||