DefaultDocumentSchema Class
DEPRECATED
- 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
Methods from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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.
DefaultDocumentSchema
public DefaultDocumentSchema(String
name)
- Constructor.
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.