DEPRECATED

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

public class DefaultDocumentSchema
extends `Object`
implements `com.bea.p13n.content.document.spi.DocumentSchemaDef`

A concrete, base implementation of a document schema.

Hierarchy
  `Object`
  `DefaultDocumentSchema`

All Implemented Interfaces
  `com.bea.p13n.content.document.spi.DocumentSchemaDef`

## Nested Class Summary

`public static class` | `com.bea.p13n.content.document.ref.DefaultDocumentSchema.PropertyInfo` Helper data structure.

## Field Summary

`protected `String`` | `description` The schema description.
`protected `String`` | `name` The schema name.
`protected `Map`` | `properties` The map of property name to property info.

## Constructor Summary

DefaultDocumentSchema(`String` name) Constructor.

## Method Summary

`public `Object`` | `getAttributeDefaultValue`(`String` name) Get the default value for the attribute.
`public `String`` | `getAttributeDescription`(`String` name) Get the description for the named attribute.
`public `Collection`` | `getAttributeNames`() Get the list of valid property names.
`public `List`` | `getAttributePossibleValues`(`String` name) Get the possible values for the attribute.
`public int` | `getAttributeType`(`String` name) Get the attribute type.
`public `String`` | `getDescription`() Get the schema description.
`public `String`` | `getName`() Get the schema name.
`public `DefaultDocumentSchema.PropertyInfo`` | `getPropertyInfo`(`String` name) Get the info for the named property.
`public boolean` | `isAttributeMultiValued`(`String` name) Determine if the attribute is multi-valued.
`public void` | `setDescription`(`String` d) Set the schema description.
`public void` | `setName`(`String` name) Set the schema name.
`public void` | `setProperty`(`String` name, int type, `Object` defValue, boolean isMultiValued, `List` possibleValues, `String` description) Set the info the named property.
`public void` | `setPropertyInfo`(`String` name, `DefaultDocumentSchema.PropertyInfo` info) Set the info for the named property.
`public boolean` | `validateAttribute`(`String` name, `Object` value) Validate the specified attribute against the given value.
`public static boolean` | `validateAttribute`(`DefaultDocumentSchema.PropertyInfo` info, `Object` value) Validate the attribute value against the given property info.
`public static boolean` | `validateAttribute`(int type, `Object` value) Validate the attribute value against the specified type.

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

Methods from interface `com.bea.p13n.content.document.spi.`com.bea.p13n.content.document.spi.DocumentSchemaDef``
``getAttributeDefaultValue`, `getAttributeDescription`, `getAttributeNames`, `getAttributePossibleValues`, `getAttributeType`, `getDescription`, `getName`, `isAttributeMultiValued`, `validateAttribute``

## Field Detail

### description

    protected String description

  The schema description.

### name

    protected String name

  The schema name.

### properties

    protected Map properties

  The map of property name to property info.

## Constructor Detail

### DefaultDocumentSchema

    public DefaultDocumentSchema(String name)

  Constructor.

## Method Detail

### getAttributeDefaultValue(String) Method

    public Object getAttributeDefaultValue(String name)
         throws DocumentException

Get the default value for the attribute.

#### Parameters

name
  the name of the attribute.

#### Returns

the default value, or null for none.

#### Exceptions

``DocumentException``

### getAttributeDescription(String) Method

    public String getAttributeDescription(String name)
         throws DocumentException

Get the description for the named attribute.

#### Parameters

name
  the name of the attribute.

#### Returns

the description, or null for none.

#### Exceptions

``DocumentException``

### getAttributeNames() Method

    public Collection getAttributeNames()

Get the list of valid property names.

#### Returns

the list of String attribute names.

### getAttributePossibleValues(String) Method

    public List getAttributePossibleValues(String name)
         throws DocumentException

Get the possible values for the attribute.

#### Parameters

name
  the name of the attribute.

#### Returns

the list of possible values.

#### Exceptions

``DocumentException``

### getAttributeType(String) Method

    public int getAttributeType(String name)
         throws DocumentException

Get the attribute type.

#### Parameters

name
  the name of the attribute.

#### Returns

the int type (one of TEXT, INTEGER, FLOAT, BOOLEAN, DATE, or USER_DEFINED).

#### Exceptions

``DocumentException``

### getDescription() Method

    public String getDescription()

Get the schema description.

#### Returns

the description of the schema (null for none).

### getName() Method

    public String getName()

Get the schema name.

#### Returns

the String schema name.

### getPropertyInfo(String) Method

    public DefaultDocumentSchema.PropertyInfo getPropertyInfo(String name)
         throws DocumentException

Get the info for the named property.

#### Parameters

name
  the property name.

#### Returns

the info for the property.

#### Exceptions

``DocumentException``
  thrown if the propert info doesn't exist.

### isAttributeMultiValued(String) Method

    public boolean isAttributeMultiValued(String name)
         throws DocumentException

Determine if the attribute is multi-valued.

#### Parameters

name
  the name of the attribute.

#### Returns

true if multi-valued, false if not

#### Exceptions

``DocumentException``

### setDescription(String) Method

    public void setDescription(String d)

Set the schema description.

### setName(String) Method

    public void setName(String name)

Set the schema name.

### setProperty(String, int, Object, boolean, List, String) Method

    public void setProperty(String name,
                            int type,
                            Object defValue,
                            boolean isMultiValued,
                            List possibleValues,
                            String description)

Set the info the named property.

### setPropertyInfo(String, DefaultDocumentSchema.PropertyInfo) Method

    public void setPropertyInfo(String name,
                                DefaultDocumentSchema.PropertyInfo info)

Set the info for the named property.

#### Parameters

name
  the property name.

info
  the property info (null to remove).

### validateAttribute(String, Object) Method

    public boolean validateAttribute(String name,
                                     Object value)
         throws DocumentException

Validate the specified attribute against the given value.

#### Parameters

name
  the name of the attribute.

value
  the suggested value for the attribute.

#### Returns

true if the value valid, false if not.

#### Exceptions

``DocumentException``

### validateAttribute(DefaultDocumentSchema.PropertyInfo, Object) Method

    public static boolean validateAttribute(DefaultDocumentSchema.PropertyInfo info,
                                            Object value)

Validate the attribute value against the given property info.

### validateAttribute(int, Object) Method

    public static boolean validateAttribute(int type,
                                            Object value)

Validate the attribute value against the specified type.