BEA Systems, Inc.

com.beasys.commerce.axiom.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.
static int DATETIME
          Specifies a date/time attribute.
static int FLOAT
          Specifies a float attribute.
static int INTEGER
          Specifies an integer attribute.
static int TEXT
          Specifies a text attribute.
static int USER_DEFINED
          Specifes a user definined (object) attribute.
 
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

TEXT

public static final int TEXT
Specifies a text attribute.
See Also:
TypesHelper.TEXT

INTEGER

public static final int INTEGER
Specifies an integer attribute.
See Also:
TypesHelper.INTEGER

FLOAT

public static final int FLOAT
Specifies a float attribute.
See Also:
TypesHelper.FLOAT

BOOLEAN

public static final int BOOLEAN
Specifies a boolean attribute.
See Also:
TypesHelper.BOOLEAN

DATETIME

public static final int DATETIME
Specifies a date/time attribute.
See Also:
TypesHelper.DATETIME

USER_DEFINED

public static final int USER_DEFINED
Specifes a user definined (object) attribute.
See Also:
TypesHelper.USER_DEFINED
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.

BEA Systems, Inc.

Copyright © 2000 BEA Systems, Inc. All Rights Reserved