|
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(Writer writer)
Creates a new instance of XGMLEncoder. |
Method Summary | |
---|---|
void |
addAttribute(String key,
boolean value)
Writes a key value pair, where the value is a boolean value. |
void |
addAttribute(String key,
double value)
Writes a key value pair, where the value is a double. |
void |
addAttribute(String key,
int value)
Writes a key value pair, where the value is an integer. |
void |
addAttribute(String key,
Number value)
Writes a key value pair, where the value is a Number in String format. |
void |
addAttribute(String key,
Object value)
Writes a key value pair, where the value is an object. |
void |
addAttribute(String key,
String value)
Writes a key value pair, where the value is a string. |
void |
beginSection(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 String |
sanatize(String s)
Encodes the string to be valid GML, escaping invalid characters accordingly. |
protected void |
writeAttribute(String key,
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(Writer writer)
Method Detail |
---|
public void beginSection(String sectionName) throws IOException
GMLEncoder
beginSection
in class GMLEncoder
IOException
protected void writeAttribute(String key, String value) throws IOException
GMLEncoder
writeAttribute
in class GMLEncoder
IOException
public void addAttribute(String key, double value) throws IOException
GMLEncoder
addAttribute
in class GMLEncoder
IOException
public void addAttribute(String key, int value) throws IOException
GMLEncoder
addAttribute
in class GMLEncoder
IOException
public void addAttribute(String key, Number value) throws IOException
GMLEncoder
addAttribute
in class GMLEncoder
IOException
public void addAttribute(String key, boolean value) throws IOException
GMLEncoder
addAttribute
in class GMLEncoder
IOException
public void addAttribute(String key, String value) throws IOException
GMLEncoder
addAttribute
in class GMLEncoder
IOException
public void addAttribute(String key, Object value) throws IOException
GMLEncoder
addAttribute
in class GMLEncoder
IOException
protected String sanatize(String s)
GMLEncoder
sanatize
in class GMLEncoder
public void endSection() throws IOException
GMLEncoder
GMLEncoder.beginSection(String)
endSection
in class GMLEncoder
IOException
public int getLevel()
getLevel
in class GMLEncoder
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |