## gate.creole
Class FeatureSchema

    java.lang.Object
      |
      +--gate.creole.FeatureSchema

All Implemented Interfaces:
  Serializable

public class FeatureSchema
extends Object
implements Serializable

This class describes a schema for a feature. It is used as part of `AnnotationSchema` class.

See Also:
  Serialized Form

Field Summary
`private static boolean` `DEBUG` Debug flag
`(package private) String` `featureName` The name of this feature.
`(package private) Set` `featurePermissibleValuesSet` Permisible value set, if appropriate.
`(package private) String` `featureUse` The use of that feature can be one of: prohibited | optional | required | default | fixed : optional
`(package private) String` `featureValue` The value of the feature.
`(package private) String` `featureValueClassName` The class name of the feature value

Constructor Summary
`FeatureSchema(String aFeatureName, String aFeatureValueClassName, String aFeatureValue, String aFeatureUse, Set aFeaturePermissibleValuesSet)` Construction given a name of an feature and a feature value class name

Method Summary
`boolean` `addPermissibleValue(Object obj)` Adds a value to the enumeration of permissible value for an feature of this type.
`String` `getFeatureName()` Get the feature name
`String` `getFeatureValue()` This method returns the value of the feature.
`Set` `getPermissibleValues()` Returns the permissible values as a Set
`String` `getValueClassName()` Get the feature value class name
`boolean` `isDefault()` This method is used to check if the feature is default.
`boolean` `isEnumeration()` Tests whether the values are an enumeration or not.
`boolean` `isFixed()` This method is used to check if the feature, is fixed.
`boolean` `isOptional()` This method is used to check if the feature is optional.
`boolean` `isProhibited()` This method is used to check if the feature is prohibited.
`boolean` `isRequired()` This method is used to check if the feature is required.
`void` `setFeatureValue(String aFeatureValue)` This method sets the value of the feature.
`boolean` `setPermissibleValues(Set aPermisibleValuesSet)` Adds all values from the given set as permissible values for the given feature.
`String` `toXSchema(Map aJava2XSchemaMap)` This method transforms a feature to its XSchema representation.

Methods inherited from class java.lang.Object
`<clinit>, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait`

Field Detail

### DEBUG

    private static final boolean DEBUG

  Debug flag

### featureName

    String featureName

  The name of this feature.

### featureValueClassName

    String featureValueClassName

  The class name of the feature value

### featureValue

    String featureValue

  The value of the feature. This must be read only when "use" is default or fixed.

### featureUse

    String featureUse

  The use of that feature can be one of: prohibited | optional | required | default | fixed : optional

### featurePermissibleValuesSet

    Set featurePermissibleValuesSet

  Permisible value set, if appropriate.

Constructor Detail

### FeatureSchema

    public FeatureSchema(String aFeatureName,
                         String aFeatureValueClassName,
                         String aFeatureValue,
                         String aFeatureUse,
                         Set aFeaturePermissibleValuesSet)

  Construction given a name of an feature and a feature value class name

Method Detail

### isEnumeration

    public boolean isEnumeration()

  Tests whether the values are an enumeration or not.

### getFeatureName

    public String getFeatureName()

  Get the feature name

### getValueClassName

    public String getValueClassName()

  Get the feature value class name

### getPermissibleValues

    public Set getPermissibleValues()

  Returns the permissible values as a Set

### setPermissibleValues

    public boolean setPermissibleValues(Set aPermisibleValuesSet)

  Adds all values from the given set as permissible values for the given feature. No check is performed to see if the class name of the feature value is the same as the the elements of the given set. Returns true if the set has been assigned.

### addPermissibleValue

    public boolean addPermissibleValue(Object obj)

  Adds a value to the enumeration of permissible value for an feature of this type. Returns false, i.e. fails, if the class name of the feature value does not match the class name of the given object
  Parameters:
    `obj` - the object representing a permissible value. If null then simply returns with false.

### toXSchema

    public String toXSchema(Map aJava2XSchemaMap)

  This method transforms a feature to its XSchema representation. It is used in toXSchema().
  Parameters:
    `aJava2XSchemaMap` - a Java map object that will be serialized in XSchema
  Returns:
    a String containing the XSchema representation

### getFeatureValue

    public String getFeatureValue()

  This method returns the value of the feature. If featureUse is something else than "default" or "fixed" it will return the empty string "".

### setFeatureValue

    public void setFeatureValue(String aFeatureValue)

  This method sets the value of the feature.
  Parameters:
    `aFeatureValue` - a String representing the value of a feature.

### isRequired

    public boolean isRequired()

  This method is used to check if the feature is required.
  Returns:
    true if the feature is required. Otherwhise returns false

### isDefault

    public boolean isDefault()

  This method is used to check if the feature is default. Default is used if the feature was omitted.
  Returns:
    true if the feature is default. Otherwhise returns false

### isFixed

    public boolean isFixed()

  This method is used to check if the feature, is fixed.
  Returns:
    true if the feature is fixed. Otherwhise returns false

### isOptional

    public boolean isOptional()

  This method is used to check if the feature is optional.
  Returns:
    true if the optional is fixed. Otherwhise returns false

### isProhibited

    public boolean isProhibited()

  This method is used to check if the feature is prohibited.
  Returns:
    true if the prohibited is fixed. Otherwhise returns false