|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.rubato.xml.XMLWriter
public class XMLWriter
A writer for the XML-based Rubato file format.
Constructor Summary | |
---|---|
XMLWriter(java.io.File file)
Creates a non-compressing writer to the specified file. |
|
XMLWriter(java.io.File file,
boolean compressed)
Creates a writer to the specified file. |
|
XMLWriter(java.io.PrintStream out)
Creates a writer to the specified PrintStream with the initial indent 0. |
|
XMLWriter(java.io.PrintStream out,
int indent)
Creates a writer to the specified PrintStream with the given initial indent. |
Method Summary | |
---|---|
void |
close()
Ends the XML file. |
void |
closeBlock()
Closes the XML block opened with openBlock. |
void |
closeInline()
Closes the XML element opened with openInline. |
void |
empty(java.lang.String element)
Creates an empty XML element "<.../>" with the given tag name. |
void |
empty(java.lang.String element,
java.lang.Object... attrs)
Creates an empty XML element "<.../>" with the given tag name and the given attributes. |
void |
emptyWithType(java.lang.String element,
java.lang.String type,
java.lang.Object... attrs)
Creates an empty XML element "<.../>" with the given tag name and the given attributes. |
void |
open()
Starts the XML file. |
void |
openBlock(java.lang.String element)
Opens an XML block with the given tag name. |
void |
openBlock(java.lang.String element,
java.lang.Object... attrs)
Opens an XML block with the given tag name and the specified attributes which are given as alternating name/value pairs. |
void |
openBlockWithType(java.lang.String element,
java.lang.String type,
java.lang.Object... attrs)
Opens an XML block with the given tag name and the specified attributes which are given as alternating name/value pairs. |
void |
openInline(java.lang.String element)
Creates an inline XML element with the given tag. |
void |
openInline(java.lang.String element,
java.lang.Object... attrs)
Creates an inline XML element with the given tag and attributes. |
void |
setIndentSize(int size)
Sets the number of spaces for each indent level. |
void |
text(java.lang.String string)
Adds the specified text to the XML file, with no conversion done on special characters. |
java.lang.String |
toRelativePath(java.lang.String path)
Strips the directory name of the current file from path
if possible to make path relative to the current file. |
java.lang.String |
toXMLText(java.lang.String text)
Converts the specified string for use with XML. |
void |
writeDenotator(Denotator denotator)
Writes the XML representation of the specified denotator. |
void |
writeDenotatorRef(Denotator d)
Writes a reference to the specified denotator. |
void |
writeDenotators(java.util.List<Denotator> denotators)
Writes the XML representations of the specified list of denotators. |
void |
writeForm(Form form)
Writes the XML representation of the specified form. |
void |
writeFormRef(Form form)
Writes a reference to the specified form. |
void |
writeForms(java.util.List<Form> forms)
Writes the XML representations of the specified list of forms. |
void |
writeModule(java.lang.String name,
Module module)
Writes the XML representation of the given module under the given name. |
void |
writeModuleElement(java.lang.String name,
ModuleElement moduleElement)
Writes the XML representation of the given module element under the given name. |
void |
writeModuleMorphism(java.lang.String name,
ModuleMorphism morphism)
Writes the XML representation of the given module morphism under the given name. |
void |
writeTextNode(java.lang.String text)
Adds the specified text to the XML file, with & and < converted to XML entities. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XMLWriter(java.io.File file) throws java.io.IOException
java.io.IOException
public XMLWriter(java.io.File file, boolean compressed) throws java.io.IOException
file
- the file to save tocompressed
- if true
the output is compressed with GZIP
java.io.IOException
- iff the file cannot be opened
for writingpublic XMLWriter(java.io.PrintStream out, int indent)
public XMLWriter(java.io.PrintStream out)
Method Detail |
---|
public void open()
public void close()
public void setIndentSize(int size)
public void openBlock(java.lang.String element)
public void openBlock(java.lang.String element, java.lang.Object... attrs)
public void openBlockWithType(java.lang.String element, java.lang.String type, java.lang.Object... attrs)
public void openInline(java.lang.String element)
public void openInline(java.lang.String element, java.lang.Object... attrs)
public void closeBlock()
public void closeInline()
public void empty(java.lang.String element)
public void empty(java.lang.String element, java.lang.Object... attrs)
public void emptyWithType(java.lang.String element, java.lang.String type, java.lang.Object... attrs)
public void writeTextNode(java.lang.String text)
public java.lang.String toXMLText(java.lang.String text)
public void text(java.lang.String string)
public void writeModule(java.lang.String name, Module module)
public void writeModuleElement(java.lang.String name, ModuleElement moduleElement)
public void writeModuleMorphism(java.lang.String name, ModuleMorphism morphism)
public void writeForm(Form form)
public void writeFormRef(Form form)
public void writeForms(java.util.List<Form> forms)
public void writeDenotator(Denotator denotator)
public void writeDenotators(java.util.List<Denotator> denotators)
public void writeDenotatorRef(Denotator d)
public java.lang.String toRelativePath(java.lang.String path)
path
if possible to make path
relative to the current file.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |