Class XmlOptions

  • All Implemented Interfaces:
    java.io.Serializable
    Direct Known Subclasses:
    XmlOptionsBean

    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
    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