|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object janus.util.Message2Xml
public class Message2Xml
Hilfsfunktionen zum Ausgeben von MessageElement- Instanzen als XML-Datei
Field Summary | |
---|---|
protected String[] |
encodings
Das Encoding des XML-Output |
protected String |
fileName
Der (modifizierte) Dateiname, falls bekannt |
protected int |
indent
Der momentane Indent-Level |
protected MessageElement |
messageElement
Das MessageElement |
protected Writer |
out
Der Writer zum Schreiben der XML-DAtei |
Constructor Summary | |
---|---|
Message2Xml()
DefaultKonstruktor, speichert ein Standard-MessageElement |
|
Message2Xml(Class messageElementClass)
Konstruktor, erzeugt und speichert das MessageElement |
|
Message2Xml(MessageElement messageElement)
Konstruktor, speichert das MessageElement |
|
Message2Xml(String messageElementName)
Konstruktor, erzeugt und speichert das MessageElement |
Method Summary | |
---|---|
protected void |
emit(MessageElement elem,
Field field,
int occurs)
Worker für die Ausgabe eines Elementes |
String[] |
getEncoding()
Ermittle das Encoding |
String |
getFileName()
Ermittle den Dateinamen |
MessageElement |
getMessageElement()
Ermittle das gespeicherte MessageElement |
protected void |
indent()
Helper für die Ausgabe eines Einzuges |
static void |
main(String[] args)
Hauptprogramm Wird mit einem Klassennamen auf der Kommandozeile gestartet |
protected void |
nl()
Helper für die Ausgabe eines Zeilenendes |
void |
output(OutputStream ostream)
Ausgabefunktion |
void |
output(String file)
Ausgabefunktion |
void |
output(Writer out)
Ausgabefunktion |
void |
setEncoding(String encoding)
Setze das Encoding |
void |
setEncoding(String[] encodings)
Setze das Encoding |
void |
setEncoding(String xmlEncoding,
String javaEncoding)
Setze das Encoding |
void |
setMessageElement(Class messageElementClass)
Setter, erzeugt und speichert das MessageElement |
void |
setMessageElement(MessageElement messageElement)
Setter, speichert das MessageElement |
void |
setMessageElement(String messageElementName)
Setter, erzeugt und speichert das MessageElement |
protected void |
write(char c)
Helper für die Ausgabe |
protected void |
write(String s)
Helper für die Ausgabe |
protected void |
writeAttrib(String name,
int value,
boolean ind)
Helper f&uer die Ausgabe eines Zahlen-Attributes |
protected void |
writeAttrib(String name,
String value,
boolean ind)
Helper f&uer die Ausgabe eines Attributes |
protected void |
writeq(String s)
Helper fuer die Ausgabe von Quoted Text |
protected void |
writeText(DdlText t)
Helper fuer die Ausgabe von DdlText |
protected void |
writeText(DdlText t,
String tag)
Helper fuer die Ausgabe von DdlText |
protected void |
writeText(String s)
Helper fuer die Ausgabe von PCTEXT |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected String[] encodings
protected String fileName
protected int indent
protected MessageElement messageElement
protected Writer out
Constructor Detail |
---|
public Message2Xml()
public Message2Xml(Class messageElementClass) throws IllegalArgumentException
messageElementClass
- das Element als Class-Objekt, normalerweise
eine aus dem Dictionary generierte Klasse.
IllegalArgumentException
public Message2Xml(MessageElement messageElement) throws IllegalArgumentException
messageElement
- das Element als Objekt, normalerweise eine
Instanz einer aus dem Dictionary generierten Klasse.
IllegalArgumentException
public Message2Xml(String messageElementName) throws IllegalArgumentException
messageElementName
- das Element als Klassenname, normalerweise
der Name einer aus dem Dictionary generierten Klasse.
IllegalArgumentException
Method Detail |
---|
protected void emit(MessageElement elem, Field field, int occurs) throws IOException
IOException
public String[] getEncoding()
public String getFileName()
public MessageElement getMessageElement()
protected void indent() throws IOException
IOException
public static void main(String[] args) throws Exception
Exception
protected void nl() throws IOException
IOException
public void output(OutputStream ostream) throws IOException
ostream
- Ausgabe-Strom
IOException
public void output(String file) throws IOException
file
- Ausgabe-Datei.
"#" wird durch den Namen der Message ersetzt.
IOException
public void output(Writer out) throws IOException
out
- Ziel der XML-Daten
IOException
public void setEncoding(String encoding)
encoding
- String mit dem XML-Encoding.
Das Java-Encodung wird nach Liste ermitteltpublic void setEncoding(String[] encodings)
encodings
- String-Array mit zwei Einträgen:
{"xml-encoding", "JavaEncoding" }public void setEncoding(String xmlEncoding, String javaEncoding)
public void setMessageElement(Class messageElementClass) throws IllegalArgumentException
messageElementClass
- das Element als Class-Objekt, normalerweise
eine aus dem Dictionary generierte Klasse.
IllegalArgumentException
public void setMessageElement(MessageElement messageElement) throws IllegalArgumentException
messageElement
- das Element als Objekt, normalerweise eine
Instanz einer aus dem Dictionary generierten Klasse.
IllegalArgumentException
public void setMessageElement(String messageElementName) throws IllegalArgumentException
messageElementName
- das Element als Klassenname, normalerweise
der Name einer aus dem Dictionary generierten Klasse.
IllegalArgumentException
protected void write(char c) throws IOException
IOException
protected void write(String s) throws IOException
IOException
protected void writeAttrib(String name, int value, boolean ind) throws IOException
IOException
protected void writeAttrib(String name, String value, boolean ind) throws IOException
IOException
protected void writeq(String s) throws IOException
IOException
protected void writeText(DdlText t) throws IOException
IOException
protected void writeText(DdlText t, String tag) throws IOException
IOException
protected void writeText(String s) throws IOException
IOException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |