< prev index next >
src/java.xml.bind/share/classes/javax/xml/bind/JAXB.java
Print this page
*** 66,96 ****
* people who prefer the checked exception would use
* the rest of the JAXB API directly.
* </ol>
*
* <p>
! * In addition, the <tt>unmarshal</tt> methods have the following characteristic:
*
* <ol>
* <li>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 {@link DataBindingException}.
* </ol>
*
* <p>
! * Similarly, the <tt>marshal</tt> methods have the following characteristic:
* <ol>
* <li>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 {@link DataBindingException}.
* </ol>
*
*
* <p>
* All the methods on this class require non-null arguments to all parameters.
! * The <tt>unmarshal</tt> methods either fail with an exception or return
* a non-null value.
*
* @author Kohsuke Kawaguchi
* @since 1.6, JAXB 2.1
*/
--- 66,96 ----
* people who prefer the checked exception would use
* the rest of the JAXB API directly.
* </ol>
*
* <p>
! * In addition, the {@code unmarshal} methods have the following characteristic:
*
* <ol>
* <li>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 {@link DataBindingException}.
* </ol>
*
* <p>
! * Similarly, the {@code marshal} methods have the following characteristic:
* <ol>
* <li>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 {@link DataBindingException}.
* </ol>
*
*
* <p>
* All the methods on this class require non-null arguments to all parameters.
! * The {@code unmarshal} methods either fail with an exception or return
* a non-null value.
*
* @author Kohsuke Kawaguchi
* @since 1.6, JAXB 2.1
*/
*** 177,187 ****
/**
* Reads in a Java object tree from the given XML input.
*
* @param xml
* The URI is {@link URI#toURL() turned into URL} and then
! * follows the handling of <tt>URL</tt>.
*/
public static <T> T unmarshal( URI xml, Class<T> type ) {
try {
JAXBElement<T> item = getContext(type).createUnmarshaller().unmarshal(toSource(xml), type);
return item.getValue();
--- 177,187 ----
/**
* Reads in a Java object tree from the given XML input.
*
* @param xml
* The URI is {@link URI#toURL() turned into URL} and then
! * follows the handling of {@code URL}.
*/
public static <T> T unmarshal( URI xml, Class<T> type ) {
try {
JAXBElement<T> item = getContext(type).createUnmarshaller().unmarshal(toSource(xml), type);
return item.getValue();
*** 194,206 ****
/**
* Reads in a Java object tree from the given XML input.
*
* @param xml
! * The string is first interpreted as an absolute <tt>URI</tt>.
* If it's not {@link URI#isAbsolute() a valid absolute URI},
! * then it's interpreted as a <tt>File</tt>
*/
public static <T> T unmarshal( String xml, Class<T> type ) {
try {
JAXBElement<T> item = getContext(type).createUnmarshaller().unmarshal(toSource(xml), type);
return item.getValue();
--- 194,206 ----
/**
* Reads in a Java object tree from the given XML input.
*
* @param xml
! * The string is first interpreted as an absolute {@code URI}.
* If it's not {@link URI#isAbsolute() a valid absolute URI},
! * then it's interpreted as a {@code File}
*/
public static <T> T unmarshal( String xml, Class<T> type ) {
try {
JAXBElement<T> item = getContext(type).createUnmarshaller().unmarshal(toSource(xml), type);
return item.getValue();
*** 345,356 ****
* {@link Class#getSimpleName() the short class name}.
* This parameter must not be null.
*
* @param xml
* The XML will be {@link URLConnection#getOutputStream() sent} to the
! * resource pointed by this URL. Note that not all <tt>URL</tt>s support
! * such operation, and exact semantics depends on the <tt>URL</tt>
* implementations. In case of {@link HttpURLConnection HTTP URLs},
* this will perform HTTP POST.
*
* @throws DataBindingException
* If the operation fails, such as due to I/O error, unbindable classes.
--- 345,356 ----
* {@link Class#getSimpleName() the short class name}.
* This parameter must not be null.
*
* @param xml
* The XML will be {@link URLConnection#getOutputStream() sent} to the
! * resource pointed by this URL. Note that not all {@code URL}s support
! * such operation, and exact semantics depends on the {@code URL}
* implementations. In case of {@link HttpURLConnection HTTP URLs},
* this will perform HTTP POST.
*
* @throws DataBindingException
* If the operation fails, such as due to I/O error, unbindable classes.
*** 372,382 ****
* {@link Class#getSimpleName() the short class name}.
* This parameter must not be null.
*
* @param xml
* The URI is {@link URI#toURL() turned into URL} and then
! * follows the handling of <tt>URL</tt>. See above.
*
* @throws DataBindingException
* If the operation fails, such as due to I/O error, unbindable classes.
*/
public static void marshal( Object jaxbObject, URI xml ) {
--- 372,382 ----
* {@link Class#getSimpleName() the short class name}.
* This parameter must not be null.
*
* @param xml
* The URI is {@link URI#toURL() turned into URL} and then
! * follows the handling of {@code URL}. See above.
*
* @throws DataBindingException
* If the operation fails, such as due to I/O error, unbindable classes.
*/
public static void marshal( Object jaxbObject, URI xml ) {
*** 395,407 ****
* the root tag name is {@link Introspector#decapitalize(String) infered} from
* {@link Class#getSimpleName() the short class name}.
* This parameter must not be null.
*
* @param xml
! * The string is first interpreted as an absolute <tt>URI</tt>.
* If it's not {@link URI#isAbsolute() a valid absolute URI},
! * then it's interpreted as a <tt>File</tt>
*
* @throws DataBindingException
* If the operation fails, such as due to I/O error, unbindable classes.
*/
public static void marshal( Object jaxbObject, String xml ) {
--- 395,407 ----
* the root tag name is {@link Introspector#decapitalize(String) infered} from
* {@link Class#getSimpleName() the short class name}.
* This parameter must not be null.
*
* @param xml
! * The string is first interpreted as an absolute {@code URI}.
* If it's not {@link URI#isAbsolute() a valid absolute URI},
! * then it's interpreted as a {@code File}
*
* @throws DataBindingException
* If the operation fails, such as due to I/O error, unbindable classes.
*/
public static void marshal( Object jaxbObject, String xml ) {
*** 520,542 ****
* <td>XML will be written to this file. If it already exists,
* it will be overwritten.</td>
* </tr><tr>
* <td>{@link URL}</td>
* <td>The XML will be {@link URLConnection#getOutputStream() sent} to the
! * resource pointed by this URL. Note that not all <tt>URL</tt>s support
! * such operation, and exact semantics depends on the <tt>URL</tt>
* implementations. In case of {@link HttpURLConnection HTTP URLs},
* this will perform HTTP POST.</td>
* </tr><tr>
* <td>{@link URI}</td>
* <td>The URI is {@link URI#toURL() turned into URL} and then
! * follows the handling of <tt>URL</tt>. See above.</td>
* </tr><tr>
* <td>{@link String}</td>
! * <td>The string is first interpreted as an absolute <tt>URI</tt>.
* If it's not {@link URI#isAbsolute() a valid absolute URI},
! * then it's interpreted as a <tt>File</tt></td>
* </tr><tr>
* <td>{@link OutputStream}</td>
* <td>The XML will be sent to the given {@link OutputStream}.
* Upon a successful completion, the stream will be closed by this method.</td>
* </tr><tr>
--- 520,542 ----
* <td>XML will be written to this file. If it already exists,
* it will be overwritten.</td>
* </tr><tr>
* <td>{@link URL}</td>
* <td>The XML will be {@link URLConnection#getOutputStream() sent} to the
! * resource pointed by this URL. Note that not all {@code URL}s support
! * such operation, and exact semantics depends on the {@code URL}
* implementations. In case of {@link HttpURLConnection HTTP URLs},
* this will perform HTTP POST.</td>
* </tr><tr>
* <td>{@link URI}</td>
* <td>The URI is {@link URI#toURL() turned into URL} and then
! * follows the handling of {@code URL}. See above.</td>
* </tr><tr>
* <td>{@link String}</td>
! * <td>The string is first interpreted as an absolute {@code URI}.
* If it's not {@link URI#isAbsolute() a valid absolute URI},
! * then it's interpreted as a {@code File}</td>
* </tr><tr>
* <td>{@link OutputStream}</td>
* <td>The XML will be sent to the given {@link OutputStream}.
* Upon a successful completion, the stream will be closed by this method.</td>
* </tr><tr>
< prev index next >