Package org.nustaq.kson
Class JSonSerializer
java.lang.Object
org.nustaq.kson.KsonSerializer
org.nustaq.kson.JSonSerializer
public class JSonSerializer extends KsonSerializer
Created by ruedi on 12.08.2014.
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringclazzAttributeNameprotected booleanquoteKeyNames -
Constructor Summary
Constructors Constructor Description JSonSerializer(KsonCharOutput out, KsonTypeMapper mapper, FSTConfiguration conf) -
Method Summary
Modifier and Type Method Description java.lang.StringgetClazzAttributeName()booleanisQuoteKeyNames()JSonSerializernoTypeTags()protected voidremoveLastListSep()voidsetClazzAttributeName(java.lang.String clazzAttributeName)voidsetQuoteKeyNames(boolean quoteKeyNames)protected booleanshouldQuote(java.lang.String string)protected voidwriteClazzTag(java.lang.Class expectedClass, java.lang.Object o)determines classname tagging.protected voidwriteKey(java.lang.String name)called when writing a key of an key:value inside an object or mapprotected voidwriteListEnd()protected voidwriteListSep()protected voidwriteListStart()Methods inherited from class org.nustaq.kson.KsonSerializer
isWriteNull, setWriteNull, writeIndent, writeln, writeObject, writeObject, writeObjectInternal, writeString
-
Field Details
-
clazzAttributeName
protected java.lang.String clazzAttributeName -
quoteKeyNames
protected boolean quoteKeyNames
-
-
Constructor Details
-
Method Details
-
isQuoteKeyNames
public boolean isQuoteKeyNames() -
setQuoteKeyNames
public void setQuoteKeyNames(boolean quoteKeyNames) -
getClazzAttributeName
public java.lang.String getClazzAttributeName() -
setClazzAttributeName
public void setClazzAttributeName(java.lang.String clazzAttributeName) -
shouldQuote
protected boolean shouldQuote(java.lang.String string)- Overrides:
shouldQuotein classKsonSerializer
-
removeLastListSep
protected void removeLastListSep()- Overrides:
removeLastListSepin classKsonSerializer
-
writeListEnd
protected void writeListEnd()- Overrides:
writeListEndin classKsonSerializer
-
writeListStart
protected void writeListStart()- Overrides:
writeListStartin classKsonSerializer
-
writeListSep
protected void writeListSep()- Overrides:
writeListSepin classKsonSerializer
-
writeClazzTag
protected void writeClazzTag(java.lang.Class expectedClass, java.lang.Object o)Description copied from class:KsonSerializerdetermines classname tagging. Overrifing can enforce class tags always or (JSon) write as special attribute- Overrides:
writeClazzTagin classKsonSerializer
-
writeKey
protected void writeKey(java.lang.String name)Description copied from class:KsonSerializercalled when writing a key of an key:value inside an object or map- Overrides:
writeKeyin classKsonSerializer
-
noTypeTags
-