- java.lang.Object
-
- org.redkale.convert.Writer
-
- org.redkale.convert.json.JsonWriter
-
- org.redkale.convert.json.JsonCharsWriter
-
public class JsonCharsWriter extends JsonWriter
writeTo系列的方法输出的字符不能含特殊字符详情见: https://redkale.org
- 从以下版本开始:
- 2.3.0
- 作者:
- zhangjx
-
-
字段概要
-
从类继承的字段 org.redkale.convert.json.JsonWriter
BYTE_COLON, BYTE_COMMA, BYTE_DQUOTE, BYTE_LBRACE, BYTE_LBRACKET, BYTE_RBRACE, BYTE_RBRACKET, DEFAULT_SIZE
-
从类继承的字段 org.redkale.convert.Writer
comma, features, mapFieldFunc, objExtFunc, objFieldFunc, specificObjectType
-
-
构造器概要
构造器 构造器 说明 JsonCharsWriter()
JsonCharsWriter(int size)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 boolean
charsMode()
int
count()
protected boolean
recycle()
byte[]
toBytes()
String
toString()
void
writeBoolean(boolean value)
写入一个boolean值void
writeFieldIntValue(byte[] fieldBytes, char[] fieldChars, int value)
void
writeFieldLatin1Value(byte[] fieldBytes, char[] fieldChars, String value)
void
writeFieldLongValue(byte[] fieldBytes, char[] fieldChars, long value)
void
writeFieldShortValue(byte[] fieldBytes, char[] fieldChars, short value)
void
writeInt(int value)
写入一个int值void
writeLastFieldIntValue(byte[] fieldBytes, char[] fieldChars, int value)
void
writeLastFieldLatin1Value(byte[] fieldBytes, char[] fieldChars, String value)
void
writeLastFieldLongValue(byte[] fieldBytes, char[] fieldChars, long value)
void
writeLastFieldShortValue(byte[] fieldBytes, char[] fieldChars, short value)
void
writeLatin1To(boolean quote, String value)
注意: 该String值不能为null且不会进行转义, 只用于不含需要转义字符的字符串,例如enum、double、BigInteger、BigDecimal转换的Stringvoid
writeLong(long value)
写入一个long值void
writeObjectByOnlyOneLatin1FieldValue(byte[] firstFieldBytes, char[] firstFieldChars, String value)
void
writeObjectByOnlyTwoIntFieldValue(byte[] firstFieldBytes, char[] firstFieldChars, int value1, byte[] lastFieldBytes, char[] lastFieldChars, int value2)
void
writeString(boolean quote, String value)
void
writeString(String value)
写入一个String值void
writeTo(byte b)
void
writeTo(byte[] bs, int start, int len)
void
writeTo(char ch)
void
writeTo(char[] chs, int start, int len)
void
writeWrapper(StringWrapper wrapper)
写入一个StringConvertWrapper值-
从类继承的方法 org.redkale.convert.json.JsonWriter
isExtFuncEmpty, withFeatures, writeArrayB, writeArrayE, writeArrayMark, writeByte, writeByteArray, writeChar, writeDouble, writeField, writeField, writeFloat, writeMapB, writeMapE, writeMapMark, writeNull, writeObjectB, writeObjectE, writeShort, writeStandardString, writeTo, writeTo
-
从类继承的方法 org.redkale.convert.Writer
getFeatures, nullable, specificObjectType, specificObjectType, tiny, writeField, writeObjectField, writeObjectField, writeObjectNull
-
-
-
-
方法详细资料
-
charsMode
public final boolean charsMode()
- 覆盖:
charsMode
在类中JsonWriter
-
writeTo
public void writeTo(char ch)
- 指定者:
writeTo
在类中JsonWriter
-
writeTo
public void writeTo(char[] chs, int start, int len)
- 指定者:
writeTo
在类中JsonWriter
-
writeTo
public void writeTo(byte b)
- 指定者:
writeTo
在类中JsonWriter
-
writeTo
public void writeTo(byte[] bs, int start, int len)
- 指定者:
writeTo
在类中JsonWriter
-
writeLatin1To
public void writeLatin1To(boolean quote, String value)
注意: 该String值不能为null且不会进行转义, 只用于不含需要转义字符的字符串,例如enum、double、BigInteger、BigDecimal转换的String- 指定者:
writeLatin1To
在类中JsonWriter
- 参数:
quote
- 是否加双引号value
- 非null且不含需要转义的字符的String值
-
writeFieldShortValue
public void writeFieldShortValue(byte[] fieldBytes, char[] fieldChars, short value)
- 指定者:
writeFieldShortValue
在类中JsonWriter
-
writeFieldIntValue
public void writeFieldIntValue(byte[] fieldBytes, char[] fieldChars, int value)
- 指定者:
writeFieldIntValue
在类中JsonWriter
-
writeFieldLongValue
public void writeFieldLongValue(byte[] fieldBytes, char[] fieldChars, long value)
- 指定者:
writeFieldLongValue
在类中JsonWriter
-
writeFieldLatin1Value
public void writeFieldLatin1Value(byte[] fieldBytes, char[] fieldChars, String value)
- 指定者:
writeFieldLatin1Value
在类中JsonWriter
-
writeLastFieldShortValue
public void writeLastFieldShortValue(byte[] fieldBytes, char[] fieldChars, short value)
- 指定者:
writeLastFieldShortValue
在类中JsonWriter
-
writeLastFieldIntValue
public void writeLastFieldIntValue(byte[] fieldBytes, char[] fieldChars, int value)
- 指定者:
writeLastFieldIntValue
在类中JsonWriter
-
writeLastFieldLongValue
public void writeLastFieldLongValue(byte[] fieldBytes, char[] fieldChars, long value)
- 指定者:
writeLastFieldLongValue
在类中JsonWriter
-
writeLastFieldLatin1Value
public void writeLastFieldLatin1Value(byte[] fieldBytes, char[] fieldChars, String value)
- 指定者:
writeLastFieldLatin1Value
在类中JsonWriter
-
writeObjectByOnlyOneLatin1FieldValue
public void writeObjectByOnlyOneLatin1FieldValue(byte[] firstFieldBytes, char[] firstFieldChars, String value)
-
writeObjectByOnlyTwoIntFieldValue
public void writeObjectByOnlyTwoIntFieldValue(byte[] firstFieldBytes, char[] firstFieldChars, int value1, byte[] lastFieldBytes, char[] lastFieldChars, int value2)
-
toBytes
public byte[] toBytes()
-
count
public int count()
-
writeString
public void writeString(String value)
从类复制的说明:Writer
写入一个String值- 指定者:
writeString
在类中JsonWriter
- 参数:
value
- String值
-
writeString
public void writeString(boolean quote, String value)
- 指定者:
writeString
在类中JsonWriter
-
writeBoolean
public void writeBoolean(boolean value)
从类复制的说明:Writer
写入一个boolean值- 指定者:
writeBoolean
在类中JsonWriter
- 参数:
value
- boolean值
-
writeInt
public void writeInt(int value)
从类复制的说明:Writer
写入一个int值- 指定者:
writeInt
在类中JsonWriter
- 参数:
value
- int值
-
writeLong
public void writeLong(long value)
从类复制的说明:Writer
写入一个long值- 指定者:
writeLong
在类中JsonWriter
- 参数:
value
- long值
-
writeWrapper
public void writeWrapper(StringWrapper wrapper)
从类复制的说明:Writer
写入一个StringConvertWrapper值- 指定者:
writeWrapper
在类中Writer
- 参数:
wrapper
- StringConvertWrapper值
-
-