|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcometa.translator.Translator
public class Translator
This class translates the metadta in form of an XML file into the corresponding Java object. It uses the JAXB library (for more information, see the JAXB documentation).
Constructor Summary | |
---|---|
Translator()
It creates a new instance of Translator. |
Method Summary | |
---|---|
static java.io.ByteArrayInputStream |
getByteInputStream(org.xmldb.api.modules.XMLResource xmlResource)
The same as |
static org.jdom.Document |
getDocumentTree(java.io.File xmlFile)
This method returns a JDOM document tree, given as input an XML file. |
static org.jdom.Document |
getDocumentTree(org.xmldb.api.modules.XMLResource xmlResource)
This method returns a JDOM document tree, given as input an XMLResource object (which is a format used by the JAXB architecture). |
static java.io.InputStream |
getInputStream(org.xmldb.api.modules.XMLResource xmlResource)
This methods returns an InputStream corresponding to a given XMLResource. |
static java.io.InputStream |
getInputStreamFromFile(java.io.File xmlFile)
This methods returns an InputStream corresponding to a given XML File. |
static java.io.File |
writeToFile(java.lang.String filename,
java.lang.String content)
This method writes a String to a file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Translator()
Method Detail |
---|
public static java.io.File writeToFile(java.lang.String filename, java.lang.String content)
filename
- The filename (containing the absolute path!) to where the file has
to be written.content
- The content to write into the file.
public static org.jdom.Document getDocumentTree(java.io.File xmlFile) throws org.jdom.JDOMException, java.io.IOException
xmlFile
- The XML input File.
org.jdom.JDOMException
- Exception thrown in case of a JDOM error.
java.io.IOException
- Exception thrown if the XML input file cannot be found.public static org.jdom.Document getDocumentTree(org.xmldb.api.modules.XMLResource xmlResource) throws org.jdom.JDOMException, java.io.IOException
xmlResource
- The XMLResource for which the you want to recieve the
document tree.
org.jdom.JDOMException
- Exception thrown if a JDOM error occurs.
java.io.IOException
- Exception thrown if an error occurs while converting the input resource
to a ByteArray.public static java.io.InputStream getInputStream(org.xmldb.api.modules.XMLResource xmlResource) throws org.jdom.JDOMException, java.io.IOException
xmlResource
- The input resource for which you want to receive the input stream.
org.jdom.JDOMException
- Exception thrown if a JDOM error occurs.
java.io.IOException
- Exception thrown if an error occurs while converting the input resource
to a ByteArray.public static java.io.InputStream getInputStreamFromFile(java.io.File xmlFile) throws java.io.IOException
xmlFile
- The input XML file for which you want to receive the input stream.
java.io.IOException
- Exception thrown if the XML input file cannot be found.public static java.io.ByteArrayInputStream getByteInputStream(org.xmldb.api.modules.XMLResource xmlResource) throws org.jdom.JDOMException, java.io.IOException
getInputStreambut it returns ByteInputStream.
xmlResource
- The XML resource for which you want to receive the byte input stream.
org.jdom.JDOMException
- Exception thrown if a JDOM error occurs.
java.io.IOException
- Exception thrown if an error occurs while converting the input resource
to a ByteArray.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |