|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.griphyn.vdl.Chimera
public abstract class Chimera
This abstract class defines a common base for all JAPI Chimera objects. All VDL-related classes must conform to this interface, in order to make various instances available as a reference to this class.
| Constructor Summary | |
|---|---|
Chimera()
|
|
| Method Summary | |
|---|---|
static String |
escape(String original)
Escapes certain characters inappropriate for textual output. |
static String |
quote(String original,
boolean isAttribute)
Escapes certain characters inappropriate for XML content output. |
String |
toString()
Dumps content of the given element into a string. |
abstract void |
toString(Writer s)
Dumps the content of the given element into a stream. |
String |
toXML(String indent,
String namespace)
Dumps the state of the current element as XML output. |
void |
toXML(Writer stream,
String indent)
Provides backward compatibility. |
abstract void |
toXML(Writer stream,
String indent,
String namespace)
Dump the state of the current element as XML output. |
void |
writeAttribute(Writer stream,
String key,
String value)
XML write helper method writes a quoted attribute onto a stream. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Chimera()
| Method Detail |
|---|
public static String escape(String original)
original - is a string that needs to be quoted
public static String quote(String original,
boolean isAttribute)
original - is a string that needs to be quotedisAttribute - denotes an attributes value, if set to true.
If false, it denotes regular XML content outside of attributes.
public String toString()
Sibling classes which represent small leaf objects, and can return the necessary data more efficiently, are encouraged to overwrite this method.
toString in class Object
public abstract void toString(Writer s)
throws IOException
s - is a stream opened and ready for writing. This can also be
a string stream for efficient output. The stream interface should
be able to handle large elements efficiently.
IOException - if something fishy happens to the stream.
public void writeAttribute(Writer stream,
String key,
String value)
throws IOException
stream - is the stream to append tokey - is the attribute including initial space, attribute name,
equals sign, and opening quote.value - is a string value, which will be put within the quotes
and which will be escaped. If the value is null, no action will be
taken
IOException - for stream errors.
public String toXML(String indent,
String namespace)
Sibling classes which represent small leaf objects, and can return the necessary data more efficiently, are encouraged to overwrite this method.
indent - is a String of spaces used for pretty
printing. The initial amount of spaces should be an empty string.
The parameter is used internally for the recursive traversal.
If null, avoidable whitespaces in the output will be avoided.namespace - is the XML schema namespace prefix. If neither
empty nor null, each element will be prefixed with this prefix,
and the root element will map the XML namespace.
public void toXML(Writer stream,
String indent)
throws IOException
toXML( stream, indent, (String) null );
stream - is a stream opened and ready for writing. This can also
be a string stream for efficient output.indent - is a String of spaces used for pretty
printing. The initial amount of spaces should be an empty string.
The parameter is used internally for the recursive traversal.
If a null value is specified, no indentation nor
linefeeds will be generated.
IOException - if something fishy happens to the stream.toXML( Writer, String, String )
public abstract void toXML(Writer stream,
String indent,
String namespace)
throws IOException
stream - is a stream opened and ready for writing. This can also
be a string stream for efficient output.indent - is a String of spaces used for pretty
printing. The initial amount of spaces should be an empty string.
The parameter is used internally for the recursive traversal.
If a null value is specified, no indentation nor
linefeeds will be generated.namespace - is the XML schema namespace prefix. If neither
empty nor null, each element will be prefixed with this prefix,
and the root element will map the XML namespace.
IOException - if something fishy happens to the stream.BufferedWriter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||