org.apache.xmlbeans
Class XmlOptions

java.lang.Object
  extended byorg.apache.xmlbeans.XmlOptions
All Implemented Interfaces:
Serializable

public class XmlOptions
extends Object
implements 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)));
 

See Also:
Serialized Form

Field Summary
static String CHARACTER_ENCODING
           
static String COMPILE_DOWNLOAD_URLS
           
static String COMPILE_MDEF_NAMESPACES
           
static String COMPILE_NO_PVR_RULE
           
static String COMPILE_NO_UPA_RULE
           
static String COMPILE_NO_VALIDATION
           
static String COMPILE_SUBSTITUTE_NAMES
           
static String DOCUMENT_SOURCE_NAME
           
static String DOCUMENT_TYPE
           
static String ENTITY_RESOLVER
           
static String ERROR_LISTENER
           
static String LOAD_ADDITIONAL_NAMESPACES
           
static String LOAD_LINE_NUMBERS
           
static String LOAD_MESSAGE_DIGEST
           
static String LOAD_REPLACE_DOCUMENT_ELEMENT
           
static String LOAD_STRIP_COMMENTS
           
static String LOAD_STRIP_PROCINSTS
           
static String LOAD_STRIP_WHITESPACE
           
static String LOAD_SUBSTITUTE_NAMESPACES
           
static String LOAD_TRIM_TEXT_BUFFER
           
static String SAVE_AGGRESSIVE_NAMESPACES
           
static String SAVE_FILTER_PROCINST
           
static String SAVE_IMPLICIT_NAMESPACES
           
static String SAVE_INNER
           
static String SAVE_NAMESPACES_FIRST
           
static String SAVE_OUTER
           
static String SAVE_PRETTY_PRINT
           
static String SAVE_PRETTY_PRINT_INDENT
           
static String SAVE_PRETTY_PRINT_OFFSET
           
static String SAVE_SUGGESTED_PREFIXES
           
static String SAVE_SYNTHETIC_DOCUMENT_ELEMENT
           
static String SAVE_USE_DEFAULT_NAMESPACE
           
static String SAVE_USE_OPEN_FRAGMENT
           
static String VALIDATE_ON_SET
           
static String XQUERY_CURRENT_NODE_VAR
           
static String XQUERY_VARIABLE_MAP
           
 
Constructor Summary
XmlOptions()
          Construct a new blank XmlOptions.
XmlOptions(XmlOptions other)
          Construct a new XmlOptions, copying the options.
 
Method Summary
 Object get(Object option)
          Used to get a generic option
 boolean hasOption(Object option)
          Used to test a generic option
static XmlOptions maskNull(XmlOptions o)
          If passed null, returns an empty options object.
 void put(Object option)
          Used to set a generic option
 void put(Object option, int value)
          Used to set a generic option
 void put(Object option, Object value)
          Used to set a generic option
static Object safeGet(XmlOptions o, Object option)
          Used to test a generic option on an options object that may be null
 XmlOptions setCharacterEncoding(String encoding)
          When parsing or writing a document, this sets the character encoding to use.
 XmlOptions setCompileDownloadUrls()
          If this option is set, then the schema compiler will try to download schemas that appear in imports and includes from network based URLs.
 XmlOptions setCompileMdefNamespaces(Set mdefNamespaces)
          If this option is set, then the schema compiler will permit and ignore multiple definitions of the same component (element, attribute, type, etc) names in the given namespaces.
 XmlOptions setCompileNoPvrRule()
          If this option is set, the particle valid (restriciton) rule is not enforced when building a SchemaTypeSystem.
 XmlOptions setCompileNoUpaRule()
          If this option is set, the unique particle attribution rule is not enforced when building a SchemaTypeSystem.
 XmlOptions setCompileNoValidation()
          If this option is set, validation is not done on the Schema XmlBeans when building a SchemaTypeSystem
 XmlOptions setCompileSubstituteNames(Map nameMap)
          This option allows for QName substitution during schema compilation.
 XmlOptions setDocumentSourceName(String documentSourceName)
          This option sets the document source name into the xml store when parsing a document.
 XmlOptions setDocumentType(SchemaType type)
          When parsing a document, this sets the type of the root element.
 XmlOptions setEntityResolver(EntityResolver resolver)
          If this option is set when compiling a schema, then the given EntityResolver will be consulted in order to resolve any URIs while downloading imported schemas.
 XmlOptions setErrorListener(Collection c)
          Sets a collection object for collecting XmlError objects during parsing, validation, and compilation.
 XmlOptions setLoadAdditionalNamespaces(Map nses)
          Set additional namespace mappings to be added when parsing a document.
 XmlOptions setLoadLineNumbers()
          If this option is set, line number annotations are placed in the store when parsing a document.
 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.
 XmlOptions setLoadReplaceDocumentElement(QName replacement)
          If this option is set, the document element is replaced with the given QName when parsing.
 XmlOptions setLoadStripComments()
          If this option is set, all comments are stripped when parsing a document.
 XmlOptions setLoadStripProcinsts()
          If this option is set, all processing instructions are stripped when parsing a document.
 XmlOptions setLoadStripWhitespace()
          If this option is set, all insignificant whitespace is stripped when parsing a document.
 XmlOptions setLoadSubstituteNamespaces(Map substNamespaces)
          This option sets a map of namespace uri substitutions that happen when parsing a document.
 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.
 XmlOptions setSaveAggresiveNamespaces()
          Causes the saver to reduce the number of namespace prefix declarations.
 XmlOptions setSaveFilterProcinst(String filterProcinst)
          This option causes the saver to filter a Processing Instruction with the given target
 XmlOptions setSaveImplicitNamespaces(Map 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.
 XmlOptions setSaveInner()
          This option controls whether saving begins on the element or its contents
 XmlOptions setSaveNamespacesFirst()
          This option will cause the saver to save namespace attributes first.
 XmlOptions setSaveOuter()
          This option controls whether saving begins on the element or its contents
 XmlOptions setSavePrettyPrint()
          This option will cause the saver to reformat white space for easier reading.
 XmlOptions setSavePrettyPrintIndent(int indent)
          When used with setSavePrettyPrint this sets the indent amount to use.
 XmlOptions setSavePrettyPrintOffset(int offset)
          When used with setSavePrettyPrint this sets the offset amount to use.
 XmlOptions setSaveSuggestedPrefixes(Map suggestedPrefixes)
          A map of hints to pass to the saver for which prefixes to use for which namespace URI.
 XmlOptions setSaveSyntheticDocumentElement(QName name)
          This option causes the saver to wrap the current fragment in an element with the given name.
 XmlOptions setSaveUseOpenFrag()
          When saving a fragment, this option changes the qname of the synthesized root element.
 XmlOptions setUseDefaultNamespace()
          If this option is set, the saver will try to use the default namespace for the most commonly used URI.
 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.
 XmlOptions setXqueryCurrentNodeVar(String varName)
          Sets the name of the variable that represents the current node in a query expression.
 XmlOptions setXqueryVariables(Map varMap)
          Map the names and values of external variables in an xquery expression.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SAVE_NAMESPACES_FIRST

public static final String SAVE_NAMESPACES_FIRST
See Also:
Constant Field Values

SAVE_SYNTHETIC_DOCUMENT_ELEMENT

public static final String SAVE_SYNTHETIC_DOCUMENT_ELEMENT
See Also:
Constant Field Values

SAVE_PRETTY_PRINT

public static final String SAVE_PRETTY_PRINT
See Also:
Constant Field Values

SAVE_PRETTY_PRINT_INDENT

public static final String SAVE_PRETTY_PRINT_INDENT
See Also:
Constant Field Values

SAVE_PRETTY_PRINT_OFFSET

public static final String SAVE_PRETTY_PRINT_OFFSET
See Also:
Constant Field Values

SAVE_AGGRESSIVE_NAMESPACES

public static final String SAVE_AGGRESSIVE_NAMESPACES
See Also:
Constant Field Values

SAVE_USE_DEFAULT_NAMESPACE

public static final String SAVE_USE_DEFAULT_NAMESPACE
See Also:
Constant Field Values

SAVE_IMPLICIT_NAMESPACES

public static final String SAVE_IMPLICIT_NAMESPACES
See Also:
Constant Field Values

SAVE_SUGGESTED_PREFIXES

public static final String SAVE_SUGGESTED_PREFIXES
See Also:
Constant Field Values

SAVE_FILTER_PROCINST

public static final String SAVE_FILTER_PROCINST
See Also:
Constant Field Values

SAVE_USE_OPEN_FRAGMENT

public static final String SAVE_USE_OPEN_FRAGMENT
See Also:
Constant Field Values

SAVE_OUTER

public static final String SAVE_OUTER
See Also:
Constant Field Values

SAVE_INNER

public static final String SAVE_INNER
See Also:
Constant Field Values

LOAD_REPLACE_DOCUMENT_ELEMENT

public static final String LOAD_REPLACE_DOCUMENT_ELEMENT
See Also:
Constant Field Values

LOAD_STRIP_WHITESPACE

public static final String LOAD_STRIP_WHITESPACE
See Also:
Constant Field Values

LOAD_STRIP_COMMENTS

public static final String LOAD_STRIP_COMMENTS
See Also:
Constant Field Values

LOAD_STRIP_PROCINSTS

public static final String LOAD_STRIP_PROCINSTS
See Also:
Constant Field Values

LOAD_LINE_NUMBERS

public static final String LOAD_LINE_NUMBERS
See Also:
Constant Field Values

LOAD_SUBSTITUTE_NAMESPACES

public static final String LOAD_SUBSTITUTE_NAMESPACES
See Also:
Constant Field Values

LOAD_TRIM_TEXT_BUFFER

public static final String LOAD_TRIM_TEXT_BUFFER
See Also:
Constant Field Values

LOAD_ADDITIONAL_NAMESPACES

public static final String LOAD_ADDITIONAL_NAMESPACES
See Also:
Constant Field Values

LOAD_MESSAGE_DIGEST

public static final String LOAD_MESSAGE_DIGEST
See Also:
Constant Field Values

XQUERY_CURRENT_NODE_VAR

public static final String XQUERY_CURRENT_NODE_VAR
See Also:
Constant Field Values

XQUERY_VARIABLE_MAP

public static final String XQUERY_VARIABLE_MAP
See Also:
Constant Field Values

CHARACTER_ENCODING

public static final String CHARACTER_ENCODING
See Also:
Constant Field Values

ERROR_LISTENER

public static final String ERROR_LISTENER
See Also:
Constant Field Values

DOCUMENT_TYPE

public static final String DOCUMENT_TYPE
See Also:
Constant Field Values

DOCUMENT_SOURCE_NAME

public static final String DOCUMENT_SOURCE_NAME
See Also:
Constant Field Values

COMPILE_SUBSTITUTE_NAMES

public static final String COMPILE_SUBSTITUTE_NAMES
See Also:
Constant Field Values

COMPILE_NO_VALIDATION

public static final String COMPILE_NO_VALIDATION
See Also:
Constant Field Values

COMPILE_NO_UPA_RULE

public static final String COMPILE_NO_UPA_RULE
See Also:
Constant Field Values

COMPILE_NO_PVR_RULE

public static final String COMPILE_NO_PVR_RULE
See Also:
Constant Field Values

COMPILE_DOWNLOAD_URLS

public static final String COMPILE_DOWNLOAD_URLS
See Also:
Constant Field Values

COMPILE_MDEF_NAMESPACES

public static final String COMPILE_MDEF_NAMESPACES
See Also:
Constant Field Values

VALIDATE_ON_SET

public static final String VALIDATE_ON_SET
See Also:
Constant Field Values

ENTITY_RESOLVER

public static final String ENTITY_RESOLVER
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()
This option will cause the saver to save namespace attributes first.

See Also:
XmlTokenSource.save(java.io.File, XmlOptions), XmlTokenSource.xmlText(XmlOptions)

setSavePrettyPrint

public XmlOptions setSavePrettyPrint()
This option will cause the saver to reformat white space for easier reading.

See Also:
XmlTokenSource.save(java.io.File, XmlOptions), XmlTokenSource.xmlText(XmlOptions)

setSavePrettyPrintIndent

public XmlOptions setSavePrettyPrintIndent(int indent)
When used with setSavePrettyPrint this sets the indent amount to use.

Parameters:
indent - the indent amount to use
See Also:
setSavePrettyPrint(), XmlTokenSource.save(java.io.File, XmlOptions), XmlTokenSource.xmlText(XmlOptions)

setSavePrettyPrintOffset

public XmlOptions setSavePrettyPrintOffset(int offset)
When used with setSavePrettyPrint this sets the offset amount to use.

Parameters:
offset - the offset amount to use
See Also:
setSavePrettyPrint(), XmlTokenSource.save(java.io.File, XmlOptions), XmlTokenSource.xmlText(XmlOptions)

setCharacterEncoding

public XmlOptions setCharacterEncoding(String encoding)
When parsing or writing a document, this sets the character encoding to use.

Parameters:
encoding - the character encoding
See Also:
XmlObject.Factory.parse(java.io.File, XmlOptions), XmlTokenSource.save(java.io.File, XmlOptions)

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:
XmlObject.Factory.parse(java.io.File, XmlOptions)

setErrorListener

public XmlOptions setErrorListener(Collection 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 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(java.lang.Object)
See Also:
XmlError, XmlObject.Factory.parse(java.io.File, XmlOptions), XmlObject.validate(XmlOptions), XmlBeans.compileXsd(org.apache.xmlbeans.XmlObject[], org.apache.xmlbeans.SchemaTypeLoader, org.apache.xmlbeans.XmlOptions), setLoadLineNumbers()

setSaveAggresiveNamespaces

public XmlOptions setSaveAggresiveNamespaces()
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)

setSaveSyntheticDocumentElement

public XmlOptions setSaveSyntheticDocumentElement(QName name)
This option causes the saver to wrap the current fragment in an element with the given name.

Parameters:
name - the name to use for the top level element
See Also:
XmlTokenSource.save(java.io.File, XmlOptions), XmlTokenSource.xmlText(XmlOptions)

setUseDefaultNamespace

public XmlOptions setUseDefaultNamespace()
If this option is set, the saver will try to use the default namespace for the most commonly used URI. If it is not set the saver will always created named prefixes.

See Also:
XmlTokenSource.save(java.io.File, XmlOptions), XmlTokenSource.xmlText(XmlOptions)

setSaveImplicitNamespaces

public XmlOptions setSaveImplicitNamespaces(Map 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)

setSaveSuggestedPrefixes

public XmlOptions setSaveSuggestedPrefixes(Map suggestedPrefixes)
A map of hints to pass to the saver for which prefixes to use for which namespace URI.

Parameters:
suggestedPrefixes - a map from URIs to prefixes
See Also:
XmlTokenSource.save(java.io.File, XmlOptions), XmlTokenSource.xmlText(XmlOptions)

setSaveFilterProcinst

public XmlOptions setSaveFilterProcinst(String filterProcinst)
This option causes the saver to filter a Processing Instruction with the given target

Parameters:
filterProcinst - the name of a Processing Instruction to filter on save
See Also:
XmlTokenSource.save(java.io.File, XmlOptions), XmlTokenSource.xmlText(XmlOptions)

setSaveUseOpenFrag

public XmlOptions setSaveUseOpenFrag()
When saving a fragment, this option changes the qname of the synthesized root element. Normally <xml-fragment> is used.

See Also:
XmlTokenSource.save(java.io.File, XmlOptions), XmlTokenSource.xmlText(XmlOptions)

setSaveOuter

public XmlOptions setSaveOuter()
This option controls whether saving begins on the element or its contents

See Also:
XmlTokenSource.save(java.io.File, XmlOptions), XmlTokenSource.xmlText(XmlOptions)

setSaveInner

public XmlOptions setSaveInner()
This option controls whether saving begins on the element or its contents

See Also:
XmlTokenSource.save(java.io.File, XmlOptions), XmlTokenSource.xmlText(XmlOptions)

setLoadReplaceDocumentElement

public XmlOptions setLoadReplaceDocumentElement(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:
XmlObject.Factory.parse(java.io.File, XmlOptions)

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:
XmlObject.Factory.parse(java.io.File, XmlOptions)

setLoadStripComments

public XmlOptions setLoadStripComments()
If this option is set, all comments are stripped when parsing a document.

See Also:
XmlObject.Factory.parse(java.io.File, XmlOptions)

setLoadStripProcinsts

public XmlOptions setLoadStripProcinsts()
If this option is set, all processing instructions are stripped when parsing a document.

See Also:
XmlObject.Factory.parse(java.io.File, XmlOptions)

setLoadLineNumbers

public XmlOptions setLoadLineNumbers()
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.

See Also:
XmlObject.Factory.parse(java.io.File, XmlOptions), XmlError

setLoadSubstituteNamespaces

public XmlOptions setLoadSubstituteNamespaces(Map 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:
XmlObject.Factory.parse(java.io.File, XmlOptions)

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:
XmlObject.Factory.parse(java.io.File, XmlOptions)

setLoadAdditionalNamespaces

public XmlOptions setLoadAdditionalNamespaces(Map nses)
Set additional namespace mappings to be added when parsing a document.

Parameters:
nses - additional namespace mappings
See Also:
XmlObject.Factory.parse(java.io.File, XmlOptions)

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:
XmlObject.Factory.parse(java.io.File, XmlOptions)

setXqueryCurrentNodeVar

public XmlOptions setXqueryCurrentNodeVar(String varName)
Sets the name of the variable that represents the current node in a query expression.

Parameters:
varName - The new variable name to use for the query.
See Also:
XmlObject.execQuery(java.lang.String), XmlCursor.execQuery(java.lang.String)

setXqueryVariables

public XmlOptions setXqueryVariables(Map 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)

setDocumentSourceName

public XmlOptions setDocumentSourceName(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:
XmlObject.Factory.parse(java.lang.String, XmlOptions)

setCompileSubstituteNames

public XmlOptions setCompileSubstituteNames(Map nameMap)
This option allows for QName substitution during schema compilation.

Parameters:
nameMap - a map from QNames to substitute QNames.
See Also:
XmlBeans.compileXsd(org.apache.xmlbeans.XmlObject[], org.apache.xmlbeans.SchemaTypeLoader, org.apache.xmlbeans.XmlOptions)

setCompileNoValidation

public XmlOptions setCompileNoValidation()
If this option is set, validation is not done on the Schema XmlBeans when building a SchemaTypeSystem

See Also:
XmlBeans.compileXsd(org.apache.xmlbeans.XmlObject[], org.apache.xmlbeans.SchemaTypeLoader, org.apache.xmlbeans.XmlOptions)

setCompileNoUpaRule

public XmlOptions setCompileNoUpaRule()
If this option is set, the unique particle attribution rule is not enforced when building a SchemaTypeSystem. See Appendix H of the XML Schema specification for information on the UPA rule.

See Also:
XmlBeans.compileXsd(org.apache.xmlbeans.XmlObject[], org.apache.xmlbeans.SchemaTypeLoader, org.apache.xmlbeans.XmlOptions)

setCompileNoPvrRule

public XmlOptions setCompileNoPvrRule()
If this option is set, the particle valid (restriciton) rule is not enforced when building a SchemaTypeSystem. See Section 3.9.6 of the XML Schema specification for information on the PVR rule.

See Also:
XmlBeans.compileXsd(org.apache.xmlbeans.XmlObject[], org.apache.xmlbeans.SchemaTypeLoader, org.apache.xmlbeans.XmlOptions)

setCompileDownloadUrls

public XmlOptions setCompileDownloadUrls()
If this option is set, then the schema compiler will try to download schemas that appear in imports and includes from network based URLs.

See Also:
XmlBeans.compileXsd(org.apache.xmlbeans.XmlObject[], org.apache.xmlbeans.SchemaTypeLoader, org.apache.xmlbeans.XmlOptions)

setCompileMdefNamespaces

public XmlOptions setCompileMdefNamespaces(Set mdefNamespaces)
If this option is set, then the schema compiler will permit and ignore multiple definitions of the same component (element, attribute, type, etc) names in the given namespaces. If multiple definitions with the same name appear, the definitions that happen to be processed last will be ignored.

Parameters:
mdefNamespaces - a set of namespace URIs as Strings
See Also:
XmlBeans.compileXsd(org.apache.xmlbeans.XmlObject[], org.apache.xmlbeans.SchemaTypeLoader, org.apache.xmlbeans.XmlOptions)

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:
XmlObject.Factory.parse(java.io.File, XmlOptions)

setEntityResolver

public XmlOptions setEntityResolver(EntityResolver resolver)
If this option is set when compiling a schema, then the given EntityResolver will be consulted in order to resolve any URIs while downloading imported schemas. EntityResolvers are currently only used by compileXsd; they are not consulted by other functions, for example, parse. This will likely change in the future.

See Also:
XmlBeans.compileXsd(org.apache.xmlbeans.XmlObject[], org.apache.xmlbeans.SchemaTypeLoader, org.apache.xmlbeans.XmlOptions)

maskNull

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


put

public void put(Object option)
Used to set a generic option


put

public void put(Object option,
                Object value)
Used to set a generic option


put

public void put(Object option,
                int value)
Used to set a generic option


hasOption

public boolean hasOption(Object option)
Used to test a generic option


get

public Object get(Object option)
Used to get a generic option


safeGet

public static Object safeGet(XmlOptions o,
                             Object option)
Used to test a generic option on an options object that may be null