Overview | Package | Class | Tree | Deprecated | Index | Help
| © 2002 BEA Systems, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.bea.p13n.content.document.spi
Interface DocumentSchemaDef

All Known Implementing Classes:
  DefaultDocumentSchema

public interface DocumentSchemaDef

An object representing a schema for a set of the documents.

Field Summary
`static int` | `BOOLEAN` Specifies a boolean attribute (0).
`static int` | `DATETIME` Specifies a date/time attribute (4).
`static int` | `FLOAT` Specifies a float attribute (2).
`static int` | `INTEGER` Specifies an integer attribute (1).
`static int` | `TEXT` Specifies a text attribute (3).
`static int` | `USER_DEFINED` Specifes a user definined (object) attribute (5).

Method Summary
`java.lang.Object` | `getAttributeDefaultValue(java.lang.String attributeName)` Get the default value for the named attribute.
`java.lang.String` | `getAttributeDescription(java.lang.String attributeName)` Get a text description of the attribute.
`java.util.Collection` | `getAttributeNames()` Returns the list of valid attribute names in this schema.
`java.util.List` | `getAttributePossibleValues(java.lang.String attributeName)` Return the list of possible values for a multi-vauled attribute.
`int` | `getAttributeType(java.lang.String attributeName)` Returns the type of the named attribute.
`java.lang.String` | `getDescription()` Returns the schema description.
`java.lang.String` | `getName()` Returns the schema name.
`boolean` | `isAttributeMultiValued(java.lang.String attributeName)` Tell if the named attribute is a multi-valued attribute (i.e.
`boolean` | `validateAttribute(java.lang.String attributeName, java.lang.Object attributeValue)` Validate that a given attribute value is valid based upon the schema information.

Field Detail

### BOOLEAN

    public static final int BOOLEAN

  Specifies a boolean attribute (0).

### INTEGER

    public static final int INTEGER

  Specifies an integer attribute (1).

### FLOAT

    public static final int FLOAT

  Specifies a float attribute (2).

### TEXT

    public static final int TEXT

  Specifies a text attribute (3).

### DATETIME

    public static final int DATETIME

  Specifies a date/time attribute (4).

### USER_DEFINED

    public static final int USER_DEFINED

  Specifes a user definined (object) attribute (5).

Method Detail

### getName

    public java.lang.String getName()
                             throws DocumentException

  Returns the schema name.

  Returns:
    the String schema name.
  Throws:
    DocumentException - thrown on an error.

### getDescription

    public java.lang.String getDescription()
                                    throws DocumentException

  Returns the schema description.

  Returns:
    the description of the schema (null for none).
  Throws:
    DocumentException - thrown on an error.

### getAttributeNames

    public java.util.Collection getAttributeNames()
                                           throws DocumentException

  Returns the list of valid attribute names in this schema.

  Returns:
    the list of String attribute names.
  Throws:
    DocumentException - thrown on an error.

### getAttributeType

    public int getAttributeType(java.lang.String attributeName)
                         throws DocumentException

  Returns the type of the named attribute.

  Parameters:
    `attributeName` - the name of the attribute.
  Returns:
    the int type (one of TEXT, INTEGER, FLOAT, BOOLEAN, DATE, or USER_DEFINED).
  Throws:
    DocumentException - thrown on an error.
  See Also:
    `TEXT`, `INTEGER`, `FLOAT`, `BOOLEAN`, `DATETIME`, `USER_DEFINED`

### getAttributeDefaultValue

    public java.lang.Object getAttributeDefaultValue(java.lang.String attributeName)
                                              throws DocumentException

  Get the default value for the named attribute.

  Parameters:
    `attributeName` - the name of the attribute.
  Returns:
    the default value, or null for none.
  Throws:
    DocumentException - thrown on an error.

### getAttributeDescription

    public java.lang.String getAttributeDescription(java.lang.String attributeName)
                                             throws DocumentException

  Get a text description of the attribute.

  Parameters:
    `attributeName` - the name of the attribute.
  Returns:
    the description, or null for none.
  Throws:
    DocumentException - thrown on an error.

### isAttributeMultiValued

    public boolean isAttributeMultiValued(java.lang.String attributeName)
                                   throws DocumentException

  Tell if the named attribute is a multi-valued attribute (i.e. its value in the DocumentMetadata is really a List).

  Parameters:
    `attributeName` - the name of the attribute.
  Returns:
    true if multi-valued, false if not
  Throws:
    DocumentException - thrown on an error.

### getAttributePossibleValues

    public java.util.List getAttributePossibleValues(java.lang.String attributeName)
                                              throws DocumentException

  Return the list of possible values for a multi-vauled attribute.

  This returns null for non multi-valued attributes and multi-valued attributes which are not restricted to a set of possible values.

  Parameters:
    `attributeName` - the name of the attribute.
  Returns:
    the list of possible values.
  Throws:
    DocumentException - thrown on an error.

### validateAttribute

    public boolean validateAttribute(java.lang.String attributeName,
                                     java.lang.Object attributeValue)
                              throws DocumentException

  Validate that a given attribute value is valid based upon the schema information.

  Parameters:
    `attributeName` - the name of the attribute.
    `attributeValue` - the suggested value for the attribute.
  Returns:
    true if the value valid, false if not.
  Throws:
    DocumentException - thrown on an error.

Overview | Package | Class | Tree | Deprecated | Index | Help
| © 2002 BEA Systems, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2002 BEA Systems, Inc. All Rights Reserved