|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbiz.c24.io.api.data.DefaultEnumeration
public class DefaultEnumeration
The default enumeration implementation.
Warning: Serialized objects of this class or of a deployed class which is derived from it may not be compatible with future releases of C24 Integreation Objects. The current serialization support is appropriate for short term storage or RMI between applications running the same version of C24 Integreation Objects.
Constructor Summary | |
---|---|
DefaultEnumeration()
Creates a new instance. |
Method Summary | |
---|---|
void |
addEntry(String value,
String name,
Annotation annotation)
Adds a new entry. |
void |
addEntry(String value,
String name,
Annotation annotation,
int index)
Adds a new entry at the specified index. |
void |
addEntryWithDescription(String value,
String name,
String description)
Adds a new entry with a simple description. |
void |
addNumericRange(int fromInclusive,
int toInclusive,
boolean padToMaxSize)
|
Annotation |
getAnnotation()
Returns the annotation associated with this enumeration. |
Annotation |
getAnnotation(int index)
Returns the annotation associated with the enumeration value at index. |
int |
getCount()
Returns the number of enumeration values. |
String |
getErrorCode()
Returns the error code for this enumeration. |
int |
getIndex(String value)
Returns the first index of value or -1 if it was not found. |
String |
getName()
Returns the name of this component. |
String |
getName(int index)
Returns the name associated with the enumeration value at index. |
String |
getValue(int index)
Returns the enumeration value at index. |
boolean |
isCaseSensitive()
Returns whether equality comparisons should consider case. |
void |
removeEntry(int index)
Removes an entry. |
void |
setAnnotation(Annotation annotation)
Sets the annotation. |
void |
setCaseSensitive(boolean caseSensitive)
Sets whether equality comparisons should consider case. |
void |
setErrorCode(String errorCode)
Sets the error code |
void |
setName(String name)
Sets the name. |
String |
toString()
|
boolean |
validate(Object object,
DataComponent component,
ComplexDataObject context,
ValidationManager manager)
Validate the given object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DefaultEnumeration()
Method Detail |
---|
public void setName(String name)
name
- The name.public String getName()
ModelComponent
getName
in interface ModelComponent
public void setAnnotation(Annotation annotation)
annotation
- The annotation.public Annotation getAnnotation()
Enumeration
getAnnotation
in interface Enumeration
public void setErrorCode(String errorCode)
errorCode
- public String getErrorCode()
Enumeration
getErrorCode
in interface Enumeration
public boolean isCaseSensitive()
public void setCaseSensitive(boolean caseSensitive)
caseSensitive
- Whether to perform case sensitive equals checkspublic void addEntry(String value, String name, Annotation annotation)
value
- The value.name
- The name.annotation
- The annotation.
NullPointerException
- If value is null
.public void addEntry(String value, String name, Annotation annotation, int index)
value
- The value.name
- The name.annotation
- The annotation.index
- The index at which to add the entry.
NullPointerException
- If value is null
.public void addEntryWithDescription(String value, String name, String description)
value
- The value.name
- The name.description
- The description to be wrapped in an annotation.
NullPointerException
- If value is null
.public void addNumericRange(int fromInclusive, int toInclusive, boolean padToMaxSize)
public void removeEntry(int index)
index
- The index of the entry to be removed.
IndexOutOfBoundsException
- if the index is out of range (index < 0 || index >= getCount()).public int getIndex(String value)
Enumeration
value
or -1
if it was not found.
getIndex
in interface Enumeration
value
- The value to look for.
value
or -1
if it was not found.public int getCount()
Enumeration
getCount
in interface Enumeration
public String getValue(int index)
Enumeration
index.
- Specified by:
getValue
in interface Enumeration
- Parameters:
index
- The index of the value to return.
- Returns:
- The value at
index
.
public String getName(int index)
Enumeration
index.
- Specified by:
getName
in interface Enumeration
- Parameters:
index
- The index of the name to return.
- Returns:
- The name at
index
.
public Annotation getAnnotation(int index)
Enumeration
index.
- Specified by:
getAnnotation
in interface Enumeration
- Parameters:
index
- The index of the annotation to return.
- Returns:
- The name at
index
.
public boolean validate(Object object, DataComponent component, ComplexDataObject context, ValidationManager manager) throws ValidationException
Validator
validate
in interface Validator
object
- The object to be validated - commonly a String, Integer, Double, Date etc.component
- The Element
or Attribute
inside context
which defines object
.context
- The parent of object
- could be null
.manager
- The validation manager which is performing this validation.
ValidationException
- If the object is not valid and the validation maanger is operating in exception mode.public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |