kaos.xmlschema.util
Interface XMLSchemaBuilder

All Superinterfaces:
KAoSInstanceDescription
All Known Implementing Classes:
XMLSchemaBuilderImpl

public interface XMLSchemaBuilder
extends KAoSInstanceDescription


Method Summary
 java.lang.String convertToSchema()
          convert this data type to its xml schema definition.
 void deriveDataType(java.lang.String nameSpace, java.lang.String localName)
          derive this data type from its parent and from the restrictions set on it.
 java.lang.String getBaseDataTypeName()
          get the name of the parent data type of this type.
 java.lang.String getCurrentDataTypeName()
          get the name of this data type.
 java.util.Vector getCurrentRestrictionNames()
          get the names of al restrictions that are set on this data type.
 java.lang.String getRestrictionValue(java.lang.String restrictionName)
          get the value of the given restriction.
 boolean isValid(java.lang.String value)
          check if the given value is allowed by the restrictions in this schema.
 void readFromSchema(java.util.Vector types)
          create this data type by reading schema its definitions.
 void setRestrictionValue(java.lang.String restrictionName, java.lang.String value)
          set the given restriction with its value on this data type.
 

Method Detail

getBaseDataTypeName

java.lang.String getBaseDataTypeName()
get the name of the parent data type of this type.

Returns:
the name of the parent data type. Null if not set.

getCurrentDataTypeName

java.lang.String getCurrentDataTypeName()
get the name of this data type.

Returns:
the name of this data type. Null if not set.

deriveDataType

void deriveDataType(java.lang.String nameSpace,
                    java.lang.String localName)
                    throws DatatypeException
derive this data type from its parent and from the restrictions set on it.

Parameters:
nameSpace - the name space of the data type.
localName - the name of this data type.
Throws:
DatatypeException

setRestrictionValue

void setRestrictionValue(java.lang.String restrictionName,
                         java.lang.String value)
                         throws DatatypeException
set the given restriction with its value on this data type.

Parameters:
restrictionNamet - the name of restriction (e.g. minLength).
value - the value of that restriction.
Throws:
DatatypeException

getRestrictionValue

java.lang.String getRestrictionValue(java.lang.String restrictionName)
get the value of the given restriction.

Parameters:
restrictionNamet - the name of restriction (e.g. minLength).
Returns:
the value of the restriction. Null if not set.

getCurrentRestrictionNames

java.util.Vector getCurrentRestrictionNames()
get the names of al restrictions that are set on this data type.

Returns:
a vector containing names of all these restrictions.

isValid

boolean isValid(java.lang.String value)
check if the given value is allowed by the restrictions in this schema.

Parameters:
value - the value to be checked.
Returns:
true is allowed, false if not.

convertToSchema

java.lang.String convertToSchema()
convert this data type to its xml schema definition.

Returns:
a String containing this schema definition.

readFromSchema

void readFromSchema(java.util.Vector types)
                    throws DatatypeException
create this data type by reading schema its definitions. Note that a data type can inherit from a chain of parent data types.

Parameters:
types - a Vector containing xml definitions for this and its parent data types.
Throws:
DatatypeException