|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
DataAdaptor is a generic interface to an external data source. A specific data adaptor (e.g. XmlDataAdaptor) will implement this interface to advertise its data in a generic way for reading and writing to a specific data source (e.g. XML file). DataAdaptor is intended to be a generic wrapper for specific data adaptors. Data adaptors do not have any knowledge about the objects that read and write data. Such data receivers and writers must implement the DataListener interface. A DataAdaptor instance is generated for each node in a hierarchical data tree and advertises information about the node and provides accessors to its children. Information about a node is in the form of attributes which represent key/value pairs of primitive data.
| Method Summary | |
java.lang.String[] |
attributes()
return the array of all attributes |
boolean |
booleanValue(java.lang.String attribute)
boolean value associated with the specified attribute |
DataAdaptor |
childAdaptor(java.lang.String label)
Convenience method to get a single child adaptor when only one is expected |
java.util.Iterator |
childAdaptorIterator()
return an iterator of all child adaptors |
java.util.Iterator |
childAdaptorIterator(java.lang.String label)
return an iterator of all child adaptors of the specified name |
java.util.List |
childAdaptors()
return all child adaptors |
java.util.List |
childAdaptors(java.lang.String label)
return all child adaptors of the specified node name |
DataAdaptor |
createChild(java.lang.String label)
Create an new empty child adaptor with label |
double |
doubleValue(java.lang.String attribute)
double value associated with the specified attribute |
boolean |
hasAttribute(java.lang.String attribute)
returns true iff the node has the specified attribute |
int |
intValue(java.lang.String attribute)
integer value associated with the specified attribute |
long |
longValue(java.lang.String attribute)
long value associated with the specified attribute |
java.lang.String |
name()
name for the particular node in the data tree |
int |
nodeCount()
return the number of child node adaptors |
void |
setValue(java.lang.String attribute,
boolean value)
set the value of the specified attribute to the specified value |
void |
setValue(java.lang.String attribute,
double value)
set the value of the specified attribute to the specified value |
void |
setValue(java.lang.String attribute,
int value)
set the value of the specified attribute to the specified value |
void |
setValue(java.lang.String attribute,
long value)
set the value of the specified attribute to the specified value |
void |
setValue(java.lang.String attribute,
java.lang.Object value)
set the value of the specified attribute to the specified value |
void |
setValue(java.lang.String attribute,
java.lang.String value)
set the value of the specified attribute to the specified value |
java.lang.String |
stringValue(java.lang.String attribute)
string value associated with the specified attribute |
void |
writeNode(DataListener listener)
write the listener as a new node and append it to the data tree |
void |
writeNodes(java.util.Collection listenerList)
write the collection of listeners to new nodes and append them to the data tree. |
| Method Detail |
public java.lang.String name()
public boolean hasAttribute(java.lang.String attribute)
public java.lang.String stringValue(java.lang.String attribute)
public double doubleValue(java.lang.String attribute)
public long longValue(java.lang.String attribute)
public int intValue(java.lang.String attribute)
public boolean booleanValue(java.lang.String attribute)
public void setValue(java.lang.String attribute,
java.lang.String value)
public void setValue(java.lang.String attribute,
double value)
public void setValue(java.lang.String attribute,
long value)
public void setValue(java.lang.String attribute,
int value)
public void setValue(java.lang.String attribute,
boolean value)
public void setValue(java.lang.String attribute,
java.lang.Object value)
public java.lang.String[] attributes()
public int nodeCount()
public java.util.List childAdaptors()
public java.util.List childAdaptors(java.lang.String label)
public java.util.Iterator childAdaptorIterator()
public java.util.Iterator childAdaptorIterator(java.lang.String label)
public DataAdaptor childAdaptor(java.lang.String label)
public DataAdaptor createChild(java.lang.String label)
public void writeNode(DataListener listener)
public void writeNodes(java.util.Collection listenerList)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||