|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.io.gml.GMLEncoder y.io.gml.XGMLEncoder
public class XGMLEncoder
This class is a utility class for writing a simple XML-ish version of valid GML to a Writer. Each section is represented in a <section> tag and each attribute in an <attribute> tag.
Constructor Summary | |
---|---|
XGMLEncoder(java.io.Writer writer)
Creates a new instance of XGMLEncoder. |
Method Summary | |
---|---|
void |
addAttribute(java.lang.String key,
boolean value)
Writes a key value pair, where the value is a boolean value. |
void |
addAttribute(java.lang.String key,
double value)
Writes a key value pair, where the value is a double. |
void |
addAttribute(java.lang.String key,
int value)
Writes a key value pair, where the value is an integer. |
void |
addAttribute(java.lang.String key,
java.lang.Number value)
Writes a key value pair, where the value is a Number in String format. |
void |
addAttribute(java.lang.String key,
java.lang.Object value)
Writes a key value pair, where the value is an object. |
void |
addAttribute(java.lang.String key,
java.lang.String value)
Writes a key value pair, where the value is a string. |
void |
beginSection(java.lang.String sectionName)
Writes the start tag for a given section. |
void |
endSection()
Writes the closing tag for a section opened with GMLEncoder.beginSection(String) |
int |
getLevel()
Getter for property level. |
protected java.lang.String |
sanatize(java.lang.String s)
Encodes the string to be valid GML, escaping invalid characters accordingly. |
protected void |
writeAttribute(java.lang.String key,
java.lang.String value)
Writes a key value pair, where the value is a string. |
Methods inherited from class y.io.gml.GMLEncoder |
---|
addAttributes, writeIndentation |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XGMLEncoder(java.io.Writer writer)
Method Detail |
---|
public void beginSection(java.lang.String sectionName) throws java.io.IOException
GMLEncoder
beginSection
in class GMLEncoder
java.io.IOException
protected void writeAttribute(java.lang.String key, java.lang.String value) throws java.io.IOException
GMLEncoder
writeAttribute
in class GMLEncoder
java.io.IOException
public void addAttribute(java.lang.String key, double value) throws java.io.IOException
GMLEncoder
addAttribute
in class GMLEncoder
java.io.IOException
public void addAttribute(java.lang.String key, int value) throws java.io.IOException
GMLEncoder
addAttribute
in class GMLEncoder
java.io.IOException
public void addAttribute(java.lang.String key, java.lang.Number value) throws java.io.IOException
GMLEncoder
addAttribute
in class GMLEncoder
java.io.IOException
public void addAttribute(java.lang.String key, boolean value) throws java.io.IOException
GMLEncoder
addAttribute
in class GMLEncoder
java.io.IOException
public void addAttribute(java.lang.String key, java.lang.String value) throws java.io.IOException
GMLEncoder
addAttribute
in class GMLEncoder
java.io.IOException
public void addAttribute(java.lang.String key, java.lang.Object value) throws java.io.IOException
GMLEncoder
addAttribute
in class GMLEncoder
java.io.IOException
protected java.lang.String sanatize(java.lang.String s)
GMLEncoder
sanatize
in class GMLEncoder
public void endSection() throws java.io.IOException
GMLEncoder
GMLEncoder.beginSection(String)
endSection
in class GMLEncoder
java.io.IOException
public int getLevel()
getLevel
in class GMLEncoder
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |