|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbiz.c24.io.api.data.SourcedEnumeration
public abstract class SourcedEnumeration
An enumeration sourced from an external repository of static data such as a file, url, database.
Constructor Summary | |
---|---|
SourcedEnumeration(String rootClassName,
Source source,
XPathStatement xpath,
boolean trim,
ClassLoader classLoader)
Creates a new instance. |
Method Summary | |
---|---|
Annotation |
getAnnotation()
Returns the annotation associated with this enumeration. |
Annotation |
getAnnotation(int index)
Returns the annotation associated with the enumeration value at index. |
ClassLoader |
getClassLoader()
Returns the class loader used to load the root element. |
int |
getCount()
Returns the number of enumeration values. |
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 |
getRootClassName()
Returns the root class name. |
Source |
getSource()
Returns the source used to load the objects. |
String |
getValue(int index)
Returns the enumeration value at index. |
XPathStatement |
getXPath()
Returns the xpath statement used to select the enumeration data. |
void |
init()
Forcibly attempt to re-initalize. |
boolean |
isErrored()
Returns whether the initialization of the underlying enumeration has errored In which case it re-initialization must be done maunally via the init() method. |
boolean |
isInitialized()
Returns whether the underlying eunmeration has been loaded. |
boolean |
isTrim()
Returns whether enuemration values will have whitespace removed. |
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 |
Methods inherited from interface biz.c24.io.api.data.Enumeration |
---|
getErrorCode |
Constructor Detail |
---|
public SourcedEnumeration(String rootClassName, Source source, XPathStatement xpath, boolean trim, ClassLoader classLoader)
rootClassName
- The class name of the root element / type.source
- The source to be used to parse the data.xpath
- The xpath to select the values used for the enumeration.trim
- Whether to trim whitespace from the returned values.classLoader
- The class loader to use to load the root class.Method Detail |
---|
public boolean isInitialized()
public boolean isErrored()
In which case it re-initialization must be done maunally via the init()
method.
public void init() throws FactoryException
FactoryException
- If the re-initialization failed.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 getRootClassName()
public ClassLoader getClassLoader()
public Source getSource()
public boolean isTrim()
public XPathStatement getXPath()
public Annotation getAnnotation()
Enumeration
getAnnotation
in interface Enumeration
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 String getName()
ModelComponent
getName
in interface ModelComponent
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |