|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.generic.persistence.XMLIOUtilities
Static convenience methods to load/store xml files in the context of the persistence framework.
| Method Summary | |
static java.lang.String |
quoteString(java.lang.String strVal)
Quotes all linefeeds in a string to be saved to XML |
static AttributeList |
readXML(java.io.InputStream in)
This method reads an AttributeList from an given
InputStream. |
static AttributeList |
readXMLFile(java.io.File file)
Convenience method that builds an InputStream with the given
File-parameter and then calls readXML(). |
static AttributeList |
readXMLFile(java.lang.String filename,
java.lang.Class resourceClass)
This method uses the XMLReader to create an
AttributeList from the XML-file specified by the
filename parameter. |
static java.lang.String |
strReplace(java.lang.String string,
java.lang.String token,
java.lang.String replaceString)
String replace function, replaces all occurrances of the token in the string with another string (Only neccessary, because replaceAll is not implemented in jdk1.3) |
static java.lang.String |
unquoteString(java.lang.String strVal)
Quotes all linefeeds in a string to be saved to XML |
static void |
writeXML(java.io.OutputStream outputstream,
java.lang.String header,
AttributeList list)
Writes the given list to the outputstream
and prepends the header to the output. |
static void |
writeXMLFile(java.lang.String filename,
AttributeList list)
Does the same as writeXMLFile, but you do not have to
specify a XML-header. |
static void |
writeXMLFile(java.lang.String filename,
java.lang.String header,
AttributeList list)
Method writeXMLFile writes the parameter
AttributeList to the File specified by
filename using the given header. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static final AttributeList readXML(java.io.InputStream in)
throws ReadException
AttributeList from an given
InputStream.
in - the InputStream to read from.
AttributeList.
ReadException - thrown if reading from the InputStream
fails
public static final void writeXML(java.io.OutputStream outputstream,
java.lang.String header,
AttributeList list)
throws WriteException
list to the outputstream
and prepends the header to the output. The
header is optional and can be null.
outputstream - the OutputStream to write to.header - the optional header (for example a DTD)list - the AttributeList to write.
WriteException - thrown if writing to the OutputStream
fails
public static final AttributeList readXMLFile(java.io.File file)
throws ReadException
InputStream with the given
File-parameter and then calls readXML().
file - the XML-file to be read.
AttributeList.
ReadException - thrown if reading from the File
failsreadXML(InputStream)
public static final AttributeList readXMLFile(java.lang.String filename,
java.lang.Class resourceClass)
throws ReadException
XMLReader to create an
AttributeList from the XML-file specified by the
filename parameter. The file-path must be specified
relative to the given resourceClass parameter.
filename - name of the XML-file to be read.resourceClass - the ResourceClass.
AttributeList created by the
XMLReader.
ReadException - thrown if reading from the File
fails
public static final void writeXMLFile(java.lang.String filename,
java.lang.String header,
AttributeList list)
throws WriteException
writeXMLFile writes the parameter
AttributeList to the File specified by
filename using the given header. If header is
null, a default XML-header will be written.
filename - the file to write to.header - header to be used as the XML-header.list - the AttributeList to write out.
WriteException - thrown if writing to the file given through
filename fails
public static final void writeXMLFile(java.lang.String filename,
AttributeList list)
throws WriteException
writeXMLFile, but you do not have to
specify a XML-header.
filename - the file to write to.list - the AttributeList to write out.
WriteException - thrown if writing to the file given through
filename failswriteXMLFile(String, String, AttributeList)public static final java.lang.String quoteString(java.lang.String strVal)
strVal - The string to quote
public static final java.lang.String unquoteString(java.lang.String strVal)
strVal - The string to quote
public static java.lang.String strReplace(java.lang.String string,
java.lang.String token,
java.lang.String replaceString)
string - The original stringtoken - The substring to look forreplaceString - The string to replace the token with
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||