DEPRECATED

# com.bea.p13n.content.document.ref
RefSchemaGenerator Class

public class RefSchemaGenerator
extends `Object`

A utility class which can generate DocumentSchemaDefs from an XML file.

This supports both the "doc-schemas" DTD and the Interwoven datacapture.cfg 4.0 DTD (except for replicants, which are ignored).

Hierarchy
  `Object`
  `RefSchemaGenerator`

## Constructor Summary

RefSchemaGenerator()

## Method Summary

`public static void` | `addIWProperty`(`Element` e, `DefaultDocumentSchema` schema) Add a property entry to a schema from an interwoven "item" element.
`public static void` | `addProperty`(`Element` e, `DefaultDocumentSchema` schema) Add the attribute information in the given "attribute" element (following the doc-schemas DTD) to the specified schema.
`public static `Parser`` | `createParser`() Create a SAX parser for use.
`public static `DocumentBuilder`` | `getDocumentBuilder`() Get a DocumentBuilder to use when parsing schema documents This will return at least a non-validating DocumentBuilder.
`public static `DocumentSchemaDef`` | `getIWSchema`(`Element` e) Get a DocumentSchemaDef from a "ruleset" IW element.
`public static `List`` | `getIWSchemas`(`String` uri, `Element` root) Get the list of DocumentSchemaDefs from the Interwoven datacapture DTD element.
`public static `DefaultDocumentSchema`` | `getSchema`(`Element` e) Get a DefaultDocumentSchema from a Element following the doc-schemas DTD.
`public static `List`` | `getSchemas`(`String` uri) Get a list of DocumentSchemaDefs from the XML at path.
`public static `List`` | `getSchemas`(`String` uri, `Element` root) Get the list of DocumentSchemaDefs from the doc-schemas DTD element.

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

## Constructor Detail

### RefSchemaGenerator

    public RefSchemaGenerator()

## Method Detail

### addIWProperty(Element, DefaultDocumentSchema) Method

    public static void addIWProperty(Element e,
                                     DefaultDocumentSchema schema)
         throws DocumentException

Add a property entry to a schema from an interwoven "item" element.

For now, we're not going to investigate the "item" any further. This means replicants and options are ignored.

#### Exceptions

``DocumentException``

### addProperty(Element, DefaultDocumentSchema) Method

    public static void addProperty(Element e,
                                   DefaultDocumentSchema schema)
         throws DocumentException

Add the attribute information in the given "attribute" element (following the doc-schemas DTD) to the specified schema.

This will throw a DocumentException on any error (i.e. it will not try to do its best with what it has, but will stop on any problem).

#### Parameters

e
  the "attribute" element.

schema
  the schema to add the property info to.

#### Exceptions

``DocumentException``
  thrown on any invalid XML.

### createParser() Method

DEPRECATED Not needed.

    public static Parser createParser()
         throws DocumentException

Create a SAX parser for use.

#### Exceptions

``DocumentException``

### getDocumentBuilder() Method

    public static DocumentBuilder getDocumentBuilder()
         throws DocumentException

Get a DocumentBuilder to use when parsing schema documents

This will return at least a non-validating DocumentBuilder.

#### Exceptions

``DocumentException``
  thrown when JAXP fails (unrecoverable).

### getIWSchema(Element) Method

    public static DocumentSchemaDef getIWSchema(Element e)
         throws DocumentException

Get a DocumentSchemaDef from a "ruleset" IW element.

#### Exceptions

``DocumentException``

### getIWSchemas(String, Element) Method

    public static List getIWSchemas(String uri,
                                    Element root)
         throws DocumentException

Get the list of DocumentSchemaDefs from the Interwoven datacapture DTD element.

#### Exceptions

``DocumentException``

### getSchema(Element) Method

    public static DefaultDocumentSchema getSchema(Element e)
         throws DocumentException

Get a DefaultDocumentSchema from a Element following the doc-schemas DTD.

#### Parameters

e
  the "doc-schema" Element.

#### Returns

a DefaultDocumentSchema of the schema described in the element.

#### Exceptions

``DocumentException``
  thrown in invalid XML.

### getSchemas(String) Method

    public static List getSchemas(String uri)
         throws DocumentException

Get a list of DocumentSchemaDefs from the XML at path.

Currently, that XML must be either of the doc-schemas DTD or the Interwoven datacapture DTD. If the document structure is wrong at any point, the schema will be completely ignored.

#### Parameters

uri
  the URI to the xml.

#### Returns

the list of DocumentSchemaDefs.

#### Exceptions

``DocumentException``
  thrown on a parsing error or invalid XML.

### getSchemas(String, Element) Method

    public static List getSchemas(String uri,
                                  Element root)
         throws DocumentException

Get the list of DocumentSchemaDefs from the doc-schemas DTD element.

#### Parameters

uri
  the "doc-schemas" Element.

#### Returns

a list of the DocumentSchemaDefs.

#### Exceptions

``DocumentException``
  thrown on an unrecoverable error getting the schemas.