Java Doc for AbstractUnmarshallerImpl.java in  » 6.0-JDK-Core » xml » javax » xml » bind » helpers » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
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
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » xml » javax.xml.bind.helpers 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javax.xml.bind.helpers.AbstractUnmarshallerImpl

AbstractUnmarshallerImpl
abstract public class AbstractUnmarshallerImpl implements Unmarshaller(Code)
Partial default Unmarshaller implementation.

This class provides a partial default implementation for the javax.xml.bind.Unmarshaller interface.

A JAXB Provider has to implement five methods (getUnmarshallerHandler, unmarshal(Node), unmarshal(XMLReader,InputSource), unmarshal(XMLStreamReader), and unmarshal(XMLEventReader).
author:
  


    author:
      
  • Kohsuke Kawaguchi, Sun Microsystems, Inc.

  • author:
      

version:
   $Revision: 1.13 $ $Date: 2005/07/28 22:18:12 $
See Also:   javax.xml.bind.Unmarshaller
since:
   JAXB1.0


Field Summary
protected  booleanvalidating
    


Method Summary
protected  UnmarshalExceptioncreateUnmarshalException(SAXException e)
     Creates an UnmarshalException from a SAXException.
public  AgetAdapter(Class<A> type)
    
public  AttachmentUnmarshallergetAttachmentUnmarshaller()
    
public  ValidationEventHandlergetEventHandler()
     Return the current event handler or the default event handler if one hasn't been set.
public  ListenergetListener()
    
public  ObjectgetProperty(String name)
     Default implementation of the getProperty method always throws PropertyException since there are no required properties.
public  SchemagetSchema()
    
protected  XMLReadergetXMLReader()
     Obtains a configured XMLReader.
public  booleanisValidating()
     Indicates whether or not the Unmarshaller is configured to validate during unmarshal operations.

Note: I named this method isValidating() to stay in-line with JAXP, as opposed to naming it getValidating().

public  voidsetAdapter(XmlAdapter adapter)
    
public  voidsetAdapter(Class<A> type, A adapter)
    
public  voidsetAttachmentUnmarshaller(AttachmentUnmarshaller au)
    
public  voidsetEventHandler(ValidationEventHandler handler)
     Allow an application to register a validation event handler.

The validation event handler will be called by the JAXB Provider if any validation errors are encountered during calls to any of the unmarshal methods.

public  voidsetListener(Listener listener)
    
public  voidsetProperty(String name, Object value)
     Default implementation of the setProperty method always throws PropertyException since there are no required properties.
public  voidsetSchema(Schema schema)
    
public  voidsetValidating(boolean validating)
     Specifies whether or not the Unmarshaller should validate during unmarshal operations.
public  Objectunmarshal(Source source)
    
abstract protected  Objectunmarshal(XMLReader reader, InputSource source)
     Unmarshals an object by using the specified XMLReader and the InputSource.
final public  Objectunmarshal(InputSource source)
    
final public  Objectunmarshal(URL url)
    
final public  Objectunmarshal(File f)
    
final public  Objectunmarshal(java.io.InputStream is)
    
final public  Objectunmarshal(Reader reader)
    
public  Objectunmarshal(XMLEventReader reader)
    
public  Objectunmarshal(XMLStreamReader reader)
    
public  JAXBElement<T>unmarshal(Node node, Class<T> expectedType)
    
public  JAXBElement<T>unmarshal(Source source, Class<T> expectedType)
    
public  JAXBElement<T>unmarshal(XMLStreamReader reader, Class<T> expectedType)
    
public  JAXBElement<T>unmarshal(XMLEventReader reader, Class<T> expectedType)
    

Field Detail
validating
protected boolean validating(Code)
whether or not the unmarshaller will validate





Method Detail
createUnmarshalException
protected UnmarshalException createUnmarshalException(SAXException e)(Code)
Creates an UnmarshalException from a SAXException. This is an utility method provided for the derived classes.

When a provider-implemented ContentHandler wants to throw a JAXBException, it needs to wrap the exception by a SAXException. If the unmarshaller implementation blindly wrap SAXException by JAXBException, such an exception will be a JAXBException wrapped by a SAXException wrapped by another JAXBException. This is silly.

This method checks the nested exception of SAXException and reduce those excessive wrapping. the resulting UnmarshalException




getAdapter
public A getAdapter(Class<A> type)(Code)



getAttachmentUnmarshaller
public AttachmentUnmarshaller getAttachmentUnmarshaller()(Code)



getEventHandler
public ValidationEventHandler getEventHandler() throws JAXBException(Code)
Return the current event handler or the default event handler if one hasn't been set. the current ValidationEventHandler or the default event handlerif it hasn't been set
throws:
  JAXBException - if an error was encountered while getting thecurrent event handler



getListener
public Listener getListener()(Code)



getProperty
public Object getProperty(String name) throws PropertyException(Code)
Default implementation of the getProperty method always throws PropertyException since there are no required properties. If a provider needs to handle additional properties, it should override this method in a derived class.



getSchema
public Schema getSchema()(Code)



getXMLReader
protected XMLReader getXMLReader() throws JAXBException(Code)
Obtains a configured XMLReader. This method is used when the client-specified SAXSource object doesn't have XMLReader. Unmarshaller is not re-entrant, so we will only use one instance of XMLReader.



isValidating
public boolean isValidating() throws JAXBException(Code)
Indicates whether or not the Unmarshaller is configured to validate during unmarshal operations.

Note: I named this method isValidating() to stay in-line with JAXP, as opposed to naming it getValidating(). true if the Unmarshaller is configured to validate duringunmarshal operations, false otherwise
throws:
  JAXBException - if an error occurs while retrieving the validatingflag




setAdapter
public void setAdapter(XmlAdapter adapter)(Code)



setAdapter
public void setAdapter(Class<A> type, A adapter)(Code)



setAttachmentUnmarshaller
public void setAttachmentUnmarshaller(AttachmentUnmarshaller au)(Code)



setEventHandler
public void setEventHandler(ValidationEventHandler handler) throws JAXBException(Code)
Allow an application to register a validation event handler.

The validation event handler will be called by the JAXB Provider if any validation errors are encountered during calls to any of the unmarshal methods. If the client application does not register a validation event handler before invoking the unmarshal methods, then all validation events will be silently ignored and may result in unexpected behaviour.
Parameters:
  handler - the validation event handler
throws:
  JAXBException - if an error was encountered while setting theevent handler




setListener
public void setListener(Listener listener)(Code)



setProperty
public void setProperty(String name, Object value) throws PropertyException(Code)
Default implementation of the setProperty method always throws PropertyException since there are no required properties. If a provider needs to handle additional properties, it should override this method in a derived class.



setSchema
public void setSchema(Schema schema)(Code)



setValidating
public void setValidating(boolean validating) throws JAXBException(Code)
Specifies whether or not the Unmarshaller should validate during unmarshal operations. By default, the Unmarshaller does not validate.

This method may only be invoked before or after calling one of the unmarshal methods.
Parameters:
  validating - true if the Unmarshaller should validate duringunmarshal, false otherwise
throws:
  JAXBException - if an error occurred while enabling or disablingvalidation at unmarshal time




unmarshal
public Object unmarshal(Source source) throws JAXBException(Code)



unmarshal
abstract protected Object unmarshal(XMLReader reader, InputSource source) throws JAXBException(Code)
Unmarshals an object by using the specified XMLReader and the InputSource. The callee should call the setErrorHandler method of the XMLReader so that errors are passed to the client-specified ValidationEventHandler.



unmarshal
final public Object unmarshal(InputSource source) throws JAXBException(Code)



unmarshal
final public Object unmarshal(URL url) throws JAXBException(Code)



unmarshal
final public Object unmarshal(File f) throws JAXBException(Code)



unmarshal
final public Object unmarshal(java.io.InputStream is) throws JAXBException(Code)



unmarshal
final public Object unmarshal(Reader reader) throws JAXBException(Code)



unmarshal
public Object unmarshal(XMLEventReader reader) throws JAXBException(Code)



unmarshal
public Object unmarshal(XMLStreamReader reader) throws JAXBException(Code)



unmarshal
public JAXBElement<T> unmarshal(Node node, Class<T> expectedType) throws JAXBException(Code)



unmarshal
public JAXBElement<T> unmarshal(Source source, Class<T> expectedType) throws JAXBException(Code)



unmarshal
public JAXBElement<T> unmarshal(XMLStreamReader reader, Class<T> expectedType) throws JAXBException(Code)



unmarshal
public JAXBElement<T> unmarshal(XMLEventReader reader, Class<T> expectedType) throws JAXBException(Code)



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)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.