public class TrovitWritingExample extends Object
This example illustrates the programmatic creation of Trovit documents and how they are written into XML.
Constructor and Description |
---|
TrovitWritingExample() |
Modifier and Type | Method and Description |
---|---|
protected static AdType |
createAd()
Create an
AdType with some example data. |
protected static PictureType |
createPicture(int pos)
Create a
PictureType with some example data. |
static void |
main(String[] args)
Start the example application.
|
protected static void |
write(TrovitDocument doc,
File file)
Write a
TrovitDocument into a File . |
protected static void |
write(TrovitDocument doc,
OutputStream output)
Write a
TrovitDocument into an OutputStream . |
protected static void |
write(TrovitDocument doc,
Writer output)
Write a
TrovitDocument into a Writer . |
protected static void |
writeToConsole(TrovitDocument doc)
Write a
TrovitDocument into a String and print the
results to the console. |
public static void main(String[] args)
args
- command line argumentsprotected static AdType createAd()
AdType
with some example data.protected static PictureType createPicture(int pos)
PictureType
with some example data.pos
- image positionprotected static void write(TrovitDocument doc, File file)
TrovitDocument
into a File
.doc
- the document to writefile
- the file, where the document is written toprotected static void write(TrovitDocument doc, OutputStream output)
TrovitDocument
into an OutputStream
.doc
- the document to writeoutput
- the stream, where the document is written toprotected static void write(TrovitDocument doc, Writer output)
TrovitDocument
into a Writer
.doc
- the document to writeoutput
- the writer, where the document is written toprotected static void writeToConsole(TrovitDocument doc)
TrovitDocument
into a String
and print the
results to the console.doc
- the document to writeCopyright © 2018 OpenEstate. All rights reserved.