Class XmlOptions

  • All Implemented Interfaces:
    java.io.Serializable

    public class XmlOptions
    extends java.lang.Object
    implements java.io.Serializable
    Used to supply options for loading, saving, and compiling, and validating.

    There are two styles for using XmlOptions: multiline setup, and single-line use. Here are two examples. First, multiline style:

    
     XmlOptions opts = new XmlOptions();
     opts.setSavePrettyPrint();
     opts.setSavePrettyPrintIndent(4);
     System.out.println(xobj.xmlText(opts));
     

    The alternative is single-line usage:

    
     System.out.println(xobj.xmlText(
         new XmlOptions().setSavePrettyPrint().setSavePrettyPrintIndent(4)));
     

    Table showing where each option gets used. Note that:

    • options available for newInstance methods will also apply for parse methods
    • options used for validate methods are also used for compile methods, since compilation usually implies validation against Schema for Schemas
    Option matrix
    newInstance methods parse methods validate methods compile methods save and xmlTextmethods
    setDocumentType
    setDocumentSourceName
    setValidateOnSet
    setUnsynchronized
    setLoad***
    setEntityResolver
    setErrorListener
    setValidateTreatLaxAsSkip setValidateStrict
    setErrorListener
    setCompile***
    setEntityResolver
    setBaseURI
    setGenerateJavaVersion
    setSave***
    setUseDefaultNamespace
    setCharacterEncoding
    See Also:
    Serialized Form
    • Field Detail

      • DEFAULT_ENTITY_EXPANSION_LIMIT

        public static final int DEFAULT_ENTITY_EXPANSION_LIMIT
        See Also:
        Constant Field Values
    • Constructor Detail

      • XmlOptions

        public XmlOptions()
        Construct a new blank XmlOptions.
      • XmlOptions

        public XmlOptions​(XmlOptions other)
        Construct a new XmlOptions, copying the options.
    • Method Detail

      • setSaveNamespacesFirst

        public XmlOptions setSaveNamespacesFirst​(boolean b)
      • isSaveNamespacesFirst

        public boolean isSaveNamespacesFirst()
      • setSavePrettyPrint

        public XmlOptions setSavePrettyPrint​(boolean b)
      • isSavePrettyPrint

        public boolean isSavePrettyPrint()
      • getSavePrettyPrintIndent

        public java.lang.Integer getSavePrettyPrintIndent()
      • getSavePrettyPrintOffset

        public java.lang.Integer getSavePrettyPrintOffset()
      • getCharacterEncoding

        public java.lang.String getCharacterEncoding()
      • setDocumentType

        public XmlOptions setDocumentType​(SchemaType type)
        When parsing a document, this sets the type of the root element. If this is set, the parser will not try to guess the type based on the document's QName.
        Parameters:
        type - The root element's document type.
        See Also:
        XmlObjectFactory.parse(java.io.File, XmlOptions)
      • getDocumentType

        public SchemaType getDocumentType()
      • setErrorListener

        public XmlOptions setErrorListener​(java.util.Collection<XmlError> c)

        Sets a collection object for collecting XmlError objects during parsing, validation, and compilation. When set, the collection will contain all the errors after the operation takes place. Notice that the errors will only have line numbers if the document was loaded with line numbers enabled.

        The following simple example illustrates using an error listener during validation.

        
         // Create an XmlOptions instance and set the error listener.
         XmlOptions validateOptions = new XmlOptions();
         ArrayList<XmlError> errorList = new ArrayList<>();
         validateOptions.setErrorListener(errorList);
        
         // Validate the XML.
         boolean isValid = newEmp.validate(validateOptions);
        
         // If the XML isn't valid, loop through the listener's contents,
         // printing contained messages.
         if (!isValid)
         {
              for (int i = 0; i < errorList.size(); i++)
              {
                  XmlError error = (XmlError)errorList.get(i);
        
                  System.out.println("\n");
                  System.out.println("Message: " + error.getMessage() + "\n");
                  System.out.println("Location of invalid XML: " +
                      error.getCursorLocation().xmlText() + "\n");
              }
         }
         
        Parameters:
        c - A collection that will be filled with XmlError objects via Collection.add(E)
        See Also:
        XmlError, XmlObjectFactory.parse(java.io.File, XmlOptions), XmlObject.validate(XmlOptions), XmlBeans.compileXsd(org.apache.xmlbeans.XmlObject[], org.apache.xmlbeans.SchemaTypeLoader, org.apache.xmlbeans.XmlOptions), setLoadLineNumbers()
      • getErrorListener

        public java.util.Collection<XmlError> getErrorListener()
      • setSaveAggressiveNamespaces

        public XmlOptions setSaveAggressiveNamespaces()
        Causes the saver to reduce the number of namespace prefix declarations. The saver will do this by passing over the document twice, first to collect the set of needed namespace declarations, and then second to actually save the document with the declarations collected at the root.
        See Also:
        XmlTokenSource.save(java.io.File, XmlOptions), XmlTokenSource.xmlText(XmlOptions)
      • setSaveAggressiveNamespaces

        public XmlOptions setSaveAggressiveNamespaces​(boolean b)
      • isSaveAggressiveNamespaces

        public boolean isSaveAggressiveNamespaces()
      • getSaveSyntheticDocumentElement

        public javax.xml.namespace.QName getSaveSyntheticDocumentElement()
      • setUseDefaultNamespace

        public XmlOptions setUseDefaultNamespace​(boolean b)
      • isUseDefaultNamespace

        public boolean isUseDefaultNamespace()
      • setSaveImplicitNamespaces

        public XmlOptions setSaveImplicitNamespaces​(java.util.Map<java.lang.String,​java.lang.String> implicitNamespaces)
        If namespaces have already been declared outside the scope of the fragment being saved, this allows those mappings to be passed down to the saver, so the prefixes are not re-declared.
        Parameters:
        implicitNamespaces - a map of prefixes to uris that can be used by the saver without being declared
        See Also:
        XmlTokenSource.save(java.io.File, XmlOptions), XmlTokenSource.xmlText(XmlOptions)
      • getSaveImplicitNamespaces

        public java.util.Map<java.lang.String,​java.lang.String> getSaveImplicitNamespaces()
      • getSaveSuggestedPrefixes

        public java.util.Map<java.lang.String,​java.lang.String> getSaveSuggestedPrefixes()
      • getSaveFilterProcinst

        public java.lang.String getSaveFilterProcinst()
      • setSaveUseOpenFrag

        public XmlOptions setSaveUseOpenFrag​(boolean b)
      • isSaveUseOpenFrag

        public boolean isSaveUseOpenFrag()
      • setSaveOuter

        public XmlOptions setSaveOuter​(boolean b)
      • isSaveOuter

        public boolean isSaveOuter()
      • setSaveInner

        public XmlOptions setSaveInner​(boolean b)
      • isSaveInner

        public boolean isSaveInner()
      • setSaveNoXmlDecl

        public XmlOptions setSaveNoXmlDecl​(boolean b)
      • isSaveNoXmlDecl

        public boolean isSaveNoXmlDecl()
      • setSaveCDataLengthThreshold

        public XmlOptions setSaveCDataLengthThreshold​(int cdataLengthThreshold)
        This option controls when saving will use CDATA blocks. CDATA will be used if the folowing condition is true:
        textLength > cdataLengthThreshold && entityCount > cdataEntityCountThreshold
        The default value of cdataLengthThreshold is 32.

        Use the folowing values for these cases:
        Option matrix
        Scenario cdataLengthThreshold cdataEntityCountThreshold
        Every text is CDATA 0 -1
        Only text that has an entity is CDATA 0 0
        Only text longer than x chars is CDATA x -1
        Only text that has y entitazable chars is CDATA 0 y
        Only text longer than x chars and has y entitazable chars is CDATA x y
        See Also:
        setSaveCDataEntityCountThreshold(int)
      • getSaveCDataLengthThreshold

        public java.lang.Integer getSaveCDataLengthThreshold()
      • setSaveCDataEntityCountThreshold

        public XmlOptions setSaveCDataEntityCountThreshold​(int cdataEntityCountThreshold)
        This option controls when saving will use CDATA blocks. CDATA will be used if the folowing condition is true:
        textLength > cdataLengthThreshold && entityCount > cdataEntityCountThreshold
        The default value of cdataEntityCountThreshold is 5.
        See Also:
        setSaveCDataLengthThreshold(int)
      • getSaveCDataEntityCountThreshold

        public java.lang.Integer getSaveCDataEntityCountThreshold()
      • setUseCDataBookmarks

        public XmlOptions setUseCDataBookmarks()

        Use this option when parsing and saving XML documents.

        For parsing this option will annotate the text fields in the store with CDataBookmark.

        For saving this option will save the text fields annotated with CDataBookmark as CDATA XML text.
        Note: The SaveCDataEntityCountThreshold and SaveCDataLengthThreshold options and their default values still apply.

        Note: Due to the store representation, a CDATA will not be recognized if it is imediately after non CDATA text and all text following it will be considered CDATA.
        Example:

        
         <a><![CDATA[cdata text]]></a>               - is considered as: <a><![CDATA[cdata text]]></a>
         <b><![CDATA[cdata text]]> regular text</b>  - is considered as: <b><![CDATA[cdata text regular text]]></b>
         <c>text <![CDATA[cdata text]]></c>          - is considered as: <c>text cdata text</c>
         

        Sample code:

        
         String xmlText = "<a>\n" +
         "<a><![CDATA[cdata text]]></a>\n" +
         "<b><![CDATA[cdata text]]> regular text</b>\n" +
         "<c>text <![CDATA[cdata text]]></c>\n" +
         "</a>";
         System.out.println(xmlText);
        
         XmlOptions opts = new XmlOptions();
         opts.setUseCDataBookmarks();
        
         XmlObject xo = org.apache.xmlbeans.impl.schema.XmlObjectFactory.parse( xmlText , opts);
        
         System.out.println("xo1:\n" + xo.xmlText(opts));
         System.out.println("\n");
        
         opts.setSavePrettyPrint();
         System.out.println("xo2:\n" + xo.xmlText(opts));
         
        See Also:
        CDataBookmark, CDataBookmark.CDATA_BOOKMARK
      • isUseCDataBookmarks

        public boolean isUseCDataBookmarks()
      • setSaveSaxNoNSDeclsInAttributes

        public XmlOptions setSaveSaxNoNSDeclsInAttributes()
        This option controls whether namespace declarations are included as attributes in the startElement event. By default, up to and including XMLBeans 2.3.0 they were included, in subsequent versions, they are no longer included.
      • setSaveSaxNoNSDeclsInAttributes

        public XmlOptions setSaveSaxNoNSDeclsInAttributes​(boolean b)
      • isSaveSaxNoNSDeclsInAttributes

        public boolean isSaveSaxNoNSDeclsInAttributes()
      • setLoadReplaceDocumentElement

        public XmlOptions setLoadReplaceDocumentElement​(javax.xml.namespace.QName replacement)
        If this option is set, the document element is replaced with the given QName when parsing. If null is supplied, the document element is removed.
        See Also:
        XmlObjectFactory.parse(java.io.File, XmlOptions)
      • getLoadReplaceDocumentElement

        public javax.xml.namespace.QName getLoadReplaceDocumentElement()
      • setLoadStripWhitespace

        public XmlOptions setLoadStripWhitespace()
        If this option is set, all insignificant whitespace is stripped when parsing a document. Can be used to save memory on large documents when you know there is no mixed content.
        See Also:
        XmlObjectFactory.parse(java.io.File, XmlOptions)
      • setLoadStripWhitespace

        public XmlOptions setLoadStripWhitespace​(boolean b)
      • isSetLoadStripWhitespace

        public boolean isSetLoadStripWhitespace()
      • setLoadStripComments

        public XmlOptions setLoadStripComments​(boolean b)
      • isLoadStripComments

        public boolean isLoadStripComments()
      • setLoadStripProcinsts

        public XmlOptions setLoadStripProcinsts​(boolean b)
      • isLoadStripProcinsts

        public boolean isLoadStripProcinsts()
      • setLoadLineNumbers

        public XmlOptions setLoadLineNumbers​(boolean b)
      • isLoadLineNumbers

        public boolean isLoadLineNumbers()
      • setLoadLineNumbersEndElement

        public XmlOptions setLoadLineNumbersEndElement()
        If this option is set, line number annotations are placed in the store when parsing a document. This is particularly useful when you want XmlError objects to contain line numbers. Use the option to load line numbers at the end of an element.
      • setLoadLineNumbersEndElement

        public XmlOptions setLoadLineNumbersEndElement​(boolean b)
      • isLoadLineNumbersEndElement

        public boolean isLoadLineNumbersEndElement()
      • setLoadSubstituteNamespaces

        public XmlOptions setLoadSubstituteNamespaces​(java.util.Map<java.lang.String,​java.lang.String> substNamespaces)
        This option sets a map of namespace uri substitutions that happen when parsing a document.

        This is particularly useful if you have documents that use no namespace, but you wish to avoid the name collision problems that occur when you introduce schema definitions without a target namespace.

        By mapping the empty string "" (the absence of a URI) to a specific namespace, you can force the parser to behave as if a no-namespace document were actually in the specified namespace. This allows you to type the instance according to a schema in a nonempty namespace, and therefore avoid the problematic practice of using schema definitions without a target namespace.

        Parameters:
        substNamespaces - a map of document URIs to replacement URIs
        See Also:
        XmlObjectFactory.parse(java.io.File, XmlOptions)
      • getLoadSubstituteNamespaces

        public java.util.Map<java.lang.String,​java.lang.String> getLoadSubstituteNamespaces()
      • setLoadTrimTextBuffer

        public XmlOptions setLoadTrimTextBuffer()
        If this option is set, the underlying xml text buffer is trimmed immediately after parsing a document resulting in a smaller memory footprint. Use this option if you are loading a large number of unchanging documents that will stay in memory for some time.
        See Also:
        XmlObjectFactory.parse(java.io.File, XmlOptions)
      • setLoadTrimTextBuffer

        public XmlOptions setLoadTrimTextBuffer​(boolean b)
      • isLoadTrimTextBuffer

        public boolean isLoadTrimTextBuffer()
      • setLoadAdditionalNamespaces

        public XmlOptions setLoadAdditionalNamespaces​(java.util.Map<java.lang.String,​java.lang.String> nses)
        Set additional namespace mappings to be added when parsing a document.
        Parameters:
        nses - additional namespace mappings
        See Also:
        XmlObjectFactory.parse(java.io.File, XmlOptions)
      • getLoadAdditionalNamespaces

        public java.util.Map<java.lang.String,​java.lang.String> getLoadAdditionalNamespaces()
      • setLoadMessageDigest

        public XmlOptions setLoadMessageDigest()
        If this option is set when loading from an InputStream or File, then the loader will compute a 160-bit SHA-1 message digest of the XML file while loading it and make it available via XmlObject.documentProperties().getMessageDigest();
        The schema compiler uses message digests to detect and eliminate duplicate imported xsd files.
        See Also:
        XmlObjectFactory.parse(java.io.File, XmlOptions)
      • setLoadMessageDigest

        public XmlOptions setLoadMessageDigest​(boolean b)
      • isLoadMessageDigest

        public boolean isLoadMessageDigest()
      • setLoadUseDefaultResolver

        public XmlOptions setLoadUseDefaultResolver()
        By default, XmlBeans does not resolve entities when parsing xml documents (unless an explicit entity resolver is specified). Use this option to turn on entity resolving by default.
        See Also:
        XmlObjectFactory.parse(java.io.File, XmlOptions)
      • setLoadUseDefaultResolver

        public XmlOptions setLoadUseDefaultResolver​(boolean b)
      • isLoadUseDefaultResolver

        public boolean isLoadUseDefaultResolver()
      • setLoadUseXMLReader

        public XmlOptions setLoadUseXMLReader​(org.xml.sax.XMLReader xmlReader)
        By default, XmlBeans creates a JAXP parser, other parsers can be used by providing an XMLReader. For using the default JDK's SAX parser use: xmlOptions.setLoadUseXMLReader( SAXParserFactory.newInstance().newSAXParser().getXMLReader() );
        See Also:
        XmlObjectFactory.parse(java.io.File, XmlOptions)
      • getLoadUseXMLReader

        public org.xml.sax.XMLReader getLoadUseXMLReader()
      • getXqueryCurrentNodeVar

        public java.lang.String getXqueryCurrentNodeVar()
      • setXqueryVariables

        public XmlOptions setXqueryVariables​(java.util.Map<java.lang.String,​java.lang.Object> varMap)
        Map the names and values of external variables in an xquery expression. The keys of the map are the variable names in the query without the '$' prefix. The values of the map are objects and can be any of the primitive wrapper classes, String, XmlObject, or XmlCursor. The mapping only applies to xquery and has no effect on xpath expressions.
        Parameters:
        varMap - a map from Strings to variable instances.
        See Also:
        XmlObject.execQuery(java.lang.String), XmlCursor.execQuery(java.lang.String)
      • getXqueryVariables

        public java.util.Map<java.lang.String,​java.lang.Object> getXqueryVariables()
      • setDocumentSourceName

        public XmlOptions setDocumentSourceName​(java.lang.String documentSourceName)
        This option sets the document source name into the xml store when parsing a document. If a document is parsed from a File or URI, it is automatically set to the URI of the source; otherwise, for example, when parsing a String, you can use this option to specify the source name yourself.
        See Also:
        XmlObjectFactory.parse(java.lang.String, XmlOptions)
      • getDocumentSourceName

        public java.lang.String getDocumentSourceName()
      • getCompileSubstituteNames

        public java.util.Map<javax.xml.namespace.QName,​javax.xml.namespace.QName> getCompileSubstituteNames()
      • isCompileNoValidation

        public boolean isCompileNoValidation()
      • setCompileNoUpaRule

        public XmlOptions setCompileNoUpaRule​(boolean b)
      • isCompileNoUpaRule

        public boolean isCompileNoUpaRule()
      • setCompileNoPvrRule

        public XmlOptions setCompileNoPvrRule​(boolean b)
      • isCompileNoPvrRule

        public boolean isCompileNoPvrRule()
      • setCompileNoAnnotations

        public XmlOptions setCompileNoAnnotations​(boolean b)
      • isCompileNoAnnotations

        public boolean isCompileNoAnnotations()
      • setCompileDownloadUrls

        public XmlOptions setCompileDownloadUrls​(boolean b)
      • isCompileDownloadUrls

        public boolean isCompileDownloadUrls()
      • getCompileMdefNamespaces

        public java.util.Set<java.lang.String> getCompileMdefNamespaces()
      • setCompilePartialTypesystem

        public XmlOptions setCompilePartialTypesystem()
      • setCompilePartialTypesystem

        public XmlOptions setCompilePartialTypesystem​(boolean compilePartialTypesystem)
      • isCompilePartialTypesystem

        public boolean isCompilePartialTypesystem()
      • setValidateOnSet

        public XmlOptions setValidateOnSet()
        If this option is set when an instance is created, then value facets will be checked on each call to a setter or getter method on instances of XmlObject within the instance document. If the facets are not satisfied, then an unchecked exception is thrown immediately. This option is useful for finding code that is introducing invalid values in an XML document, but it slows performance.
        See Also:
        XmlObjectFactory.parse(java.io.File, XmlOptions)
      • setValidateOnSet

        public XmlOptions setValidateOnSet​(boolean b)
      • isValidateOnSet

        public boolean isValidateOnSet()
      • setValidateTreatLaxAsSkip

        public XmlOptions setValidateTreatLaxAsSkip()
        Instructs the validator to skip elements matching an <any> particle with contentModel="lax". This is useful because, in certain situations, XmlBeans will find types on the classpath that the document author did not anticipate.
      • setValidateTreatLaxAsSkip

        public XmlOptions setValidateTreatLaxAsSkip​(boolean b)
      • isValidateTreatLaxAsSkip

        public boolean isValidateTreatLaxAsSkip()
      • setValidateStrict

        public XmlOptions setValidateStrict()
        Performs additional validation checks that are disabled by default for better compatibility.
      • setValidateStrict

        public XmlOptions setValidateStrict​(boolean b)
      • isValidateStrict

        public boolean isValidateStrict()
      • setValidateTextOnly

        public XmlOptions setValidateTextOnly()
      • setValidateTextOnly

        public XmlOptions setValidateTextOnly​(boolean b)
      • isValidateTextOnly

        public boolean isValidateTextOnly()
      • setUnsynchronized

        public XmlOptions setUnsynchronized()
        This option controls whether or not operations on XmlBeans are thread safe. When not on, all XmlBean operations will be synchronized. This provides for multiple thread the ability to access a single XmlBeans simultaneously, but has a perf impact. If set, then only one thread may access an XmlBean.
      • setUnsynchronized

        public XmlOptions setUnsynchronized​(boolean b)
      • isUnsynchronized

        public boolean isUnsynchronized()
      • getEntityResolver

        public org.xml.sax.EntityResolver getEntityResolver()
      • getBaseURI

        public java.net.URI getBaseURI()
      • setCopyUseNewSynchronizationDomain

        public XmlOptions setCopyUseNewSynchronizationDomain​(boolean useNewSyncDomain)
        If this option is set to true, the return of XmlObject.copy() method will return an object in it's own synchronization domain, otherwise both objects will share the same synchronization domain, requiring explicit synchronization when concurent accessing the two objects.
        Parameters:
        useNewSyncDomain - A flag representing the usage of new domain
        See Also:
        XmlObject.copy()
      • isCopyUseNewSynchronizationDomain

        public boolean isCopyUseNewSynchronizationDomain()
      • setUseSameLocale

        public XmlOptions setUseSameLocale​(java.lang.Object localeOrXmlTokenSource)
      • getUseSameLocale

        public java.lang.Object getUseSameLocale()
      • setLoadEntityBytesLimit

        public XmlOptions setLoadEntityBytesLimit​(int entityBytesLimit)
        Sets the maximum number of bytes allowed when an Entity is expanded during parsing. The default value is 10240 bytes.
        Parameters:
        entityBytesLimit - the maximum number of bytes allowed when an Entity is expanded during parsing
        Returns:
        this
      • getLoadEntityBytesLimit

        public java.lang.Integer getLoadEntityBytesLimit()
      • setEntityExpansionLimit

        public XmlOptions setEntityExpansionLimit​(int entityExpansionLimit)
        Sets the maximum number of entity expansions allowed during parsing. The default value is 2048.
        Parameters:
        entityExpansionLimit - the maximum number of entity expansions allowed during parsing
        Returns:
        this
      • getEntityExpansionLimit

        public int getEntityExpansionLimit()
      • setLoadDTDGrammar

        public XmlOptions setLoadDTDGrammar​(boolean loadDTDGrammar)
        Controls whether DTD grammar is loaded during parsing. The default value is false.
        Parameters:
        loadDTDGrammar - true, if DTD grammar is loaded during parsing
        Returns:
        this
      • isLoadDTDGrammar

        public boolean isLoadDTDGrammar()
      • setLoadExternalDTD

        public XmlOptions setLoadExternalDTD​(boolean loadExternalDTD)
        Controls whether external DTDs are loaded during parsing. The default value is false.
        Parameters:
        loadExternalDTD - true, if external DTDs are loaded during parsing
        Returns:
        this
      • isLoadExternalDTD

        public boolean isLoadExternalDTD()
      • setDisallowDocTypeDeclaration

        public XmlOptions setDisallowDocTypeDeclaration​(boolean disallowDocTypeDeclaration)
        Controls whether DocType declarations are disallowed during XML parsing. If they are disallowed, the parser will throw an exception if a DocType declaration is encountered. The default value is false.
        Parameters:
        disallowDocTypeDeclaration - true, if DocType declarations are to be disallowed
        Returns:
        this
        Since:
        5.0.2
      • disallowDocTypeDeclaration

        public boolean disallowDocTypeDeclaration()
        Returns whether DocType declarations are disallowed during XML parsing. If they are disallowed, the parser will throw an exception if a DocType declaration is encountered. The default value is false.
        Returns:
        boolean
        Since:
        5.0.2
      • setSaveOptimizeForSpeed

        public XmlOptions setSaveOptimizeForSpeed​(boolean saveOptimizeForSpeed)
      • isSaveOptimizeForSpeed

        public boolean isSaveOptimizeForSpeed()
      • getSaaj

        public Saaj getSaaj()
      • setLoadUseLocaleCharUtil

        public XmlOptions setLoadUseLocaleCharUtil​(boolean useCharUtil)
      • isLoadUseLocaleCharUtil

        public boolean isLoadUseLocaleCharUtil()
      • setXPathUseSaxon

        public XmlOptions setXPathUseSaxon()
      • setXPathUseSaxon

        public XmlOptions setXPathUseSaxon​(boolean xpathUseSaxon)
      • isXPathUseSaxon

        public boolean isXPathUseSaxon()
      • setXPathUseXmlBeans

        public XmlOptions setXPathUseXmlBeans()
      • setXPathUseXmlBeans

        public XmlOptions setXPathUseXmlBeans​(boolean xpathUseXmlBeans)
      • isXPathUseXmlBeans

        public boolean isXPathUseXmlBeans()
      • setCompileAnnotationAsJavadoc

        public XmlOptions setCompileAnnotationAsJavadoc()
      • setCompileAnnotationAsJavadoc

        public XmlOptions setCompileAnnotationAsJavadoc​(boolean useAnnotationAsJavadoc)
        When generating the schema sources, copy over the schema annotations to the javadoc. Be aware basic code injection is filtered, but annotation based RCE aren't filtered. So think twice before activating this on untrusted schemas!
        Parameters:
        useAnnotationAsJavadoc - true = copy the annotation - defaults to false
      • isCompileAnnotationAsJavadoc

        public boolean isCompileAnnotationAsJavadoc()
      • setAttributeValidationCompatMode

        public XmlOptions setAttributeValidationCompatMode​(boolean attributeValidationCompatMode)
      • isAttributeValidationCompatMode

        public boolean isAttributeValidationCompatMode()
      • getCompilePartialMethod

        public java.util.Set<XmlOptions.BeanMethod> getCompilePartialMethod()
        Returns:
        the list of methods to be generated in the XmlBean or null for all
      • setCompilePartialMethod

        public void setCompilePartialMethod​(java.util.Set<XmlOptions.BeanMethod> list)
      • maskNull

        public static XmlOptions maskNull​(XmlOptions o)
        If passed null, returns an empty options object. Otherwise, returns its argument.