Java Doc for UnmarshallingContext.java in  » 6.0-JDK-Modules » jaxb-impl » com » sun » xml » bind » v2 » runtime » unmarshaller » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » jaxb impl » com.sun.xml.bind.v2.runtime.unmarshaller 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.sun.xml.bind.v2.runtime.Coordinator
      com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext

UnmarshallingContext
final public class UnmarshallingContext extends Coordinator implements NamespaceContext,ValidationEventHandler,ErrorHandler,XmlVisitor,XmlVisitor.TextPredictor(Code)
Center of the unmarshalling.

This object is responsible for coordinating Loader s to perform the whole unmarshalling.
author:
   Kohsuke Kawaguchi


Inner Class :final public class State

Field Summary
public  ClassResolverclassResolver
     Used to discover additional classes when we hit unknown elements/types.
final public  UnmarshallerImplparent
    

Constructor Summary
public  UnmarshallingContext(UnmarshallerImpl _parent, AssociationMap assoc)
     Creates a new unmarshaller.
Parameters:
  assoc - Must be both non-null when the unmarshaller does thein-place unmarshalling.

Method Summary
public  voidaddPatcher(Patcher job)
     Adds a job that will be executed at the last of the unmarshalling.
public  StringaddToIdTable(String id)
     Adds the object which is currently being unmarshalled to the ID table.
public  ObjectcreateInstance(Class clazz)
     Creates a new instance of the specified class.
public  ObjectcreateInstance(JaxBeanInfo beanInfo)
     Creates a new instance of the specified class.
public  voidendDocument()
    
final public  voidendElement(TagName tagName)
    
public  voidendPrefixMapping(String prefix)
    
public  voidendScope(int frameSize)
     Ends the current packing scope.
public  voiderrorUnresolvedIDREF(Object bean, String idref, LocatorEx loc)
     Called when there's no corresponding ID value.
public  booleanexpectText()
     You should be always calling this through TextPredictor .
public  String[]getAllDeclaredPrefixes()
     Returns a list of all in-scope prefixes. A possible zero-length array of prefixes.
public  UnmarshallingContextgetContext()
    
public  StategetCurrentState()
    
public  ObjectgetInnerPeer()
     Gets the inner peer JAXB object associated with the current element.
public static  UnmarshallingContextgetInstance()
     When called from within the realm of the unmarshaller, this method returns the current UnmarshallingContext in charge.
public  JAXBContextImplgetJAXBContext()
    
protected  ValidationEventLocatorgetLocation()
    
public  LocatorExgetLocator()
     Gets the current source location information in SAX Locator .
public  StringgetNamespaceURI(String prefix)
    
public  String[]getNewlyDeclaredPrefixes()
     Returns a list of prefixes newly declared on the current element. A possible zero-length array of prefixes.
public  CallablegetObjectFromId(String id, Class targetType)
     Looks up the ID table and gets associated object.
public  ObjectgetOuterPeer()
     Gets the outer peer JAXB object associated with the current element.
public  TextPredictorgetPredictor()
     You should be always getting TextPredictor from XmlVisitor .
public  StringgetPrefix(String uri)
    
public  Iterator<String>getPrefixes(String uri)
    
public  ObjectgetResult()
    
public  ScopegetScope(int offset)
     Gets the currently active Scope .
public  StringgetXMIMEContentType()
     Gets the xmime:contentType value for the current object.
public  voidhandleError(Exception e)
     Reports an exception found during the unmarshalling to the user.
public  voidhandleError(Exception e, boolean canRecover)
    
public  voidhandleError(String msg)
    
public  voidhandleEvent(ValidationEvent event, boolean canRecover)
     Reports an error to the user, and asks if s/he wants to recover.
public  booleanhandleEvent(ValidationEvent event)
    
public  voidrecordInnerPeer(Object innerPeer)
     Notifies the context about the inner peer of the current element.

If the unmarshalling is building the association, the context will use this information.

public  voidrecordOuterPeer(Object outerPeer)
     Notifies the context about the outer peer of the current element.

If the unmarshalling is building the association, the context will use this information.

public  voidreset(InfosetScanner scanner, boolean isInplaceMode, JaxBeanInfo expectedType, IDResolver idResolver)
    
public  LoaderselectRootLoader(State state, TagName tag)
     On top of JAXBContextImpl.selectRootLoader(StateTagName) , this method also consults ClassResolver .
public  voidsetFactories(Object factoryInstances)
    
public  voidstartDocument(LocatorEx locator, NamespaceContext nsContext)
    
public  voidstartElement(TagName tagName)
    
public  voidstartPrefixMapping(String prefix, String uri)
    
public  voidstartScope(int frameSize)
     Starts a new packing scope.

This method allocates a specified number of fresh Scope objects. They can be accessed by the UnmarshallingContext.getScope method until the corresponding UnmarshallingContext.endScope method is invoked.

A new scope will mask the currently active scope.

public  voidtext(CharSequence pcdata)
    

Field Detail
classResolver
public ClassResolver classResolver(Code)
Used to discover additional classes when we hit unknown elements/types.



parent
final public UnmarshallerImpl parent(Code)




Constructor Detail
UnmarshallingContext
public UnmarshallingContext(UnmarshallerImpl _parent, AssociationMap assoc)(Code)
Creates a new unmarshaller.
Parameters:
  assoc - Must be both non-null when the unmarshaller does thein-place unmarshalling. Otherwise must be both null.




Method Detail
addPatcher
public void addPatcher(Patcher job)(Code)
Adds a job that will be executed at the last of the unmarshalling. This method is used to support ID/IDREF feature, but it can be used for other purposes as well.
Parameters:
  job - The run method of this object is called.



addToIdTable
public String addToIdTable(String id) throws SAXException(Code)
Adds the object which is currently being unmarshalled to the ID table. Returns the value passed as the parameter.This is a hack, but this makes it easier for IDtransducer to do its job.



createInstance
public Object createInstance(Class clazz) throws SAXException(Code)
Creates a new instance of the specified class. In the unmarshaller, we need to check the user-specified factory class.



createInstance
public Object createInstance(JaxBeanInfo beanInfo) throws SAXException(Code)
Creates a new instance of the specified class. In the unmarshaller, we need to check the user-specified factory class.



endDocument
public void endDocument() throws SAXException(Code)



endElement
final public void endElement(TagName tagName) throws SAXException(Code)



endPrefixMapping
public void endPrefixMapping(String prefix)(Code)



endScope
public void endScope(int frameSize) throws SAXException(Code)
Ends the current packing scope.

If any packing in progress will be finalized by this method.
Parameters:
  frameSize - The same size that gets passed to the UnmarshallingContext.startScope(int)method.




errorUnresolvedIDREF
public void errorUnresolvedIDREF(Object bean, String idref, LocatorEx loc) throws SAXException(Code)
Called when there's no corresponding ID value.



expectText
public boolean expectText()(Code)
You should be always calling this through TextPredictor .



getAllDeclaredPrefixes
public String[] getAllDeclaredPrefixes()(Code)
Returns a list of all in-scope prefixes. A possible zero-length array of prefixes. The default prefixis represented by the empty string.



getContext
public UnmarshallingContext getContext()(Code)



getCurrentState
public State getCurrentState()(Code)



getInnerPeer
public Object getInnerPeer()(Code)
Gets the inner peer JAXB object associated with the current element. null if the current element doesn't have an inner peer,or if we are not doing the in-place unmarshalling.



getInstance
public static UnmarshallingContext getInstance()(Code)
When called from within the realm of the unmarshaller, this method returns the current UnmarshallingContext in charge.



getJAXBContext
public JAXBContextImpl getJAXBContext()(Code)



getLocation
protected ValidationEventLocator getLocation()(Code)



getLocator
public LocatorEx getLocator()(Code)
Gets the current source location information in SAX Locator .

Sometimes the unmarshaller works against a different kind of XML source, making this information meaningless.




getNamespaceURI
public String getNamespaceURI(String prefix)(Code)



getNewlyDeclaredPrefixes
public String[] getNewlyDeclaredPrefixes()(Code)
Returns a list of prefixes newly declared on the current element. A possible zero-length array of prefixes. The default prefixis represented by the empty string.



getObjectFromId
public Callable getObjectFromId(String id, Class targetType) throws SAXException(Code)
Looks up the ID table and gets associated object.

The exception thrown from Callable.call means the unmarshaller should abort right away.
See Also:   IDResolver.resolve(StringClass)




getOuterPeer
public Object getOuterPeer()(Code)
Gets the outer peer JAXB object associated with the current element. null if the current element doesn't have an inner peer,or if we are not doing the in-place unmarshalling.



getPredictor
public TextPredictor getPredictor()(Code)
You should be always getting TextPredictor from XmlVisitor .



getPrefix
public String getPrefix(String uri)(Code)



getPrefixes
public Iterator<String> getPrefixes(String uri)(Code)



getResult
public Object getResult() throws UnmarshalException(Code)
Gets the result of the unmarshalling



getScope
public Scope getScope(int offset)(Code)
Gets the currently active Scope .
Parameters:
  offset - a number between [0,frameSize)always a valid Scope object.



getXMIMEContentType
public String getXMIMEContentType()(Code)
Gets the xmime:contentType value for the current object.
See Also:   JAXBContextImpl.getXMIMEContentType(Object)



handleError
public void handleError(Exception e) throws SAXException(Code)
Reports an exception found during the unmarshalling to the user. This method is a convenience method that calls into UnmarshallingContext.handleEvent(ValidationEvent,boolean)



handleError
public void handleError(Exception e, boolean canRecover) throws SAXException(Code)



handleError
public void handleError(String msg)(Code)



handleEvent
public void handleEvent(ValidationEvent event, boolean canRecover) throws SAXException(Code)
Reports an error to the user, and asks if s/he wants to recover. If the canRecover flag is false, regardless of the client instruction, an exception will be thrown. Only if the flag is true and the user wants to recover from an error, the method returns normally. The thrown exception will be catched by the unmarshaller.



handleEvent
public boolean handleEvent(ValidationEvent event)(Code)



recordInnerPeer
public void recordInnerPeer(Object innerPeer)(Code)
Notifies the context about the inner peer of the current element.

If the unmarshalling is building the association, the context will use this information. Otherwise it will be just ignored.




recordOuterPeer
public void recordOuterPeer(Object outerPeer)(Code)
Notifies the context about the outer peer of the current element.

If the unmarshalling is building the association, the context will use this information. Otherwise it will be just ignored.




reset
public void reset(InfosetScanner scanner, boolean isInplaceMode, JaxBeanInfo expectedType, IDResolver idResolver)(Code)



selectRootLoader
public Loader selectRootLoader(State state, TagName tag) throws SAXException(Code)
On top of JAXBContextImpl.selectRootLoader(StateTagName) , this method also consults ClassResolver .
throws:
  SAXException - if ValidationEventHandler reported a failure.



setFactories
public void setFactories(Object factoryInstances)(Code)



startDocument
public void startDocument(LocatorEx locator, NamespaceContext nsContext) throws SAXException(Code)



startElement
public void startElement(TagName tagName) throws SAXException(Code)



startPrefixMapping
public void startPrefixMapping(String prefix, String uri)(Code)



startScope
public void startScope(int frameSize)(Code)
Starts a new packing scope.

This method allocates a specified number of fresh Scope objects. They can be accessed by the UnmarshallingContext.getScope method until the corresponding UnmarshallingContext.endScope method is invoked.

A new scope will mask the currently active scope. Only one frame of Scope s can be accessed at any given time.
Parameters:
  frameSize - The # of slots to be allocated.




text
public void text(CharSequence pcdata) throws SAXException(Code)



Fields inherited from com.sun.xml.bind.v2.runtime.Coordinator
public static boolean debugTableNPE(Code)(Java Doc)
public Exception guyWhoSetTheTableToNull(Code)(Java Doc)

Methods inherited from com.sun.xml.bind.v2.runtime.Coordinator
public static Coordinator _getInstance()(Code)(Java Doc)
public boolean containsAdapter(Class<T> type)(Code)(Java Doc)
final public void error(SAXParseException exception) throws SAXException(Code)(Java Doc)
final public void fatalError(SAXParseException exception) throws SAXException(Code)(Java Doc)
final public T getAdapter(Class<T> key)(Code)(Java Doc)
abstract protected ValidationEventLocator getLocation()(Code)(Java Doc)
final protected void popCoordinator()(Code)(Java Doc)
final protected void pushCoordinator()(Code)(Java Doc)
final public XmlAdapter putAdapter(Class<? extends XmlAdapter> c, XmlAdapter a)(Code)(Java Doc)
final protected void resetThreadAffinity()(Code)(Java Doc)
final protected void setThreadAffinity()(Code)(Java Doc)
final public void warning(SAXParseException exception) throws SAXException(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

ww___w__._ja_v_a___2s___.c___o___m__ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.