Java Doc for JAXB.java in  » 6.0-JDK-Modules » jaxb-api » javax » xml » bind » 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 api » javax.xml.bind 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javax.xml.bind.JAXB

JAXB
final public class JAXB (Code)
Class that defines convenience methods for common, simple use of JAXB.

Methods defined in this class are convenience methods that combine several basic operations in the JAXBContext , Unmarshaller , and Marshaller . They are designed to be the prefered methods for developers new to JAXB. They have the following characterstics:

  1. Generally speaking, the performance is not necessarily optimal. It is expected that people who need to write performance critical code will use the rest of the JAXB API directly.
  2. Errors that happen during the processing is wrapped into DataBindingException (which will have JAXBException as its Throwable.getCause cause . It is expected that people who prefer the checked exception would use the rest of the JAXB API directly.

In addition, the unmarshal methods have the following characteristic:

  1. Schema validation is not performed on the input XML. The processing will try to continue even if there are errors in the XML, as much as possible. Only as the last resort, this method fails with DataBindingException .

Similarly, the marshal methods have the following characteristic:

  1. The processing will try to continue even if the Java object tree does not meet the validity requirement. Only as the last resort, this method fails with DataBindingException .

All the methods on this class require non-null arguments to all parameters. The unmarshal methods either fail with an exception or return a non-null value.
author:
   Kohsuke Kawaguchi
since:
   2.1





Method Summary
public static  voidmarshal(Object jaxbObject, File xml)
     Writes a Java object tree to XML and store it to the specified location.
Parameters:
  jaxbObject - The Java object to be marshalled into XML.
public static  voidmarshal(Object jaxbObject, URL xml)
     Writes a Java object tree to XML and store it to the specified location.
Parameters:
  jaxbObject - The Java object to be marshalled into XML.
public static  voidmarshal(Object jaxbObject, URI xml)
     Writes a Java object tree to XML and store it to the specified location.
Parameters:
  jaxbObject - The Java object to be marshalled into XML.
public static  voidmarshal(Object jaxbObject, String xml)
     Writes a Java object tree to XML and store it to the specified location.
Parameters:
  jaxbObject - The Java object to be marshalled into XML.
public static  voidmarshal(Object jaxbObject, OutputStream xml)
     Writes a Java object tree to XML and store it to the specified location.
Parameters:
  jaxbObject - The Java object to be marshalled into XML.
public static  voidmarshal(Object jaxbObject, Writer xml)
     Writes a Java object tree to XML and store it to the specified location.
Parameters:
  jaxbObject - The Java object to be marshalled into XML.
public static  voidmarshal(Object jaxbObject, Result xml)
     Writes a Java object tree to XML and store it to the specified location.
Parameters:
  jaxbObject - The Java object to be marshalled into XML.
public static  Tunmarshal(File xml, Class<T> type)
     Reads in a Java object tree from the given XML input.
public static  Tunmarshal(URL xml, Class<T> type)
     Reads in a Java object tree from the given XML input.
public static  Tunmarshal(URI xml, Class<T> type)
     Reads in a Java object tree from the given XML input.
public static  Tunmarshal(String xml, Class<T> type)
     Reads in a Java object tree from the given XML input.
public static  Tunmarshal(InputStream xml, Class<T> type)
     Reads in a Java object tree from the given XML input.
public static  Tunmarshal(Reader xml, Class<T> type)
     Reads in a Java object tree from the given XML input.
public static  Tunmarshal(Source xml, Class<T> type)
     Reads in a Java object tree from the given XML input.



Method Detail
marshal
public static void marshal(Object jaxbObject, File xml)(Code)
Writes a Java object tree to XML and store it to the specified location.
Parameters:
  jaxbObject - The Java object to be marshalled into XML. If this object isa JAXBElement, it will provide the root tag name andthe body. If this object has XmlRootElementon its class definition, that will be used as the root tag nameand the given object will provide the body. Otherwise,the root tag name is Introspector.decapitalize(String) infered fromClass.getSimpleName the short class name.This parameter must not be null.
Parameters:
  xml - XML will be written to this file. If it already exists,it will be overwritten.
throws:
  DataBindingException - If the operation fails, such as due to I/O error, unbindable classes.



marshal
public static void marshal(Object jaxbObject, URL xml)(Code)
Writes a Java object tree to XML and store it to the specified location.
Parameters:
  jaxbObject - The Java object to be marshalled into XML. If this object isa JAXBElement, it will provide the root tag name andthe body. If this object has XmlRootElementon its class definition, that will be used as the root tag nameand the given object will provide the body. Otherwise,the root tag name is Introspector.decapitalize(String) infered fromClass.getSimpleName the short class name.This parameter must not be null.
Parameters:
  xml - The XML will be URLConnection.getOutputStream sent to theresource pointed by this URL. Note that not all URLs supportsuch operation, and exact semantics depends on the URLimplementations. In case of HttpURLConnection HTTP URLs,this will perform HTTP POST.
throws:
  DataBindingException - If the operation fails, such as due to I/O error, unbindable classes.



marshal
public static void marshal(Object jaxbObject, URI xml)(Code)
Writes a Java object tree to XML and store it to the specified location.
Parameters:
  jaxbObject - The Java object to be marshalled into XML. If this object isa JAXBElement, it will provide the root tag name andthe body. If this object has XmlRootElementon its class definition, that will be used as the root tag nameand the given object will provide the body. Otherwise,the root tag name is Introspector.decapitalize(String) infered fromClass.getSimpleName the short class name.This parameter must not be null.
Parameters:
  xml - The URI is URI.toURL turned into URL and thenfollows the handling of URL. See above.
throws:
  DataBindingException - If the operation fails, such as due to I/O error, unbindable classes.



marshal
public static void marshal(Object jaxbObject, String xml)(Code)
Writes a Java object tree to XML and store it to the specified location.
Parameters:
  jaxbObject - The Java object to be marshalled into XML. If this object isa JAXBElement, it will provide the root tag name andthe body. If this object has XmlRootElementon its class definition, that will be used as the root tag nameand the given object will provide the body. Otherwise,the root tag name is Introspector.decapitalize(String) infered fromClass.getSimpleName the short class name.This parameter must not be null.
Parameters:
  xml - The string is first interpreted as an absolute URI.If it's not URI.isAbsolute a valid absolute URI,then it's interpreted as a File
throws:
  DataBindingException - If the operation fails, such as due to I/O error, unbindable classes.



marshal
public static void marshal(Object jaxbObject, OutputStream xml)(Code)
Writes a Java object tree to XML and store it to the specified location.
Parameters:
  jaxbObject - The Java object to be marshalled into XML. If this object isa JAXBElement, it will provide the root tag name andthe body. If this object has XmlRootElementon its class definition, that will be used as the root tag nameand the given object will provide the body. Otherwise,the root tag name is Introspector.decapitalize(String) infered fromClass.getSimpleName the short class name.This parameter must not be null.
Parameters:
  xml - The XML will be sent to the given OutputStream.Upon a successful completion, the stream will be closed by this method.
throws:
  DataBindingException - If the operation fails, such as due to I/O error, unbindable classes.



marshal
public static void marshal(Object jaxbObject, Writer xml)(Code)
Writes a Java object tree to XML and store it to the specified location.
Parameters:
  jaxbObject - The Java object to be marshalled into XML. If this object isa JAXBElement, it will provide the root tag name andthe body. If this object has XmlRootElementon its class definition, that will be used as the root tag nameand the given object will provide the body. Otherwise,the root tag name is Introspector.decapitalize(String) infered fromClass.getSimpleName the short class name.This parameter must not be null.
Parameters:
  xml - The XML will be sent as a character stream to the given Writer.Upon a successful completion, the stream will be closed by this method.
throws:
  DataBindingException - If the operation fails, such as due to I/O error, unbindable classes.



marshal
public static void marshal(Object jaxbObject, Result xml)(Code)
Writes a Java object tree to XML and store it to the specified location.
Parameters:
  jaxbObject - The Java object to be marshalled into XML. If this object isa JAXBElement, it will provide the root tag name andthe body. If this object has XmlRootElementon its class definition, that will be used as the root tag nameand the given object will provide the body. Otherwise,the root tag name is Introspector.decapitalize(String) infered fromClass.getSimpleName the short class name.This parameter must not be null.
Parameters:
  xml - The XML will be sent to the Result object.
throws:
  DataBindingException - If the operation fails, such as due to I/O error, unbindable classes.



unmarshal
public static T unmarshal(File xml, Class<T> type)(Code)
Reads in a Java object tree from the given XML input.
Parameters:
  xml - Reads the entire file as XML.



unmarshal
public static T unmarshal(URL xml, Class<T> type)(Code)
Reads in a Java object tree from the given XML input.
Parameters:
  xml - The resource pointed by the URL is read in its entirety.



unmarshal
public static T unmarshal(URI xml, Class<T> type)(Code)
Reads in a Java object tree from the given XML input.
Parameters:
  xml - The URI is URI.toURL turned into URL and thenfollows the handling of URL.



unmarshal
public static T unmarshal(String xml, Class<T> type)(Code)
Reads in a Java object tree from the given XML input.
Parameters:
  xml - The string is first interpreted as an absolute URI.If it's not URI.isAbsolute a valid absolute URI,then it's interpreted as a File



unmarshal
public static T unmarshal(InputStream xml, Class<T> type)(Code)
Reads in a Java object tree from the given XML input.
Parameters:
  xml - The entire stream is read as an XML infoset.Upon a successful completion, the stream will be closed by this method.



unmarshal
public static T unmarshal(Reader xml, Class<T> type)(Code)
Reads in a Java object tree from the given XML input.
Parameters:
  xml - The character stream is read as an XML infoset.The encoding declaration in the XML will be ignored.Upon a successful completion, the stream will be closed by this method.



unmarshal
public static T unmarshal(Source xml, Class<T> type)(Code)
Reads in a Java object tree from the given XML input.
Parameters:
  xml - The XML infoset that the Source represents is read.



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.