|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.duelengine.duel.DataEncoder
public class DataEncoder
Utility for writing data as JavaScript literals Inherently thread-safe as contains no mutable instance data.
| Nested Class Summary | |
|---|---|
static class |
DataEncoder.Snippet
|
| Constructor Summary | |
|---|---|
DataEncoder()
|
|
DataEncoder(String newline,
String indent)
|
|
| Method Summary | |
|---|---|
static DataEncoder.Snippet |
asSnippet(String text)
|
void |
indent(Appendable output,
int depth)
|
boolean |
isPrettyPrint()
|
void |
write(Appendable output,
Object data)
Serializes the data as JavaScript literals |
void |
write(Appendable output,
Object data,
int depth)
Serializes the data as JavaScript literals |
void |
writeln(Appendable output,
int depth)
|
boolean |
writeNamespace(Appendable output,
List<String> namespaces,
String ident)
Produces more compact namespace declarations. |
void |
writeNamespaceAlt(Appendable output,
List<String> namespaces,
String ident)
Deprecated. |
void |
writeVars(Appendable output,
SparseMap items)
Serializes the items as JavaScript variable |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DataEncoder()
public DataEncoder(String newline,
String indent)
| Method Detail |
|---|
public static DataEncoder.Snippet asSnippet(String text)
public boolean isPrettyPrint()
public void write(Appendable output,
Object data)
throws IOException
output - data - Data to serialize
IOException
public void write(Appendable output,
Object data,
int depth)
throws IOException
output - data - Data to serializedepth - Starting indentation depth
IOException
public boolean writeNamespace(Appendable output,
List<String> namespaces,
String ident)
throws IOException
output - namespaces - ident -
IOException
@Deprecated
public void writeNamespaceAlt(Appendable output,
List<String> namespaces,
String ident)
throws IOException
output - namespaces - ident -
IOException
public void indent(Appendable output,
int depth)
throws IOException
IOException
public void writeln(Appendable output,
int depth)
throws IOException
IOException
public void writeVars(Appendable output,
SparseMap items)
throws IOException
output - items - Variables to serialize
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||