| <!DOCTYPE HTML> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc (11.0.2) on Wed Apr 22 10:19:16 CDT 2020 --> |
| <title>Marshaller (EclipseLink 3.0.0, API Reference)</title> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <meta name="dc.created" content="2020-04-22"> |
| <link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style"> |
| <link rel="stylesheet" type="text/css" href="../../../jquery/jquery-ui.css" title="Style"> |
| <script type="text/javascript" src="../../../script.js"></script> |
| <script type="text/javascript" src="../../../jquery/jszip/dist/jszip.min.js"></script> |
| <script type="text/javascript" src="../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script> |
| <!--[if IE]> |
| <script type="text/javascript" src="../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script> |
| <![endif]--> |
| <script type="text/javascript" src="../../../jquery/jquery-3.3.1.js"></script> |
| <script type="text/javascript" src="../../../jquery/jquery-migrate-3.0.1.js"></script> |
| <script type="text/javascript" src="../../../jquery/jquery-ui.js"></script> |
| </head> |
| <body> |
| <script type="text/javascript"><!-- |
| try { |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="Marshaller (EclipseLink 3.0.0, API Reference)"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| var data = {"i0":6,"i1":6,"i2":6,"i3":6,"i4":6,"i5":6,"i6":6,"i7":6,"i8":6,"i9":6,"i10":6,"i11":6,"i12":6,"i13":6,"i14":6,"i15":6,"i16":6,"i17":6,"i18":6,"i19":6,"i20":6,"i21":6}; |
| var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"]}; |
| var altColor = "altColor"; |
| var rowColor = "rowColor"; |
| var tableTab = "tableTab"; |
| var activeTableTab = "activeTableTab"; |
| var pathtoroot = "../../../"; |
| var useModuleDirectories = true; |
| loadScripts(document, 'script');</script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <header role="banner"> |
| <nav role="navigation"> |
| <div class="fixedNav"> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="topNav"><a id="navbar.top"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> |
| <a id="navbar.top.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../index.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../index-all.html">Index</a></li> |
| <li><a href="../../../help-doc.html">Help</a></li> |
| </ul> |
| <div class="aboutLanguage">EclipseLink 3.0.0, API Reference</div> |
| </div> |
| <div class="subNav"> |
| <ul class="navList" id="allclasses_navbar_top"> |
| <li><a href="../../../allclasses.html">All Classes</a></li> |
| </ul> |
| <ul class="navListSearch"> |
| <li><label for="search">SEARCH:</label> |
| <input type="text" id="search" value="search" disabled="disabled"> |
| <input type="reset" id="reset" value="reset" disabled="disabled"> |
| </li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_top"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li><a href="#nested.class.summary">Nested</a> | </li> |
| <li><a href="#field.summary">Field</a> | </li> |
| <li>Constr | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li><a href="#field.detail">Field</a> | </li> |
| <li>Constr | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a id="skip.navbar.top"> |
| <!-- --> |
| </a></div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| </div> |
| <div class="navPadding"> </div> |
| <script type="text/javascript"><!-- |
| $('.navPadding').css('padding-top', $('.fixedNav').css("height")); |
| //--> |
| </script> |
| </nav> |
| </header> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <main role="main"> |
| <div class="header"> |
| <div class="subTitle"><span class="packageLabelInType">Package</span> <a href="package-summary.html">jakarta.xml.bind</a></div> |
| <h2 title="Interface Marshaller" class="title">Interface Marshaller</h2> |
| </div> |
| <div class="contentContainer"> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <dl> |
| <dt>All Known Implementing Classes:</dt> |
| <dd><code><a href="helpers/AbstractMarshallerImpl.html" title="class in jakarta.xml.bind.helpers">AbstractMarshallerImpl</a></code>, <code><a href="../../../org/eclipse/persistence/jaxb/JAXBMarshaller.html" title="class in org.eclipse.persistence.jaxb">JAXBMarshaller</a></code></dd> |
| </dl> |
| <hr> |
| <pre>public interface <span class="typeNameLabel">Marshaller</span></pre> |
| <div class="block"><p> |
| The <code>Marshaller</code> class is responsible for governing the process |
| of serializing Java content trees back into XML data. It provides the basic |
| marshalling methods: |
| |
| <p> |
| <i>Assume the following setup code for all following code fragments:</i> |
| <blockquote> |
| <pre> |
| JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" ); |
| Unmarshaller u = jc.createUnmarshaller(); |
| Object element = u.unmarshal( new File( "foo.xml" ) ); |
| Marshaller m = jc.createMarshaller(); |
| </pre> |
| </blockquote> |
| |
| <p> |
| Marshalling to a File: |
| <blockquote> |
| <pre> |
| OutputStream os = new FileOutputStream( "nosferatu.xml" ); |
| m.marshal( element, os ); |
| </pre> |
| </blockquote> |
| |
| <p> |
| Marshalling to a SAX ContentHandler: |
| <blockquote> |
| <pre> |
| // assume MyContentHandler instanceof ContentHandler |
| m.marshal( element, new MyContentHandler() ); |
| </pre> |
| </blockquote> |
| |
| <p> |
| Marshalling to a DOM Node: |
| <blockquote> |
| <pre> |
| DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); |
| dbf.setNamespaceAware(true); |
| DocumentBuilder db = dbf.newDocumentBuilder(); |
| Document doc = db.newDocument(); |
| |
| m.marshal( element, doc ); |
| </pre> |
| </blockquote> |
| |
| <p> |
| Marshalling to a java.io.OutputStream: |
| <blockquote> |
| <pre> |
| m.marshal( element, System.out ); |
| </pre> |
| </blockquote> |
| |
| <p> |
| Marshalling to a java.io.Writer: |
| <blockquote> |
| <pre> |
| m.marshal( element, new PrintWriter( System.out ) ); |
| </pre> |
| </blockquote> |
| |
| <p> |
| Marshalling to a javax.xml.transform.SAXResult: |
| <blockquote> |
| <pre> |
| // assume MyContentHandler instanceof ContentHandler |
| SAXResult result = new SAXResult( new MyContentHandler() ); |
| |
| m.marshal( element, result ); |
| </pre> |
| </blockquote> |
| |
| <p> |
| Marshalling to a javax.xml.transform.DOMResult: |
| <blockquote> |
| <pre> |
| DOMResult result = new DOMResult(); |
| |
| m.marshal( element, result ); |
| </pre> |
| </blockquote> |
| |
| <p> |
| Marshalling to a javax.xml.transform.StreamResult: |
| <blockquote> |
| <pre> |
| StreamResult result = new StreamResult( System.out ); |
| |
| m.marshal( element, result ); |
| </pre> |
| </blockquote> |
| |
| <p> |
| Marshalling to a javax.xml.stream.XMLStreamWriter: |
| <blockquote> |
| <pre> |
| XMLStreamWriter xmlStreamWriter = |
| XMLOutputFactory.newInstance().createXMLStreamWriter( ... ); |
| |
| m.marshal( element, xmlStreamWriter ); |
| </pre> |
| </blockquote> |
| |
| <p> |
| Marshalling to a javax.xml.stream.XMLEventWriter: |
| <blockquote> |
| <pre> |
| XMLEventWriter xmlEventWriter = |
| XMLOutputFactory.newInstance().createXMLEventWriter( ... ); |
| |
| m.marshal( element, xmlEventWriter ); |
| </pre> |
| </blockquote> |
| |
| <p> |
| <a id="elementMarshalling"></a> |
| <b>Marshalling content tree rooted by a JAXB element</b><br> |
| <blockquote> |
| The first parameter of the overloaded |
| <code>Marshaller.marshal(java.lang.Object, ...)</code> methods must be a |
| JAXB element as computed by |
| <a href="JAXBIntrospector.html#isElement(java.lang.Object)"><code>JAXBIntrospector.isElement(java.lang.Object)</code></a>; |
| otherwise, a <code>Marshaller.marshal</code> method must throw a |
| <a href="MarshalException.html" title="class in jakarta.xml.bind"><code>MarshalException</code></a>. There exist two mechanisms |
| to enable marshalling an instance that is not a JAXB element. |
| One method is to wrap the instance as a value of a <a href="JAXBElement.html" title="class in jakarta.xml.bind"><code>JAXBElement</code></a>, |
| and pass the wrapper element as the first parameter to |
| a <code>Marshaller.marshal</code> method. For java to schema binding, it |
| is also possible to simply annotate the instance's class with |
| @<a href="annotation/XmlRootElement.html" title="annotation in jakarta.xml.bind.annotation"><code>XmlRootElement</code></a>. |
| </blockquote> |
| |
| <p> |
| <b>Encoding</b><br> |
| <blockquote> |
| By default, the Marshaller will use UTF-8 encoding when generating XML data |
| to a <code>java.io.OutputStream</code>, or a <code>java.io.Writer</code>. Use the |
| <a href="#setProperty(java.lang.String,java.lang.Object)"><code>setProperty</code></a> API to change the output |
| encoding used during these marshal operations. Client applications are |
| expected to supply a valid character encoding name as defined in the |
| <a href="http://www.w3.org/TR/2000/REC-xml-20001006#charencoding">W3C XML 1.0 |
| Recommendation</a> and supported by your Java Platform. |
| </blockquote> |
| |
| <p> |
| <b>Validation and Well-Formedness</b><br> |
| <blockquote> |
| <p> |
| Client applications are not required to validate the Java content tree prior |
| to calling any of the marshal API's. Furthermore, there is no requirement |
| that the Java content tree be valid with respect to its original schema in |
| order to marshal it back into XML data. Different JAXB Providers will |
| support marshalling invalid Java content trees at varying levels, however |
| all JAXB Providers must be able to marshal a valid content tree back to |
| XML data. A JAXB Provider must throw a <code>MarshalException</code> when it |
| is unable to complete the marshal operation due to invalid content. Some |
| JAXB Providers will fully allow marshalling invalid content, others will fail |
| on the first validation error. |
| <p> |
| Even when schema validation is not explictly enabled for the marshal operation, |
| it is possible that certain types of validation events will be detected |
| during the operation. Validation events will be reported to the registered |
| event handler. If the client application has not registered an event handler |
| prior to invoking one of the marshal API's, then events will be delivered to |
| a default event handler which will terminate the marshal operation after |
| encountering the first error or fatal error. Note that for JAXB 2.0 and |
| later versions, <a href="helpers/DefaultValidationEventHandler.html" title="class in jakarta.xml.bind.helpers"><code>DefaultValidationEventHandler</code></a> is |
| no longer used. |
| |
| </blockquote> |
| |
| <p> |
| <a id="supportedProps"></a> |
| <b>Supported Properties</b><br> |
| <blockquote> |
| <p> |
| All JAXB Providers are required to support the following set of properties. |
| Some providers may support additional properties. |
| <dl> |
| <dt><code>jaxb.encoding</code> - value must be a java.lang.String</dt> |
| <dd>The output encoding to use when marshalling the XML data. The |
| Marshaller will use "UTF-8" by default if this property is not |
| specified.</dd> |
| <dt><code>jaxb.formatted.output</code> - value must be a java.lang.Boolean</dt> |
| <dd>This property controls whether or not the Marshaller will format |
| the resulting XML data with line breaks and indentation. A |
| true value for this property indicates human readable indented |
| xml data, while a false value indicates unformatted xml data. |
| The Marshaller will default to false (unformatted) if this |
| property is not specified.</dd> |
| <dt><code>jaxb.schemaLocation</code> - value must be a java.lang.String</dt> |
| <dd>This property allows the client application to specify an |
| xsi:schemaLocation attribute in the generated XML data. The format of |
| the schemaLocation attribute value is discussed in an easy to |
| understand, non-normative form in |
| <a href="http://www.w3.org/TR/xmlschema-0/#schemaLocation">Section 5.6 |
| of the W3C XML Schema Part 0: Primer</a> and specified in |
| <a href="http://www.w3.org/TR/xmlschema-1/#Instance_Document_Constructions"> |
| Section 2.6 of the W3C XML Schema Part 1: Structures</a>.</dd> |
| <dt><code>jaxb.noNamespaceSchemaLocation</code> - value must be a java.lang.String</dt> |
| <dd>This property allows the client application to specify an |
| xsi:noNamespaceSchemaLocation attribute in the generated XML |
| data. The format of the schemaLocation attribute value is discussed in |
| an easy to understand, non-normative form in |
| <a href="http://www.w3.org/TR/xmlschema-0/#schemaLocation">Section 5.6 |
| of the W3C XML Schema Part 0: Primer</a> and specified in |
| <a href="http://www.w3.org/TR/xmlschema-1/#Instance_Document_Constructions"> |
| Section 2.6 of the W3C XML Schema Part 1: Structures</a>.</dd> |
| <dt><code>jaxb.fragment</code> - value must be a java.lang.Boolean</dt> |
| <dd>This property determines whether or not document level events will be |
| generated by the Marshaller. If the property is not specified, the |
| default is <code>false</code>. This property has different implications depending |
| on which marshal api you are using - when this property is set to true:<br> |
| <ul> |
| <li><a href="#marshal(java.lang.Object,org.xml.sax.ContentHandler)"><code>marshal(Object,ContentHandler)</code></a> - the Marshaller won't |
| invoke <a href="https://docs.oracle.com/javase/8/docs/api/org/xml/sax/ContentHandler.html?is-external=true#startDocument()" title="class or interface in org.xml.sax" class="externalLink"><code>ContentHandler.startDocument()</code></a> and |
| <a href="https://docs.oracle.com/javase/8/docs/api/org/xml/sax/ContentHandler.html?is-external=true#endDocument()" title="class or interface in org.xml.sax" class="externalLink"><code>ContentHandler.endDocument()</code></a>.</li> |
| <li><a href="#marshal(java.lang.Object,org.w3c.dom.Node)"><code>marshal(Object,Node)</code></a> - the property has no effect on this |
| API.</li> |
| <li><a href="#marshal(java.lang.Object,java.io.OutputStream)"><code>marshal(Object,OutputStream)</code></a> - the Marshaller won't |
| generate an xml declaration.</li> |
| <li><a href="#marshal(java.lang.Object,java.io.Writer)"><code>marshal(Object,Writer)</code></a> - the Marshaller won't |
| generate an xml declaration.</li> |
| <li><a href="#marshal(java.lang.Object,javax.xml.transform.Result)"><code>marshal(Object,Result)</code></a> - depends on the kind of |
| Result object, see semantics for Node, ContentHandler, and Stream APIs</li> |
| <li><a href="#marshal(java.lang.Object,javax.xml.stream.XMLEventWriter)"><code>marshal(Object,XMLEventWriter)</code></a> - the |
| Marshaller will not generate <a href="https://docs.oracle.com/javase/8/docs/api/javax/xml/stream/XMLStreamConstants.html?is-external=true#START_DOCUMENT" title="class or interface in javax.xml.stream" class="externalLink"><code>XMLStreamConstants.START_DOCUMENT</code></a> and |
| <a href="https://docs.oracle.com/javase/8/docs/api/javax/xml/stream/XMLStreamConstants.html?is-external=true#END_DOCUMENT" title="class or interface in javax.xml.stream" class="externalLink"><code>XMLStreamConstants.END_DOCUMENT</code></a> events.</li> |
| <li><a href="#marshal(java.lang.Object,javax.xml.stream.XMLStreamWriter)"><code>marshal(Object,XMLStreamWriter)</code></a> - the |
| Marshaller will not generate <a href="https://docs.oracle.com/javase/8/docs/api/javax/xml/stream/XMLStreamConstants.html?is-external=true#START_DOCUMENT" title="class or interface in javax.xml.stream" class="externalLink"><code>XMLStreamConstants.START_DOCUMENT</code></a> and |
| <a href="https://docs.oracle.com/javase/8/docs/api/javax/xml/stream/XMLStreamConstants.html?is-external=true#END_DOCUMENT" title="class or interface in javax.xml.stream" class="externalLink"><code>XMLStreamConstants.END_DOCUMENT</code></a> events.</li> |
| </ul> |
| </dd> |
| </dl> |
| </blockquote> |
| |
| <p> |
| <a id="marshalEventCallback"></a> |
| <b>Marshal Event Callbacks</b><br> |
| <blockquote> |
| "The <a href="Marshaller.html" title="interface in jakarta.xml.bind"><code>Marshaller</code></a> provides two styles of callback mechanisms |
| that allow application specific processing during key points in the |
| unmarshalling process. In 'class defined' event callbacks, application |
| specific code placed in JAXB mapped classes is triggered during |
| marshalling. 'External listeners' allow for centralized processing |
| of marshal events in one callback method rather than by type event callbacks. |
| |
| <p> |
| Class defined event callback methods allow any JAXB mapped class to specify |
| its own specific callback methods by defining methods with the following method signatures: |
| <blockquote> |
| <pre> |
| // Invoked by Marshaller after it has created an instance of this object. |
| boolean beforeMarshal(Marshaller); |
| |
| // Invoked by Marshaller after it has marshalled all properties of this object. |
| void afterMarshal(Marshaller); |
| </pre> |
| </blockquote> |
| The class defined event callback methods should be used when the callback method requires |
| access to non-public methods and/or fields of the class. |
| <p> |
| The external listener callback mechanism enables the registration of a <a href="Marshaller.Listener.html" title="class in jakarta.xml.bind"><code>Marshaller.Listener</code></a> |
| instance with a <a href="#setListener(jakarta.xml.bind.Marshaller.Listener)"><code>setListener(Listener)</code></a>. The external listener receives all callback events, |
| allowing for more centralized processing than per class defined callback methods. |
| <p> |
| The 'class defined' and external listener event callback methods are independent of each other, |
| both can be called for one event. The invocation ordering when both listener callback methods exist is |
| defined in <a href="Marshaller.Listener.html#beforeMarshal(java.lang.Object)"><code>Marshaller.Listener.beforeMarshal(Object)</code></a> and <a href="Marshaller.Listener.html#afterMarshal(java.lang.Object)"><code>Marshaller.Listener.afterMarshal(Object)</code></a>. |
| <p> |
| An event callback method throwing an exception terminates the current marshal process. |
| </blockquote></div> |
| <dl> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="JAXBContext.html" title="class in jakarta.xml.bind"><code>JAXBContext</code></a>, |
| <a href="Validator.html" title="interface in jakarta.xml.bind"><code>Validator</code></a>, |
| <a href="Unmarshaller.html" title="interface in jakarta.xml.bind"><code>Unmarshaller</code></a></dd> |
| <dt><span class="simpleTagLabel">Author:</span></dt> |
| <dd><ul><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul></dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>1.6, JAXB 1.0</dd> |
| </dl> |
| </li> |
| </ul> |
| </div> |
| <div class="summary"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ======== NESTED CLASS SUMMARY ======== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="nested.class.summary"> |
| <!-- --> |
| </a> |
| <h3>Nested Class Summary</h3> |
| <table class="memberSummary"> |
| <caption><span>Nested Classes</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colSecond" scope="col">Interface</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>static class </code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="Marshaller.Listener.html" title="class in jakarta.xml.bind">Marshaller.Listener</a></span></code></th> |
| <td class="colLast"> |
| <div class="block"> |
| Register an instance of an implementation of this class with a <a href="Marshaller.html" title="interface in jakarta.xml.bind"><code>Marshaller</code></a> to externally listen |
| for marshal events.</div> |
| </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| </section> |
| <!-- =========== FIELD SUMMARY =========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="field.summary"> |
| <!-- --> |
| </a> |
| <h3>Field Summary</h3> |
| <table class="memberSummary"> |
| <caption><span>Fields</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colSecond" scope="col">Field</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#JAXB_ENCODING">JAXB_ENCODING</a></span></code></th> |
| <td class="colLast"> |
| <div class="block">The name of the property used to specify the output encoding in |
| the marshalled XML data.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#JAXB_FORMATTED_OUTPUT">JAXB_FORMATTED_OUTPUT</a></span></code></th> |
| <td class="colLast"> |
| <div class="block">The name of the property used to specify whether or not the marshalled |
| XML data is formatted with linefeeds and indentation.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#JAXB_FRAGMENT">JAXB_FRAGMENT</a></span></code></th> |
| <td class="colLast"> |
| <div class="block">The name of the property used to specify whether or not the marshaller |
| will generate document level events (ie calling startDocument or endDocument).</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#JAXB_NO_NAMESPACE_SCHEMA_LOCATION">JAXB_NO_NAMESPACE_SCHEMA_LOCATION</a></span></code></th> |
| <td class="colLast"> |
| <div class="block">The name of the property used to specify the |
| xsi:noNamespaceSchemaLocation attribute value to place in the marshalled |
| XML output.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#JAXB_SCHEMA_LOCATION">JAXB_SCHEMA_LOCATION</a></span></code></th> |
| <td class="colLast"> |
| <div class="block">The name of the property used to specify the xsi:schemaLocation |
| attribute value to place in the marshalled XML output.</div> |
| </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| </section> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="method.summary"> |
| <!-- --> |
| </a> |
| <h3>Method Summary</h3> |
| <table class="memberSummary"> |
| <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd"> </span></span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colSecond" scope="col">Method</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr id="i0" class="altColor"> |
| <td class="colFirst"><code><A extends <a href="annotation/adapters/XmlAdapter.html" title="class in jakarta.xml.bind.annotation.adapters">XmlAdapter</a>><br>A</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getAdapter(java.lang.Class)">getAdapter</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang" class="externalLink">Class</a><A> type)</code></th> |
| <td class="colLast"> |
| <div class="block">Gets the adapter associated with the specified type.</div> |
| </td> |
| </tr> |
| <tr id="i1" class="rowColor"> |
| <td class="colFirst"><code><a href="attachment/AttachmentMarshaller.html" title="class in jakarta.xml.bind.attachment">AttachmentMarshaller</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getAttachmentMarshaller()">getAttachmentMarshaller</a></span>()</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i2" class="altColor"> |
| <td class="colFirst"><code><a href="ValidationEventHandler.html" title="interface in jakarta.xml.bind">ValidationEventHandler</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getEventHandler()">getEventHandler</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Return the current event handler or the default event handler if one |
| hasn't been set.</div> |
| </td> |
| </tr> |
| <tr id="i3" class="rowColor"> |
| <td class="colFirst"><code><a href="Marshaller.Listener.html" title="class in jakarta.xml.bind">Marshaller.Listener</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getListener()">getListener</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Return <a href="Marshaller.Listener.html" title="class in jakarta.xml.bind"><code>Marshaller.Listener</code></a> registered with this <a href="Marshaller.html" title="interface in jakarta.xml.bind"><code>Marshaller</code></a>.</div> |
| </td> |
| </tr> |
| <tr id="i4" class="altColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom" class="externalLink">Node</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getNode(java.lang.Object)">getNode</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a> contentTree)</code></th> |
| <td class="colLast"> |
| <div class="block">Get a DOM tree view of the content tree(Optional).</div> |
| </td> |
| </tr> |
| <tr id="i5" class="rowColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getProperty(java.lang.String)">getProperty</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> name)</code></th> |
| <td class="colLast"> |
| <div class="block">Get the particular property in the underlying implementation of |
| <code>Marshaller</code>.</div> |
| </td> |
| </tr> |
| <tr id="i6" class="altColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/javax/xml/validation/Schema.html?is-external=true" title="class or interface in javax.xml.validation" class="externalLink">Schema</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getSchema()">getSchema</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Get the JAXP 1.3 <a href="https://docs.oracle.com/javase/8/docs/api/javax/xml/validation/Schema.html?is-external=true" title="class or interface in javax.xml.validation" class="externalLink"><code>Schema</code></a> object |
| being used to perform marshal-time validation.</div> |
| </td> |
| </tr> |
| <tr id="i7" class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#marshal(java.lang.Object,java.io.File)">marshal</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a> jaxbElement, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io" class="externalLink">File</a> output)</code></th> |
| <td class="colLast"> |
| <div class="block">Marshal the content tree rooted at <code>jaxbElement</code> into a file.</div> |
| </td> |
| </tr> |
| <tr id="i8" class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#marshal(java.lang.Object,java.io.OutputStream)">marshal</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a> jaxbElement, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io" class="externalLink">OutputStream</a> os)</code></th> |
| <td class="colLast"> |
| <div class="block">Marshal the content tree rooted at <code>jaxbElement</code> into an output stream.</div> |
| </td> |
| </tr> |
| <tr id="i9" class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#marshal(java.lang.Object,java.io.Writer)">marshal</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a> jaxbElement, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html?is-external=true" title="class or interface in java.io" class="externalLink">Writer</a> writer)</code></th> |
| <td class="colLast"> |
| <div class="block">Marshal the content tree rooted at <code>jaxbElement</code> into a Writer.</div> |
| </td> |
| </tr> |
| <tr id="i10" class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#marshal(java.lang.Object,javax.xml.stream.XMLEventWriter)">marshal</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a> jaxbElement, |
| <a href="https://docs.oracle.com/javase/8/docs/api/javax/xml/stream/XMLEventWriter.html?is-external=true" title="class or interface in javax.xml.stream" class="externalLink">XMLEventWriter</a> writer)</code></th> |
| <td class="colLast"> |
| <div class="block">Marshal the content tree rooted at <code>jaxbElement</code> into a |
| <a href="https://docs.oracle.com/javase/8/docs/api/javax/xml/stream/XMLEventWriter.html?is-external=true" title="class or interface in javax.xml.stream" class="externalLink"><code>XMLEventWriter</code></a>.</div> |
| </td> |
| </tr> |
| <tr id="i11" class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#marshal(java.lang.Object,javax.xml.stream.XMLStreamWriter)">marshal</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a> jaxbElement, |
| <a href="https://docs.oracle.com/javase/8/docs/api/javax/xml/stream/XMLStreamWriter.html?is-external=true" title="class or interface in javax.xml.stream" class="externalLink">XMLStreamWriter</a> writer)</code></th> |
| <td class="colLast"> |
| <div class="block">Marshal the content tree rooted at <code>jaxbElement</code> into a |
| <a href="https://docs.oracle.com/javase/8/docs/api/javax/xml/stream/XMLStreamWriter.html?is-external=true" title="class or interface in javax.xml.stream" class="externalLink"><code>XMLStreamWriter</code></a>.</div> |
| </td> |
| </tr> |
| <tr id="i12" class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#marshal(java.lang.Object,javax.xml.transform.Result)">marshal</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a> jaxbElement, |
| <a href="https://docs.oracle.com/javase/8/docs/api/javax/xml/transform/Result.html?is-external=true" title="class or interface in javax.xml.transform" class="externalLink">Result</a> result)</code></th> |
| <td class="colLast"> |
| <div class="block">Marshal the content tree rooted at <code>jaxbElement</code> into the specified |
| <code>javax.xml.transform.Result</code>.</div> |
| </td> |
| </tr> |
| <tr id="i13" class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#marshal(java.lang.Object,org.w3c.dom.Node)">marshal</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a> jaxbElement, |
| <a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom" class="externalLink">Node</a> node)</code></th> |
| <td class="colLast"> |
| <div class="block">Marshal the content tree rooted at <code>jaxbElement</code> into a DOM tree.</div> |
| </td> |
| </tr> |
| <tr id="i14" class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#marshal(java.lang.Object,org.xml.sax.ContentHandler)">marshal</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a> jaxbElement, |
| <a href="https://docs.oracle.com/javase/8/docs/api/org/xml/sax/ContentHandler.html?is-external=true" title="class or interface in org.xml.sax" class="externalLink">ContentHandler</a> handler)</code></th> |
| <td class="colLast"> |
| <div class="block">Marshal the content tree rooted at <code>jaxbElement</code> into SAX2 events.</div> |
| </td> |
| </tr> |
| <tr id="i15" class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setAdapter(jakarta.xml.bind.annotation.adapters.XmlAdapter)">setAdapter</a></span>​(<a href="annotation/adapters/XmlAdapter.html" title="class in jakarta.xml.bind.annotation.adapters">XmlAdapter</a> adapter)</code></th> |
| <td class="colLast"> |
| <div class="block">Associates a configured instance of <a href="annotation/adapters/XmlAdapter.html" title="class in jakarta.xml.bind.annotation.adapters"><code>XmlAdapter</code></a> with this marshaller.</div> |
| </td> |
| </tr> |
| <tr id="i16" class="altColor"> |
| <td class="colFirst"><code><A extends <a href="annotation/adapters/XmlAdapter.html" title="class in jakarta.xml.bind.annotation.adapters">XmlAdapter</a>><br>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setAdapter(java.lang.Class,A)">setAdapter</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang" class="externalLink">Class</a><A> type, |
| A adapter)</code></th> |
| <td class="colLast"> |
| <div class="block">Associates a configured instance of <a href="annotation/adapters/XmlAdapter.html" title="class in jakarta.xml.bind.annotation.adapters"><code>XmlAdapter</code></a> with this marshaller.</div> |
| </td> |
| </tr> |
| <tr id="i17" class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setAttachmentMarshaller(jakarta.xml.bind.attachment.AttachmentMarshaller)">setAttachmentMarshaller</a></span>​(<a href="attachment/AttachmentMarshaller.html" title="class in jakarta.xml.bind.attachment">AttachmentMarshaller</a> am)</code></th> |
| <td class="colLast"> |
| <div class="block">Associate a context that enables binary data within an XML document |
| to be transmitted as XML-binary optimized attachment.</div> |
| </td> |
| </tr> |
| <tr id="i18" class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setEventHandler(jakarta.xml.bind.ValidationEventHandler)">setEventHandler</a></span>​(<a href="ValidationEventHandler.html" title="interface in jakarta.xml.bind">ValidationEventHandler</a> handler)</code></th> |
| <td class="colLast"> |
| <div class="block">Allow an application to register a validation event handler.</div> |
| </td> |
| </tr> |
| <tr id="i19" class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setListener(jakarta.xml.bind.Marshaller.Listener)">setListener</a></span>​(<a href="Marshaller.Listener.html" title="class in jakarta.xml.bind">Marshaller.Listener</a> listener)</code></th> |
| <td class="colLast"> |
| <div class="block"> |
| Register marshal event callback <a href="Marshaller.Listener.html" title="class in jakarta.xml.bind"><code>Marshaller.Listener</code></a> with this <a href="Marshaller.html" title="interface in jakarta.xml.bind"><code>Marshaller</code></a>.</div> |
| </td> |
| </tr> |
| <tr id="i20" class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setProperty(java.lang.String,java.lang.Object)">setProperty</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> name, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a> value)</code></th> |
| <td class="colLast"> |
| <div class="block">Set the particular property in the underlying implementation of |
| <code>Marshaller</code>.</div> |
| </td> |
| </tr> |
| <tr id="i21" class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setSchema(javax.xml.validation.Schema)">setSchema</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/javax/xml/validation/Schema.html?is-external=true" title="class or interface in javax.xml.validation" class="externalLink">Schema</a> schema)</code></th> |
| <td class="colLast"> |
| <div class="block">Specify the JAXP 1.3 <a href="https://docs.oracle.com/javase/8/docs/api/javax/xml/validation/Schema.html?is-external=true" title="class or interface in javax.xml.validation" class="externalLink"><code>Schema</code></a> |
| object that should be used to validate subsequent marshal operations |
| against.</div> |
| </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </div> |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ============ FIELD DETAIL =========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="field.detail"> |
| <!-- --> |
| </a> |
| <h3>Field Detail</h3> |
| <a id="JAXB_ENCODING"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>JAXB_ENCODING</h4> |
| <pre>static final <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> JAXB_ENCODING</pre> |
| <div class="block">The name of the property used to specify the output encoding in |
| the marshalled XML data.</div> |
| <dl> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../constant-values.html#jakarta.xml.bind.Marshaller.JAXB_ENCODING">Constant Field Values</a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="JAXB_FORMATTED_OUTPUT"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>JAXB_FORMATTED_OUTPUT</h4> |
| <pre>static final <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> JAXB_FORMATTED_OUTPUT</pre> |
| <div class="block">The name of the property used to specify whether or not the marshalled |
| XML data is formatted with linefeeds and indentation.</div> |
| <dl> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../constant-values.html#jakarta.xml.bind.Marshaller.JAXB_FORMATTED_OUTPUT">Constant Field Values</a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="JAXB_SCHEMA_LOCATION"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>JAXB_SCHEMA_LOCATION</h4> |
| <pre>static final <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> JAXB_SCHEMA_LOCATION</pre> |
| <div class="block">The name of the property used to specify the xsi:schemaLocation |
| attribute value to place in the marshalled XML output.</div> |
| <dl> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../constant-values.html#jakarta.xml.bind.Marshaller.JAXB_SCHEMA_LOCATION">Constant Field Values</a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="JAXB_NO_NAMESPACE_SCHEMA_LOCATION"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>JAXB_NO_NAMESPACE_SCHEMA_LOCATION</h4> |
| <pre>static final <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> JAXB_NO_NAMESPACE_SCHEMA_LOCATION</pre> |
| <div class="block">The name of the property used to specify the |
| xsi:noNamespaceSchemaLocation attribute value to place in the marshalled |
| XML output.</div> |
| <dl> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../constant-values.html#jakarta.xml.bind.Marshaller.JAXB_NO_NAMESPACE_SCHEMA_LOCATION">Constant Field Values</a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="JAXB_FRAGMENT"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>JAXB_FRAGMENT</h4> |
| <pre>static final <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> JAXB_FRAGMENT</pre> |
| <div class="block">The name of the property used to specify whether or not the marshaller |
| will generate document level events (ie calling startDocument or endDocument).</div> |
| <dl> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../constant-values.html#jakarta.xml.bind.Marshaller.JAXB_FRAGMENT">Constant Field Values</a></dd> |
| </dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| <!-- ============ METHOD DETAIL ========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="method.detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| <a id="marshal(java.lang.Object,javax.xml.transform.Result)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>marshal</h4> |
| <pre class="methodSignature">void marshal​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a> jaxbElement, |
| <a href="https://docs.oracle.com/javase/8/docs/api/javax/xml/transform/Result.html?is-external=true" title="class or interface in javax.xml.transform" class="externalLink">Result</a> result) |
| throws <a href="JAXBException.html" title="class in jakarta.xml.bind">JAXBException</a></pre> |
| <div class="block">Marshal the content tree rooted at <code>jaxbElement</code> into the specified |
| <code>javax.xml.transform.Result</code>. |
| |
| <p> |
| All JAXB Providers must at least support |
| <a href="https://docs.oracle.com/javase/8/docs/api/javax/xml/transform/dom/DOMResult.html?is-external=true" title="class or interface in javax.xml.transform.dom" class="externalLink"><code>DOMResult</code></a>, |
| <a href="https://docs.oracle.com/javase/8/docs/api/javax/xml/transform/sax/SAXResult.html?is-external=true" title="class or interface in javax.xml.transform.sax" class="externalLink"><code>SAXResult</code></a>, and |
| <a href="https://docs.oracle.com/javase/8/docs/api/javax/xml/transform/stream/StreamResult.html?is-external=true" title="class or interface in javax.xml.transform.stream" class="externalLink"><code>StreamResult</code></a>. It can |
| support other derived classes of <code>Result</code> as well.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>jaxbElement</code> - The root of content tree to be marshalled.</dd> |
| <dd><code>result</code> - XML will be sent to this Result</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="JAXBException.html" title="class in jakarta.xml.bind">JAXBException</a></code> - If any unexpected problem occurs during the marshalling.</dd> |
| <dd><code><a href="MarshalException.html" title="class in jakarta.xml.bind">MarshalException</a></code> - If the <a href="ValidationEventHandler.html" title="interface in jakarta.xml.bind"><code>ValidationEventHandler</code></a> |
| returns false from its <code>handleEvent</code> method or the |
| <code>Marshaller</code> is unable to marshal <code>jaxbElement</code> (or any |
| object reachable from <code>jaxbElement</code>). See <a href="#elementMarshalling"> |
| Marshalling a JAXB element</a>.</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang" class="externalLink">IllegalArgumentException</a></code> - If any of the method parameters are null</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="marshal(java.lang.Object,java.io.OutputStream)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>marshal</h4> |
| <pre class="methodSignature">void marshal​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a> jaxbElement, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io" class="externalLink">OutputStream</a> os) |
| throws <a href="JAXBException.html" title="class in jakarta.xml.bind">JAXBException</a></pre> |
| <div class="block">Marshal the content tree rooted at <code>jaxbElement</code> into an output stream.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>jaxbElement</code> - The root of content tree to be marshalled.</dd> |
| <dd><code>os</code> - XML will be added to this stream.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="JAXBException.html" title="class in jakarta.xml.bind">JAXBException</a></code> - If any unexpected problem occurs during the marshalling.</dd> |
| <dd><code><a href="MarshalException.html" title="class in jakarta.xml.bind">MarshalException</a></code> - If the <a href="ValidationEventHandler.html" title="interface in jakarta.xml.bind"><code>ValidationEventHandler</code></a> |
| returns false from its <code>handleEvent</code> method or the |
| <code>Marshaller</code> is unable to marshal <code>jaxbElement</code> (or any |
| object reachable from <code>jaxbElement</code>). See <a href="#elementMarshalling"> |
| Marshalling a JAXB element</a>.</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang" class="externalLink">IllegalArgumentException</a></code> - If any of the method parameters are null</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="marshal(java.lang.Object,java.io.File)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>marshal</h4> |
| <pre class="methodSignature">void marshal​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a> jaxbElement, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io" class="externalLink">File</a> output) |
| throws <a href="JAXBException.html" title="class in jakarta.xml.bind">JAXBException</a></pre> |
| <div class="block">Marshal the content tree rooted at <code>jaxbElement</code> into a file.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>jaxbElement</code> - The root of content tree to be marshalled.</dd> |
| <dd><code>output</code> - File to be written. If this file already exists, it will be overwritten.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="JAXBException.html" title="class in jakarta.xml.bind">JAXBException</a></code> - If any unexpected problem occurs during the marshalling.</dd> |
| <dd><code><a href="MarshalException.html" title="class in jakarta.xml.bind">MarshalException</a></code> - If the <a href="ValidationEventHandler.html" title="interface in jakarta.xml.bind"><code>ValidationEventHandler</code></a> |
| returns false from its <code>handleEvent</code> method or the |
| <code>Marshaller</code> is unable to marshal <code>jaxbElement</code> (or any |
| object reachable from <code>jaxbElement</code>). See <a href="#elementMarshalling"> |
| Marshalling a JAXB element</a>.</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang" class="externalLink">IllegalArgumentException</a></code> - If any of the method parameters are null</dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>1.6, JAXB 2.1</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="marshal(java.lang.Object,java.io.Writer)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>marshal</h4> |
| <pre class="methodSignature">void marshal​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a> jaxbElement, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html?is-external=true" title="class or interface in java.io" class="externalLink">Writer</a> writer) |
| throws <a href="JAXBException.html" title="class in jakarta.xml.bind">JAXBException</a></pre> |
| <div class="block">Marshal the content tree rooted at <code>jaxbElement</code> into a Writer.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>jaxbElement</code> - The root of content tree to be marshalled.</dd> |
| <dd><code>writer</code> - XML will be sent to this writer.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="JAXBException.html" title="class in jakarta.xml.bind">JAXBException</a></code> - If any unexpected problem occurs during the marshalling.</dd> |
| <dd><code><a href="MarshalException.html" title="class in jakarta.xml.bind">MarshalException</a></code> - If the <a href="ValidationEventHandler.html" title="interface in jakarta.xml.bind"><code>ValidationEventHandler</code></a> |
| returns false from its <code>handleEvent</code> method or the |
| <code>Marshaller</code> is unable to marshal <code>jaxbElement</code> (or any |
| object reachable from <code>jaxbElement</code>). See <a href="#elementMarshalling"> |
| Marshalling a JAXB element</a>.</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang" class="externalLink">IllegalArgumentException</a></code> - If any of the method parameters are null</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="marshal(java.lang.Object,org.xml.sax.ContentHandler)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>marshal</h4> |
| <pre class="methodSignature">void marshal​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a> jaxbElement, |
| <a href="https://docs.oracle.com/javase/8/docs/api/org/xml/sax/ContentHandler.html?is-external=true" title="class or interface in org.xml.sax" class="externalLink">ContentHandler</a> handler) |
| throws <a href="JAXBException.html" title="class in jakarta.xml.bind">JAXBException</a></pre> |
| <div class="block">Marshal the content tree rooted at <code>jaxbElement</code> into SAX2 events.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>jaxbElement</code> - The root of content tree to be marshalled.</dd> |
| <dd><code>handler</code> - XML will be sent to this handler as SAX2 events.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="JAXBException.html" title="class in jakarta.xml.bind">JAXBException</a></code> - If any unexpected problem occurs during the marshalling.</dd> |
| <dd><code><a href="MarshalException.html" title="class in jakarta.xml.bind">MarshalException</a></code> - If the <a href="ValidationEventHandler.html" title="interface in jakarta.xml.bind"><code>ValidationEventHandler</code></a> |
| returns false from its <code>handleEvent</code> method or the |
| <code>Marshaller</code> is unable to marshal <code>jaxbElement</code> (or any |
| object reachable from <code>jaxbElement</code>). See <a href="#elementMarshalling"> |
| Marshalling a JAXB element</a>.</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang" class="externalLink">IllegalArgumentException</a></code> - If any of the method parameters are null</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="marshal(java.lang.Object,org.w3c.dom.Node)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>marshal</h4> |
| <pre class="methodSignature">void marshal​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a> jaxbElement, |
| <a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom" class="externalLink">Node</a> node) |
| throws <a href="JAXBException.html" title="class in jakarta.xml.bind">JAXBException</a></pre> |
| <div class="block">Marshal the content tree rooted at <code>jaxbElement</code> into a DOM tree.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>jaxbElement</code> - The content tree to be marshalled.</dd> |
| <dd><code>node</code> - DOM nodes will be added as children of this node. |
| This parameter must be a Node that accepts children |
| (<a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Document.html?is-external=true" title="class or interface in org.w3c.dom" class="externalLink"><code>Document</code></a>, |
| <a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/DocumentFragment.html?is-external=true" title="class or interface in org.w3c.dom" class="externalLink"><code>DocumentFragment</code></a>, or |
| <a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Element.html?is-external=true" title="class or interface in org.w3c.dom" class="externalLink"><code>Element</code></a>)</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="JAXBException.html" title="class in jakarta.xml.bind">JAXBException</a></code> - If any unexpected problem occurs during the marshalling.</dd> |
| <dd><code><a href="MarshalException.html" title="class in jakarta.xml.bind">MarshalException</a></code> - If the <a href="ValidationEventHandler.html" title="interface in jakarta.xml.bind"><code>ValidationEventHandler</code></a> |
| returns false from its <code>handleEvent</code> method or the |
| <code>Marshaller</code> is unable to marshal <code>jaxbElement</code> (or any |
| object reachable from <code>jaxbElement</code>). See <a href="#elementMarshalling"> |
| Marshalling a JAXB element</a>.</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang" class="externalLink">IllegalArgumentException</a></code> - If any of the method parameters are null</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="marshal(java.lang.Object,javax.xml.stream.XMLStreamWriter)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>marshal</h4> |
| <pre class="methodSignature">void marshal​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a> jaxbElement, |
| <a href="https://docs.oracle.com/javase/8/docs/api/javax/xml/stream/XMLStreamWriter.html?is-external=true" title="class or interface in javax.xml.stream" class="externalLink">XMLStreamWriter</a> writer) |
| throws <a href="JAXBException.html" title="class in jakarta.xml.bind">JAXBException</a></pre> |
| <div class="block">Marshal the content tree rooted at <code>jaxbElement</code> into a |
| <a href="https://docs.oracle.com/javase/8/docs/api/javax/xml/stream/XMLStreamWriter.html?is-external=true" title="class or interface in javax.xml.stream" class="externalLink"><code>XMLStreamWriter</code></a>.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>jaxbElement</code> - The content tree to be marshalled.</dd> |
| <dd><code>writer</code> - XML will be sent to this writer.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="JAXBException.html" title="class in jakarta.xml.bind">JAXBException</a></code> - If any unexpected problem occurs during the marshalling.</dd> |
| <dd><code><a href="MarshalException.html" title="class in jakarta.xml.bind">MarshalException</a></code> - If the <a href="ValidationEventHandler.html" title="interface in jakarta.xml.bind"><code>ValidationEventHandler</code></a> |
| returns false from its <code>handleEvent</code> method or the |
| <code>Marshaller</code> is unable to marshal <code>jaxbElement</code> (or any |
| object reachable from <code>jaxbElement</code>). See <a href="#elementMarshalling"> |
| Marshalling a JAXB element</a>.</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang" class="externalLink">IllegalArgumentException</a></code> - If any of the method parameters are null</dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>1.6, JAXB 2.0</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="marshal(java.lang.Object,javax.xml.stream.XMLEventWriter)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>marshal</h4> |
| <pre class="methodSignature">void marshal​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a> jaxbElement, |
| <a href="https://docs.oracle.com/javase/8/docs/api/javax/xml/stream/XMLEventWriter.html?is-external=true" title="class or interface in javax.xml.stream" class="externalLink">XMLEventWriter</a> writer) |
| throws <a href="JAXBException.html" title="class in jakarta.xml.bind">JAXBException</a></pre> |
| <div class="block">Marshal the content tree rooted at <code>jaxbElement</code> into a |
| <a href="https://docs.oracle.com/javase/8/docs/api/javax/xml/stream/XMLEventWriter.html?is-external=true" title="class or interface in javax.xml.stream" class="externalLink"><code>XMLEventWriter</code></a>.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>jaxbElement</code> - The content tree rooted at jaxbElement to be marshalled.</dd> |
| <dd><code>writer</code> - XML will be sent to this writer.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="JAXBException.html" title="class in jakarta.xml.bind">JAXBException</a></code> - If any unexpected problem occurs during the marshalling.</dd> |
| <dd><code><a href="MarshalException.html" title="class in jakarta.xml.bind">MarshalException</a></code> - If the <a href="ValidationEventHandler.html" title="interface in jakarta.xml.bind"><code>ValidationEventHandler</code></a> |
| returns false from its <code>handleEvent</code> method or the |
| <code>Marshaller</code> is unable to marshal <code>jaxbElement</code> (or any |
| object reachable from <code>jaxbElement</code>). See <a href="#elementMarshalling"> |
| Marshalling a JAXB element</a>.</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang" class="externalLink">IllegalArgumentException</a></code> - If any of the method parameters are null</dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>1.6, JAXB 2.0</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="getNode(java.lang.Object)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getNode</h4> |
| <pre class="methodSignature"><a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom" class="externalLink">Node</a> getNode​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a> contentTree) |
| throws <a href="JAXBException.html" title="class in jakarta.xml.bind">JAXBException</a></pre> |
| <div class="block">Get a DOM tree view of the content tree(Optional). |
| |
| If the returned DOM tree is updated, these changes are also |
| visible in the content tree. |
| Use <a href="#marshal(java.lang.Object,org.w3c.dom.Node)"><code>marshal(Object, org.w3c.dom.Node)</code></a> to force |
| a deep copy of the content tree to a DOM representation.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>contentTree</code> - - JAXB Java representation of XML content</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the DOM tree view of the contentTree</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/UnsupportedOperationException.html?is-external=true" title="class or interface in java.lang" class="externalLink">UnsupportedOperationException</a></code> - If the JAXB provider implementation does not support a |
| DOM view of the content tree</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang" class="externalLink">IllegalArgumentException</a></code> - If any of the method parameters are null</dd> |
| <dd><code><a href="JAXBException.html" title="class in jakarta.xml.bind">JAXBException</a></code> - If any unexpected problem occurs</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="setProperty(java.lang.String,java.lang.Object)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setProperty</h4> |
| <pre class="methodSignature">void setProperty​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> name, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a> value) |
| throws <a href="PropertyException.html" title="class in jakarta.xml.bind">PropertyException</a></pre> |
| <div class="block">Set the particular property in the underlying implementation of |
| <code>Marshaller</code>. This method can only be used to set one of |
| the standard JAXB defined properties above or a provider specific |
| property. Attempting to set an undefined property will result in |
| a PropertyException being thrown. See <a href="#supportedProps"> |
| Supported Properties</a>.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>name</code> - the name of the property to be set. This value can either |
| be specified using one of the constant fields or a user |
| supplied string.</dd> |
| <dd><code>value</code> - the value of the property to be set</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="PropertyException.html" title="class in jakarta.xml.bind">PropertyException</a></code> - when there is an error processing the given |
| property or value</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang" class="externalLink">IllegalArgumentException</a></code> - If the name parameter is null</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="getProperty(java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getProperty</h4> |
| <pre class="methodSignature"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a> getProperty​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> name) |
| throws <a href="PropertyException.html" title="class in jakarta.xml.bind">PropertyException</a></pre> |
| <div class="block">Get the particular property in the underlying implementation of |
| <code>Marshaller</code>. This method can only be used to get one of |
| the standard JAXB defined properties above or a provider specific |
| property. Attempting to get an undefined property will result in |
| a PropertyException being thrown. See <a href="#supportedProps"> |
| Supported Properties</a>.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>name</code> - the name of the property to retrieve</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the value of the requested property</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="PropertyException.html" title="class in jakarta.xml.bind">PropertyException</a></code> - when there is an error retrieving the given property or value |
| property name</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang" class="externalLink">IllegalArgumentException</a></code> - If the name parameter is null</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="setEventHandler(jakarta.xml.bind.ValidationEventHandler)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setEventHandler</h4> |
| <pre class="methodSignature">void setEventHandler​(<a href="ValidationEventHandler.html" title="interface in jakarta.xml.bind">ValidationEventHandler</a> handler) |
| throws <a href="JAXBException.html" title="class in jakarta.xml.bind">JAXBException</a></pre> |
| <div class="block">Allow an application to register a validation event handler. |
| <p> |
| The validation event handler will be called by the JAXB Provider if any |
| validation errors are encountered during calls to any of the marshal |
| API's. If the client application does not register a validation event |
| handler before invoking one of the marshal methods, then validation |
| events will be handled by the default event handler which will terminate |
| the marshal operation after the first error or fatal error is encountered. |
| <p> |
| Calling this method with a null parameter will cause the Marshaller |
| to revert back to the default default event handler.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>handler</code> - the validation event handler</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="JAXBException.html" title="class in jakarta.xml.bind">JAXBException</a></code> - if an error was encountered while setting the |
| event handler</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="getEventHandler()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getEventHandler</h4> |
| <pre class="methodSignature"><a href="ValidationEventHandler.html" title="interface in jakarta.xml.bind">ValidationEventHandler</a> getEventHandler() |
| throws <a href="JAXBException.html" title="class in jakarta.xml.bind">JAXBException</a></pre> |
| <div class="block">Return the current event handler or the default event handler if one |
| hasn't been set.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the current ValidationEventHandler or the default event handler |
| if it hasn't been set</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="JAXBException.html" title="class in jakarta.xml.bind">JAXBException</a></code> - if an error was encountered while getting the |
| current event handler</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="setAdapter(jakarta.xml.bind.annotation.adapters.XmlAdapter)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setAdapter</h4> |
| <pre class="methodSignature">void setAdapter​(<a href="annotation/adapters/XmlAdapter.html" title="class in jakarta.xml.bind.annotation.adapters">XmlAdapter</a> adapter)</pre> |
| <div class="block">Associates a configured instance of <a href="annotation/adapters/XmlAdapter.html" title="class in jakarta.xml.bind.annotation.adapters"><code>XmlAdapter</code></a> with this marshaller. |
| |
| <p> |
| This is a convenience method that invokes <code>setAdapter(adapter.getClass(),adapter);</code>.</div> |
| <dl> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang" class="externalLink">IllegalArgumentException</a></code> - if the adapter parameter is null.</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/UnsupportedOperationException.html?is-external=true" title="class or interface in java.lang" class="externalLink">UnsupportedOperationException</a></code> - if invoked agains a JAXB 1.0 implementation.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="#setAdapter(java.lang.Class,A)"><code>setAdapter(Class,XmlAdapter)</code></a></dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>1.6, JAXB 2.0</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="setAdapter(java.lang.Class,jakarta.xml.bind.annotation.adapters.XmlAdapter)"> |
| <!-- --> |
| </a><a id="setAdapter(java.lang.Class,A)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setAdapter</h4> |
| <pre class="methodSignature"><A extends <a href="annotation/adapters/XmlAdapter.html" title="class in jakarta.xml.bind.annotation.adapters">XmlAdapter</a>> void setAdapter​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang" class="externalLink">Class</a><A> type, |
| A adapter)</pre> |
| <div class="block">Associates a configured instance of <a href="annotation/adapters/XmlAdapter.html" title="class in jakarta.xml.bind.annotation.adapters"><code>XmlAdapter</code></a> with this marshaller. |
| |
| <p> |
| Every marshaller internally maintains a |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util" class="externalLink"><code>Map</code></a><<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang" class="externalLink"><code>Class</code></a>,<a href="annotation/adapters/XmlAdapter.html" title="class in jakarta.xml.bind.annotation.adapters"><code>XmlAdapter</code></a>>, |
| which it uses for marshalling classes whose fields/methods are annotated |
| with <a href="annotation/adapters/XmlJavaTypeAdapter.html" title="annotation in jakarta.xml.bind.annotation.adapters"><code>XmlJavaTypeAdapter</code></a>. |
| |
| <p> |
| This method allows applications to use a configured instance of <a href="annotation/adapters/XmlAdapter.html" title="class in jakarta.xml.bind.annotation.adapters"><code>XmlAdapter</code></a>. |
| When an instance of an adapter is not given, a marshaller will create |
| one by invoking its default constructor.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>type</code> - The type of the adapter. The specified instance will be used when |
| <a href="annotation/adapters/XmlJavaTypeAdapter.html#value()"><code>XmlJavaTypeAdapter.value()</code></a> |
| refers to this type.</dd> |
| <dd><code>adapter</code> - The instance of the adapter to be used. If null, it will un-register |
| the current adapter set for this type.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang" class="externalLink">IllegalArgumentException</a></code> - if the type parameter is null.</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/UnsupportedOperationException.html?is-external=true" title="class or interface in java.lang" class="externalLink">UnsupportedOperationException</a></code> - if invoked agains a JAXB 1.0 implementation.</dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>1.6, JAXB 2.0</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="getAdapter(java.lang.Class)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getAdapter</h4> |
| <pre class="methodSignature"><A extends <a href="annotation/adapters/XmlAdapter.html" title="class in jakarta.xml.bind.annotation.adapters">XmlAdapter</a>> A getAdapter​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang" class="externalLink">Class</a><A> type)</pre> |
| <div class="block">Gets the adapter associated with the specified type. |
| |
| This is the reverse operation of the <a href="#setAdapter(jakarta.xml.bind.annotation.adapters.XmlAdapter)"><code>setAdapter(jakarta.xml.bind.annotation.adapters.XmlAdapter)</code></a> method.</div> |
| <dl> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang" class="externalLink">IllegalArgumentException</a></code> - if the type parameter is null.</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/UnsupportedOperationException.html?is-external=true" title="class or interface in java.lang" class="externalLink">UnsupportedOperationException</a></code> - if invoked agains a JAXB 1.0 implementation.</dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>1.6, JAXB 2.0</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="setAttachmentMarshaller(jakarta.xml.bind.attachment.AttachmentMarshaller)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setAttachmentMarshaller</h4> |
| <pre class="methodSignature">void setAttachmentMarshaller​(<a href="attachment/AttachmentMarshaller.html" title="class in jakarta.xml.bind.attachment">AttachmentMarshaller</a> am)</pre> |
| <div class="block"><p>Associate a context that enables binary data within an XML document |
| to be transmitted as XML-binary optimized attachment. |
| The attachment is referenced from the XML document content model |
| by content-id URIs(cid) references stored within the xml document.</div> |
| <dl> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang" class="externalLink">IllegalStateException</a></code> - if attempt to concurrently call this |
| method during a marshal operation.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="getAttachmentMarshaller()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getAttachmentMarshaller</h4> |
| <pre class="methodSignature"><a href="attachment/AttachmentMarshaller.html" title="class in jakarta.xml.bind.attachment">AttachmentMarshaller</a> getAttachmentMarshaller()</pre> |
| </li> |
| </ul> |
| <a id="setSchema(javax.xml.validation.Schema)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setSchema</h4> |
| <pre class="methodSignature">void setSchema​(<a href="https://docs.oracle.com/javase/8/docs/api/javax/xml/validation/Schema.html?is-external=true" title="class or interface in javax.xml.validation" class="externalLink">Schema</a> schema)</pre> |
| <div class="block">Specify the JAXP 1.3 <a href="https://docs.oracle.com/javase/8/docs/api/javax/xml/validation/Schema.html?is-external=true" title="class or interface in javax.xml.validation" class="externalLink"><code>Schema</code></a> |
| object that should be used to validate subsequent marshal operations |
| against. Passing null into this method will disable validation. |
| |
| <p> |
| This method allows the caller to validate the marshalled XML as it's marshalled. |
| |
| <p> |
| Initially this property is set to <code>null</code>.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>schema</code> - Schema object to validate marshal operations against or null to disable validation</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/UnsupportedOperationException.html?is-external=true" title="class or interface in java.lang" class="externalLink">UnsupportedOperationException</a></code> - could be thrown if this method is |
| invoked on an Marshaller created from a JAXBContext referencing |
| JAXB 1.0 mapped classes</dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>1.6, JAXB 2.0</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="getSchema()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getSchema</h4> |
| <pre class="methodSignature"><a href="https://docs.oracle.com/javase/8/docs/api/javax/xml/validation/Schema.html?is-external=true" title="class or interface in javax.xml.validation" class="externalLink">Schema</a> getSchema()</pre> |
| <div class="block">Get the JAXP 1.3 <a href="https://docs.oracle.com/javase/8/docs/api/javax/xml/validation/Schema.html?is-external=true" title="class or interface in javax.xml.validation" class="externalLink"><code>Schema</code></a> object |
| being used to perform marshal-time validation. If there is no |
| Schema set on the marshaller, then this method will return null |
| indicating that marshal-time validation will not be performed.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the Schema object being used to perform marshal-time |
| validation or null if not present.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/UnsupportedOperationException.html?is-external=true" title="class or interface in java.lang" class="externalLink">UnsupportedOperationException</a></code> - could be thrown if this method is |
| invoked on an Marshaller created from a JAXBContext referencing |
| JAXB 1.0 mapped classes</dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>1.6, JAXB 2.0</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="setListener(jakarta.xml.bind.Marshaller.Listener)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setListener</h4> |
| <pre class="methodSignature">void setListener​(<a href="Marshaller.Listener.html" title="class in jakarta.xml.bind">Marshaller.Listener</a> listener)</pre> |
| <div class="block"><p> |
| Register marshal event callback <a href="Marshaller.Listener.html" title="class in jakarta.xml.bind"><code>Marshaller.Listener</code></a> with this <a href="Marshaller.html" title="interface in jakarta.xml.bind"><code>Marshaller</code></a>. |
| |
| <p> |
| There is only one Listener per Marshaller. Setting a Listener replaces the previous set Listener. |
| One can unregister current Listener by setting listener to <code>null</code>.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>listener</code> - an instance of a class that implements <a href="Marshaller.Listener.html" title="class in jakarta.xml.bind"><code>Marshaller.Listener</code></a></dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>1.6, JAXB 2.0</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="getListener()"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>getListener</h4> |
| <pre class="methodSignature"><a href="Marshaller.Listener.html" title="class in jakarta.xml.bind">Marshaller.Listener</a> getListener()</pre> |
| <div class="block"><p>Return <a href="Marshaller.Listener.html" title="class in jakarta.xml.bind"><code>Marshaller.Listener</code></a> registered with this <a href="Marshaller.html" title="interface in jakarta.xml.bind"><code>Marshaller</code></a>.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>registered <a href="Marshaller.Listener.html" title="class in jakarta.xml.bind"><code>Marshaller.Listener</code></a> or <code>null</code> |
| if no Listener is registered with this Marshaller.</dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>1.6, JAXB 2.0</dd> |
| </dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </div> |
| </div> |
| </main> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <footer role="contentinfo"> |
| <nav role="navigation"> |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <div class="bottomNav"><a id="navbar.bottom"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> |
| <a id="navbar.bottom.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../index.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../index-all.html">Index</a></li> |
| <li><a href="../../../help-doc.html">Help</a></li> |
| </ul> |
| <div class="aboutLanguage">EclipseLink 3.0.0, API Reference</div> |
| </div> |
| <div class="subNav"> |
| <ul class="navList" id="allclasses_navbar_bottom"> |
| <li><a href="../../../allclasses.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_bottom"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li><a href="#nested.class.summary">Nested</a> | </li> |
| <li><a href="#field.summary">Field</a> | </li> |
| <li>Constr | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li><a href="#field.detail">Field</a> | </li> |
| <li>Constr | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a id="skip.navbar.bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| </nav> |
| <p class="legalCopy"><small>Copyright © 2017–2020 <a href="http://www.eclipse.org/eclipselink">Eclipse.org - EclipseLink Project</a>. All rights reserved.</small></p> |
| </footer> |
| </body> |
| </html> |