|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.extentech.ExtenBean.XMLDataObjectFactory
public class XMLDataObjectFactory
XMLDataObjectFactory is a PersistenceEngine used to initialize XMLDataObjects from XML Data Source. This class can load XML data from Files, databases and arbitrary InputStreams. Since not all input methods allow for saving back, only File and DataBase backed XMLDataObjects
PersistenceEngine,
ExtenBeanFactory,
DataObject,
colinfo| Constructor Summary | |
|---|---|
XMLDataObjectFactory()
|
|
| Method Summary | |
|---|---|
void |
createDom()
ParseXML creates the DOM based off of an xml file passed to it |
void |
createDom(InputSource in)
create Dom Document from an InputSource object 20061005 KSC |
void |
createDom(InputStream in)
ParseXML creates the DOM based off of an xml file passed to it |
DataObject |
createNewDataObject(DataObject d)
creates a new Data Object |
void |
finalize()
perform cleanup |
byte[] |
getBytes()
output the DOM to file |
org.jdom.Document |
getDocument()
return the underlying XML document |
String |
getfPersisted()
return the previous persisted filename |
String |
getXMLFile()
returns the string path of the XML file |
DataObject |
initDataObject(DataObject dobj)
initDataObject handles parsing an XML file and creating a data object off of it. |
static void |
listChildren(org.jdom.Element current,
int depth)
useful debugging method |
boolean |
persist()
persist the XML tree to its source |
boolean |
persist(String fName)
|
boolean |
removeDataObject(DataObject o)
removes the dataobject from the DOM and re-persists to the underlying datasource if possible. |
void |
setConnection(Connection c)
Set the database connection for this factory. |
void |
setDocType(String tn,
String schema)
set the doc type for the underlying document |
void |
setXMLFile(String s)
sets the XML file to use as underlying XML document automatically updates the DOM after setting |
void |
setXMLFile(String s,
boolean update)
sets the XML file to use as underlying XML document does NOT automatically updates the DOM after setting |
void |
setXMLFile(URL u)
sets the underlying XML document based upon a URL which is then loaded as an InputStream |
void |
setXMLStream(InputSource in)
Create Document from InputSource object automatically updates the DOM after setting |
void |
setXMLStream(InputStream in)
sets the XML file to use as underlying XML document InputStream automatically updates the DOM after setting |
boolean |
storeDataObject(DataObject o)
stores the dataobject to the underlying datasource if possible. |
String |
toString()
returns the path to the input aka: delegates to getXMLFile |
boolean |
updateDataObject(DataObject o)
udpates the values of a given node and its children and writes to the underlying data source if possible. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public XMLDataObjectFactory()
| Method Detail |
|---|
public void setDocType(String tn,
String schema)
tn - schema - public void setConnection(Connection c)
setConnection in interface PersistenceEnginepublic void setXMLFile(URL u)
u - public void setXMLFile(String s)
s -
public void setXMLFile(String s,
boolean update)
s - update - - option to update the DOM after settingpublic void setXMLStream(InputStream in)
in - - inputstream containing XML doc bytespublic void setXMLStream(InputSource in)
inputstream - document source.public org.jdom.Document getDocument()
public String getXMLFile()
public String toString()
toString in class Objectpublic void createDom(InputStream in)
public void createDom(InputSource in)
in - public void createDom()
public DataObject createNewDataObject(DataObject d)
createNewDataObject in interface PersistenceEnginePersistenceEngine.createNewDataObject(com.extentech.ExtenBean.DataObject)public void finalize()
finalize in class ObjectObject.finalize()public DataObject initDataObject(DataObject dobj)
initDataObject in interface PersistenceEnginedobj - The DataObject for which you are requesting data.
public boolean removeDataObject(DataObject o)
removeDataObject in interface PersistenceEngineo - The DataObject which you are deleting.
PersistenceEngine.removeDataObject(com.extentech.ExtenBean.DataObject)public boolean storeDataObject(DataObject o)
storeDataObject in interface PersistenceEngineo - The DataObject which you are deleting.
PersistenceEngine.storeDataObject(com.extentech.ExtenBean.DataObject)
public boolean persist()
throws Exception
Exception
public boolean persist(String fName)
throws Exception
Exceptionpublic String getfPersisted()
persist(String)public byte[] getBytes()
public boolean updateDataObject(DataObject o)
updateDataObject in interface PersistenceEngineo - The DataObject which you are deleting.
PersistenceEngine.updateDataObject(com.extentech.ExtenBean.DataObject)
public static void listChildren(org.jdom.Element current,
int depth)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||