|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.formaria.data.DataSource
public class DataSource
Loads a model from a reader
Copyright (c) Formaria Ltd., 2008
License: see license.txt
$Revision: 2.11 $
| Field Summary | |
|---|---|
protected Project |
currentProject
The current Project |
| Constructor Summary | |
|---|---|
DataSource(Project project)
Create a new data source |
|
| Method Summary | |
|---|---|
void |
loadTable(XmlElement source,
DataModel model)
Recursively load the model data |
void |
outputModel(java.lang.String filename,
DataModel model)
Iterate the Models and outputs the Elements and their attributes. |
static void |
outputModel(java.io.Writer w,
DataModel model)
Iterates the Models and outputs the Elements and their attributes. |
static void |
outputModel(XmlElement parentEle,
DataModel model)
Recursive method which builds up the XML Document based on the DataModel. |
void |
read(java.io.Reader r)
Read a model from the Reader |
void |
read(XmlElement ele)
Read an file pointed to by an element in the XML description of the data sources |
protected void |
readDataSource(java.lang.String fileName,
XmlElement source)
Read the data source file. |
static void |
setUseValueAsId(boolean state)
Set the model to use the value as the ID for a node if the ID is not specified |
void |
write(java.io.Writer w)
Outputs the datasource as XML |
void |
write(java.io.Writer w,
DataModel model)
Outputs the datasource as XML |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Project currentProject
| Constructor Detail |
|---|
public DataSource(Project project)
project - the owner project| Method Detail |
|---|
public void read(java.io.Reader r)
r - the Readerpublic void read(XmlElement ele)
ele - the individual data source description
protected void readDataSource(java.lang.String fileName,
XmlElement source)
fileName - the nam eof the file to opensource - the XML element describing the source
public void loadTable(XmlElement source,
DataModel model)
source - the source elementmodel - the model for the source elementpublic void write(java.io.Writer w)
w - The Writer of the file.
public void write(java.io.Writer w,
DataModel model)
model - the model node to writew - The Writer of the file.
public static void outputModel(java.io.Writer w,
DataModel model)
w - the output writermodel - the model to write
public static void outputModel(XmlElement parentEle,
DataModel model)
parentEle - the current parent elementmodel - the current model being processed
public void outputModel(java.lang.String filename,
DataModel model)
filename - the file to writemodel - the model to writepublic static void setUseValueAsId(boolean state)
state - true to use the value when an ID is not specified
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||