Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.bea.schema
Class DefaultDocumentOptions

    java.lang.Object
      com.bea.schema.DefaultDocumentOptions

public class DefaultDocumentOptions
extends Object

Structure for passing options to createDefaultDocument in SOMSchema. This class is used to pass parameters to the createDefaultDocument method in SOMSchema. In order to create a document based on a SOMSchema, the root element name from the schema is required, and space to create the document, targetDocument. Options:

- forceMinOccurs
- rootName
- targetDocument

Example:

         SOMSchema mySchema ...
         ...

         DefaultDocumentOptions options = new DefaultDocumentOptions();
         options.setRootName("purchaseOrder");
         options.setForceMinOccurs(2);

         mySchema.createDefaultDocument(options);
         ...

Version:
  1.0
Author:
  sharpe
See Also:
  `SOMSchema.createDefaultDocument(com.bea.schema.DefaultDocumentOptions)`

Constructor Summary
`DefaultDocumentOptions()`

Method Summary
`boolean` | `getForceAttrValues()` Force Attribute values.
`int` | `getForceMinOccurs()` Force minOccurs value.
`String` | `getNamespacePrefix()` Get the namespace prefix that will be used in the default document.
`boolean` | `getNamespacesEnabled()` Get an indication of whether namespaces will be honored/used in the default document generated.
`SOMElement` | `getRootElement()` Get the SOMElement that will act as the root element for the new document.
`String` | `getRootName()` the name of the root element set by setRootName
`String` | `getSchemaLocation()`
`Document` | `getTargetDocument()` the document.
`IDocument` | `getTargetIDocument()` the document.
`String` | `getTargetNamespace()`
`void` | `setForceAttrValues(boolean forceAttrValues)` Force Element attributes.
`void` | `setForceMinOccurs(int forceMinOccurs)` Force minimum occurs (minOccurs).
`void` | `setNamespacePrefix(String prefix)` Set the namespace prefix to use in the default document (ignored if getNamespacesEnabled() returns false.
`void` | `setNamespacesEnabled(boolean newValue)` Set namespace usage enabled/disabled when generating default XML.
`void` | `setRootElement(SOMElement rootElem)` Specify a SOMElement that will act as the root element for the new document.
`void` | `setRootName(String rootName)` specify the name of the element from the schema to be used as the root element for the new document.
`void` | `setSchemaLocation(String schemaLocation)` set xsi document attribute.
`void` | `setSchemaLocation(String targetNamespace, String schemaLocation)` set xsi document attribute.
`void` | `setTargetDocument(Document targetDocument)` set a target document holder for the default document to be created.
`void` | `setTargetDocument(IDocument targetDocument)` set a target document holder for the default document to be created.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### DefaultDocumentOptions

    public DefaultDocumentOptions()

Method Detail

### setRootName

    public void setRootName(String rootName)

  specify the name of the element from the schema to be used as the root element for the new document.

  Parameters:
    `rootName` - the name of an element in the root of the SOMSchema

### getRootName

    public String getRootName()

  the name of the root element set by setRootName

  Returns:
    the name of the root element set by setRootName or null if none has been set

### setRootElement

    public void setRootElement(SOMElement rootElem)

  Specify a SOMElement that will act as the root element for the new document. This element can be any SOMElement in the SOMSchema.

  Parameters:
    `rootElem` - the SOMElement that will act as the root element for the new document.

### getRootElement

    public SOMElement getRootElement()

  Get the SOMElement that will act as the root element for the new document.

  Returns:
    the SOMElement set by setRootElement or null if none has been set

### setTargetDocument

    public void setTargetDocument(IDocument targetDocument)

  set a target document holder for the default document to be created. The document should be empty, createDefaultDocument will fill the document.

  Parameters:
    `targetDocument` - an empty DOM Document

### setTargetDocument

    public void setTargetDocument(Document targetDocument)

  set a target document holder for the default document to be created. The document should be empty, createDefaultDocument will fill the document.

  Parameters:
    `targetDocument` - an empty DOM Document

### getTargetIDocument

    public IDocument getTargetIDocument()

  the document. DefaultDocumentOptions maintains a reference to the target IDocument. This reference is used by SOMSchema as the target space in which to create the instance document.

  Returns:
    the target DOM Document or null if none has been set

### getTargetDocument

    public Document getTargetDocument()

  the document. DefaultDocumentOptions maintains a reference to the target IDocument. This reference is used by SOMSchema as the target space in which to create the instance document.

  Returns:
    the target DOM Document or null if none has been set

### setForceMinOccurs

    public void setForceMinOccurs(int forceMinOccurs)

  Force minimum occurs (minOccurs). When the minOccurs attribute for a schema element is equal to zero, createDefaultDocument will not output a place holder for this element unless forceMinOccurs is set to a value greater than zero. The maxOccurs attribute will still be enforced as the maximum number of occurances for an element. For example, if a given element has a minOccurs of zero and a maxOccurs of one, with forceMinOccurs set to 5 would cause the element to appear one time in accordance with the maxOccurs attribute. But, if forceMinOccurs is not set or set to zero, the element will not appear at all in accordance with the minOccurs attribute.

  Parameters:
    `forceMinOccurs` - a signed positive integer or -1 if you do not want to force minOccurs

### getForceMinOccurs

    public int getForceMinOccurs()

  Force minOccurs value.

  Returns:
    the value set by setForceMinOccurs() method

### setForceAttrValues

    public void setForceAttrValues(boolean forceAttrValues)

  Force Element attributes. By default, element attributes that do not have a fixed or default value are not created in the default document. To force the attribute to show up in the default document, set forceAttrValues to true.

  Parameters:
    `forceAttrValues` - true to force default element attributes to appear

### getForceAttrValues

    public boolean getForceAttrValues()

  Force Attribute values.

  Returns:
    the value set by setForceAttrValues() method

### setSchemaLocation

    public void setSchemaLocation(String targetNamespace,
                                  String schemaLocation)

  set xsi document attribute. Using this method will add the xmlns:xsi attribute to the default document's root element. Example: options.setSchemaLocation("http://www.bea.com/xml/schema", "http://www.bea.com/xml/schema.xsd"); results in the following (if the SOMSchema used the 2001 namespace):

       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       targetNamespace="http://www.bea.com/xml/schema"
       xsi:schemaLocation="http://www.bea.com/xml/schema.xsd"

  Parameters:
    `schemaLocation` - the URL of the schema

### setSchemaLocation

    public void setSchemaLocation(String schemaLocation)

  set xsi document attribute. Using this method will add the xmlns:xsi attribute to the default document's root element. Example: options.setSchemaLocation("http://www.bea.com/xml/schema"); results in the following (if the SOMSchema used the 2001 namespace):

       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:noNamespaceSchemaLocation="http://www.bea.com/xml/schema"

  Parameters:
    `schemaLocation` - the URL of the schema

### getSchemaLocation

    public String getSchemaLocation()

### getTargetNamespace

    public String getTargetNamespace()

### setNamespacesEnabled

    public void setNamespacesEnabled(boolean newValue)

  Set namespace usage enabled/disabled when generating default XML. This option is disabled by default. Enabling namespaces here will cause default documents to declare a namespace in their root element, and if a prefix is given, to use the prefix in all elements and attributes.

### getNamespacesEnabled

    public boolean getNamespacesEnabled()

  Get an indication of whether namespaces will be honored/used in the default document generated.

### setNamespacePrefix

    public void setNamespacePrefix(String prefix)

  Set the namespace prefix to use in the default document (ignored if getNamespacesEnabled() returns false.

### getNamespacePrefix

    public String getNamespacePrefix()

  Get the namespace prefix that will be used in the default document.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD