com.infoengine.schema
Class SimpleType

java.lang.Object
  extended by com.infoengine.schema.Type
      extended by com.infoengine.schema.SimpleType
All Implemented Interfaces:
java.io.Serializable

public class SimpleType
extends Type
implements java.io.Serializable

Represents simple object schema. A SimpleType contains information relative to an object or attribute's base data type and constraint or enumeration information.

A SimpleType, if based on a numeric type, may be constrained by 0 or more ranges. A SimpleType may define a finite set of EnumeratedValues associated with it. A SimpleType may contain a set of Ranges, a set of EnumeratedValues or neither, but never both.

See Also:
Serialized Form

Constructor Summary
SimpleType()
           
 
Method Summary
 void addRange(Range r)
          Add Range r to the end of the Ranges array.
 void addValue(EnumeratedValue ev)
          Add EnumeratedValue ev to the end of the Values array.
 java.lang.String getBaseType()
          Get the base data type of this type
 EnumeratedValue getDefaultEnumeratedValue()
          Get the default enumerated value.
 java.lang.String getDefaultValue()
          Get the default value
 EnumeratedValue getEnumeratedValueByValue(java.lang.String value)
          Get an EnumeratedValue instance by its value.
 java.lang.String getEnumerationTask()
          Get the enumerationTask property value
 int getMaxStringLength()
          Get the maximum string length This property should be ignored for data types that aren't string based.
 Range[] getRanges()
          Get the entire array of Ranges.
 Range getRanges(int index)
          Get a Range by index from the contained array of Ranges.
 EnumeratedValue[] getValues()
          Get the entire list of EnumeratedValues
 EnumeratedValue getValues(int index)
          Get an EnumeratedValue by index from the array of contained EnumeratedValue.
 boolean isConstrained()
          Determine if this SimpleType contains constraints (Ranges).
 boolean isEnumerated()
          Determine if this SimpleType contains EnumeratedValues.
 void setBaseType(java.lang.String s)
          Set the base data type of this type
 void setDefaultValue(java.lang.String s)
          Set the default value
 void setEnumerationTask(java.lang.String t)
          Set the enumerationTask property value
 void setMaxStringLength(int l)
          Set the maximum string length This property should be ignored for data types that aren't string based.
 void setRanges(int index, Range r)
          Set the value of a Range at an index in the contained array of Ranges.
 void setRanges(Range[] vals)
          Set the array of Ranges.
 void setValues(EnumeratedValue[] vals)
          Set the entire array of EnumeratedValues.
 void setValues(int index, EnumeratedValue ev)
          Set the value of the EnumeratedValue at index in the array of contained EnumeratedValues.
 
Methods inherited from class com.infoengine.schema.Type
addSuperType, getResourceBundle, getSuperType, getSuperTypes, getSuperTypes, getTypeId, setResourceBundle, setSuperTypes, setSuperTypes, setTypeId
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleType

public SimpleType()
Method Detail

setBaseType

public void setBaseType(java.lang.String s)
Set the base data type of this type

Parameters:
s - the new base data type

getBaseType

public java.lang.String getBaseType()
Get the base data type of this type

Returns:
the base data type

setDefaultValue

public void setDefaultValue(java.lang.String s)
Set the default value

Parameters:
s - the new default value

getDefaultValue

public java.lang.String getDefaultValue()
Get the default value

Returns:
the default value if set

setMaxStringLength

public void setMaxStringLength(int l)
Set the maximum string length This property should be ignored for data types that aren't string based.

A negative value is assumed to mean no restriction is placed on length.

Parameters:
l - the new maximum string length

getMaxStringLength

public int getMaxStringLength()
Get the maximum string length This property should be ignored for data types that aren't string based.

A negative value is assumed to mean no restriction is placed on length.

Returns:
the maximum string length

getDefaultEnumeratedValue

public EnumeratedValue getDefaultEnumeratedValue()
Get the default enumerated value.

Returns:
default value or null if not enumerated or no default

setEnumerationTask

public void setEnumerationTask(java.lang.String t)
Set the enumerationTask property value

This property value is used to support "dynamic enumeration" of a SimpleType. It's value is only used by Info*Engine tools and the Query-Schema webject to populate enumerated values dynamically when schema is retrieved from its source.

This property can be ignored by clients.

Parameters:
t - the new property value

getEnumerationTask

public java.lang.String getEnumerationTask()
Get the enumerationTask property value

This property value is used to support "dynamic enumeration" of a SimpleType. It's value is only used by Info*Engine tools and the Query-Schema webject to populate enumerated values dynamically when schema is retrieved from its source.

This property can be ignored by clients.

Returns:
the property value

setValues

public void setValues(int index,
                      EnumeratedValue ev)
Set the value of the EnumeratedValue at index in the array of contained EnumeratedValues. If index is greater than the current size of the array then the value will be added to the end of the array. Calling this method will clear any previously held Ranges.

Parameters:
index - the index to set ev the EnumeratedValue to store

getValues

public EnumeratedValue getValues(int index)
Get an EnumeratedValue by index from the array of contained EnumeratedValue.

Parameters:
index - the index to retrieve
Returns:
an EnumeratedValue or null on an invalid index

setValues

public void setValues(EnumeratedValue[] vals)
Set the entire array of EnumeratedValues. Calling this method will clear any previously existing Ranges.

Parameters:
values - the new list of EnumeratedValues

getValues

public EnumeratedValue[] getValues()
Get the entire list of EnumeratedValues

Returns:
the array or null if no values

setRanges

public void setRanges(int index,
                      Range r)
Set the value of a Range at an index in the contained array of Ranges. If index is greater than the length of the current array then r will be appended to the end of the array. Calling this method will clear any previously held EnumeratedValues.

Parameters:
index - the index to set r the Range object to set

getRanges

public Range getRanges(int index)
Get a Range by index from the contained array of Ranges.

Returns:
a Range or null on invalid index

setRanges

public void setRanges(Range[] vals)
Set the array of Ranges. Calling this method will clear any previously held EnumeratedValues.

Parameters:
vals - the new array of Ranges

getRanges

public Range[] getRanges()
Get the entire array of Ranges.

Returns:
the array of Ranges or null

addRange

public void addRange(Range r)
Add Range r to the end of the Ranges array. Calling this method will clear any previously held EnumeratedValues.

Parameters:
r - the Range to append

addValue

public void addValue(EnumeratedValue ev)
Add EnumeratedValue ev to the end of the Values array. Calling this method will clear any previously held Ranges.

Parameters:
ev - the EnumeratedValue to append

getEnumeratedValueByValue

public EnumeratedValue getEnumeratedValueByValue(java.lang.String value)
Get an EnumeratedValue instance by its value.

Parameters:
value - the value to search for
Returns:
an EnumeratedValue or null if not found

isConstrained

public boolean isConstrained()
Determine if this SimpleType contains constraints (Ranges).

Returns:
true if constrained

isEnumerated

public boolean isEnumerated()
Determine if this SimpleType contains EnumeratedValues.

Parameters:
true - if enumerated