org.codehaus.jackson.impl
Class JsonGeneratorBase
java.lang.Object
org.codehaus.jackson.JsonGenerator
org.codehaus.jackson.impl.JsonGeneratorBase
- Direct Known Subclasses:
- WriterBasedGenerator
public abstract class JsonGeneratorBase
- extends JsonGenerator
This base class defines API that a JSON generator exposes
to applications, as well as internal API that sub-classes
have to implement.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
mWriteContext
protected JsonWriteContext mWriteContext
JsonGeneratorBase
protected JsonGeneratorBase()
useDefaultPrettyPrinter
public final void useDefaultPrettyPrinter()
- Description copied from class:
JsonGenerator
- Convenience method for enabling pretty-printing using
the default pretty printer
(
DefaultPrettyPrinter
).
- Specified by:
useDefaultPrettyPrinter
in class JsonGenerator
writeStartArray
public void writeStartArray()
throws IOException,
JsonGenerationException
- Specified by:
writeStartArray
in class JsonGenerator
- Throws:
IOException
JsonGenerationException
doWriteStartArray
protected abstract void doWriteStartArray()
throws IOException,
JsonGenerationException
- Throws:
IOException
JsonGenerationException
writeEndArray
public void writeEndArray()
throws IOException,
JsonGenerationException
- Specified by:
writeEndArray
in class JsonGenerator
- Throws:
IOException
JsonGenerationException
doWriteEndArray
protected abstract void doWriteEndArray()
throws IOException,
JsonGenerationException
- Throws:
IOException
JsonGenerationException
writeStartObject
public void writeStartObject()
throws IOException,
JsonGenerationException
- Specified by:
writeStartObject
in class JsonGenerator
- Throws:
IOException
JsonGenerationException
doWriteStartObject
protected abstract void doWriteStartObject()
throws IOException,
JsonGenerationException
- Throws:
IOException
JsonGenerationException
writeEndObject
public void writeEndObject()
throws IOException,
JsonGenerationException
- Specified by:
writeEndObject
in class JsonGenerator
- Throws:
IOException
JsonGenerationException
doWriteEndObject
protected abstract void doWriteEndObject()
throws IOException,
JsonGenerationException
- Specified by:
doWriteEndObject
in class JsonGenerator
- Throws:
IOException
JsonGenerationException
writeFieldName
public void writeFieldName(String name)
throws IOException,
JsonGenerationException
- Specified by:
writeFieldName
in class JsonGenerator
- Throws:
IOException
JsonGenerationException
doWriteFieldName
public abstract void doWriteFieldName(String name,
boolean commaBefore)
throws IOException,
JsonGenerationException
- Specified by:
doWriteFieldName
in class JsonGenerator
- Throws:
IOException
JsonGenerationException
writeString
public abstract void writeString(String text)
throws IOException,
JsonGenerationException
- Specified by:
writeString
in class JsonGenerator
- Throws:
IOException
JsonGenerationException
writeString
public abstract void writeString(char[] text,
int offset,
int len)
throws IOException,
JsonGenerationException
- Specified by:
writeString
in class JsonGenerator
- Throws:
IOException
JsonGenerationException
writeRaw
public abstract void writeRaw(String text)
throws IOException,
JsonGenerationException
- Description copied from class:
JsonGenerator
- Fallback method which can be used to make generator copy
input text verbatim with no modifications
- Specified by:
writeRaw
in class JsonGenerator
- Throws:
IOException
JsonGenerationException
writeRaw
public abstract void writeRaw(char[] text,
int offset,
int len)
throws IOException,
JsonGenerationException
- Specified by:
writeRaw
in class JsonGenerator
- Throws:
IOException
JsonGenerationException
writeBinary
public abstract void writeBinary(byte[] data,
int offset,
int len)
throws IOException,
JsonGenerationException
- Description copied from class:
JsonGenerator
- Method that will output given chunk of binary data as base64
encoded, as a complete String value (surrounded by double quotes).
Note:
- Specified by:
writeBinary
in class JsonGenerator
- Throws:
IOException
JsonGenerationException
writeNumber
public abstract void writeNumber(int i)
throws IOException,
JsonGenerationException
- Specified by:
writeNumber
in class JsonGenerator
- Throws:
IOException
JsonGenerationException
writeNumber
public abstract void writeNumber(long l)
throws IOException,
JsonGenerationException
- Specified by:
writeNumber
in class JsonGenerator
- Throws:
IOException
JsonGenerationException
writeNumber
public abstract void writeNumber(double d)
throws IOException,
JsonGenerationException
- Specified by:
writeNumber
in class JsonGenerator
- Throws:
IOException
JsonGenerationException
writeNumber
public abstract void writeNumber(float f)
throws IOException,
JsonGenerationException
- Specified by:
writeNumber
in class JsonGenerator
- Throws:
IOException
JsonGenerationException
writeNumber
public abstract void writeNumber(BigDecimal dec)
throws IOException,
JsonGenerationException
- Specified by:
writeNumber
in class JsonGenerator
- Throws:
IOException
JsonGenerationException
writeBoolean
public abstract void writeBoolean(boolean state)
throws IOException,
JsonGenerationException
- Specified by:
writeBoolean
in class JsonGenerator
- Throws:
IOException
JsonGenerationException
writeNull
public abstract void writeNull()
throws IOException,
JsonGenerationException
- Specified by:
writeNull
in class JsonGenerator
- Throws:
IOException
JsonGenerationException
releaseBuffers
protected abstract void releaseBuffers()
flush
public abstract void flush()
throws IOException
- Specified by:
flush
in class JsonGenerator
- Throws:
IOException
close
public abstract void close()
throws IOException
- Specified by:
close
in class JsonGenerator
- Throws:
IOException
verifyValueWrite
protected abstract void verifyValueWrite(String typeMsg)
throws IOException,
JsonGenerationException
- Throws:
IOException
JsonGenerationException
reportError
protected void reportError(String msg)
throws JsonGenerationException
- Throws:
JsonGenerationException
Apache License, Version 2.0