public class WiktionaryWriter extends Object
Modifier and Type | Field and Description |
---|---|
protected Marshaller |
marshaller |
Constructor and Description |
---|
WiktionaryWriter()
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
setFormattedOutput(boolean value)
Specify whether the resulting XML file should be formatted nicely (with
whitespace and tabs).
|
void |
setProperty(String name,
Object value)
Call
setProperty on the underlying Marshaller object. |
void |
write(JAXBElement<?> root,
OutputStream output)
Write the data rooted at
root to output |
void |
write(JAXBElement<?> root,
String file)
Write the data rooted at
root to the specified file |
protected Marshaller marshaller
public WiktionaryWriter()
MediaWikiLoader.XMLConfigurationException
- if there are any problems with configuring the XML parsing
classespublic void setFormattedOutput(boolean value)
value
- true
for nice formatting false
otherwise.MediaWikiLoader.XMLConfigurationException
- if the underlying call to setProperty
throws an
exception.public void setProperty(String name, Object value) throws PropertyException
setProperty
on the underlying Marshaller
object.name
- the name of the property to be set.value
- the value of the property to be set.PropertyException
- when there is an error processing the given property.public void write(JAXBElement<?> root, OutputStream output) throws JAXBException
root
to output
root
- root of the dataoutput
- where to write outputJAXBException
- if anything strange happens.public void write(JAXBElement<?> root, String file) throws FileNotFoundException, JAXBException
root
to the specified fileroot
- root of the datafile
- file to write to (or "-" for STDIN)JAXBException
- if anything strange happens.FileNotFoundException
- if file
can't be written