| Modifier and Type | Field and Description |
|---|---|
| private static final long |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| protected | |
| protected | ProtobufFactory(ProtobufFactoryBuilder b)
Constructors used by |
| Modifier and Type | Method and Description |
|---|---|
| protected IOContext | _createContext(ContentReference
Source/target reference to use for diagnostics, exception messages contentRef, boolean Whether input/output buffer is managed by this factory or not resourceManaged)Overrides com. Overridable factory method that actually instantiates desired context object. |
| protected ProtobufGenerator | _createGenerator(Writer
Writer underlying writer to write generated content to out, IOContext I/O context to use ctxt)Overrides com. Overridable factory method that actually instantiates generator for
given |
| protected ProtobufParser | _createParser(InputStream
InputStream to use for reading content to parse in, IOContext I/O context to use for parsing ctxt)Overrides com. Overridable factory method that actually instantiates desired parser
given |
| protected JsonParser | _createParser(Reader
Reader to use for reading content to parse r, IOContext I/O context to use for parsing ctxt)Overrides com. Overridable factory method that actually instantiates parser
using given |
| protected JsonParser | _createParser(char[]
Buffer that contains content to parse data, int Offset to the first character of data to parse offset, int Number of characters within buffer to parse len, IOContext I/O context to use for parsing ctxt, boolean Whether input buffer is recycled by the factory recyclable)Overrides com. Overridable factory method that actually instantiates parser
using given |
| protected ProtobufParser | _createParser(byte[]
Buffer that contains content to parse data, int Offset to the first character of data to parse offset, int Number of characters within buffer to parse len, IOContext I/O context to use for parsing ctxt)Overrides com. Overridable factory method that actually instantiates parser
using given |
| private final ProtobufGenerator | |
| protected ProtobufGenerator | _createUTF8Generator(OutputStream
OutputStream underlying writer to write generated content to out, IOContext I/O context to use ctxt)Overrides com. Overridable factory method that actually instantiates generator for
given |
| protected Writer | _createWriter(OutputStream out, JsonEncoding enc, IOContext ctxt)
Overrides com.
|
| protected <T> T | |
| protected <T> T | |
| public static ProtobufFactoryBuilder | builder()
Hides com. Main factory method to use for constructing |
| public boolean | canHandleBinaryNatively()
Overrides com. Introspection method that higher-level functionality may call to see whether underlying data format can read and write binary data natively; that is, embeded it as-is without using encodings such as Base64. |
| public boolean | canUseCharArrays()
Overrides com. Introspection method that can be used by base factory to check
whether access using |
| public ProtobufFactory | copy()
Overrides com. Method for constructing a new |
| public ProtobufGenerator | createGenerator(OutputStream
OutputStream to use for writing JSON content out, JsonEncoding Character encoding to use enc)Overrides com. Method for constructing JSON generator for writing JSON content using specified output stream. |
| public ProtobufGenerator | createGenerator(OutputStream out)
Overrides com. Method for constructing |
| public ProtobufParser | createParser(File
File that contains JSON content to parse f)Overrides com. Method for constructing JSON parser instance to parse contents of specified file. |
| public ProtobufParser | createParser(URL
URL pointing to resource that contains JSON content to parse url)Overrides com. Method for constructing JSON parser instance to parse contents of resource reference by given URL. |
| public ProtobufParser | createParser(InputStream
InputStream to use for reading JSON content to parse in)Overrides com. Method for constructing JSON parser instance to parse the contents accessed via specified input stream. |
| public ProtobufParser | createParser(byte[] data)
Overrides com. Method for constructing parser for parsing the contents of given byte array. |
| public ProtobufParser | createParser(byte[]
Buffer that contains data to parse data, int Offset of the first data byte within buffer offset, int Length of contents to parse within buffer len)Overrides com. Method for constructing parser for parsing the contents of given byte array. |
| public String | getFormatName()
Overrides com. Method that returns short textual id identifying format this factory supports. |
| public MatchStrength | hasFormat(InputAccessor acc)
Overrides com. Sub-classes need to override this method |
| protected Object | readResolve()
Overrides com. Method that we need to override to actually make restoration go through constructors etc. Also: must be overridden by sub-classes as well. |
| public ProtobufFactoryBuilder | rebuild()
Overrides com. Method that allows construction of differently configured factory, starting with settings of this factory. |
| public boolean | requiresPropertyOrdering()
Overrides com. Introspection method that higher-level functionality may call to see whether underlying data format requires a stable ordering of object properties or not. |
| public Version | version()
Overrides com. Implements com. Method called to detect version of the component that implements this interface;
returned version should never be null, but may return specific "not available"
instance (see |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides com. | |
| ProtobufFactory | back to summary |
|---|---|
| public ProtobufFactory() | |
| ProtobufFactory | back to summary |
|---|---|
| public ProtobufFactory(ObjectCodec codec) | |
| ProtobufFactory | back to summary |
|---|---|
| protected ProtobufFactory(ProtobufFactory src, ObjectCodec oc) | |
| ProtobufFactory | back to summary |
|---|---|
| protected ProtobufFactory(ProtobufFactoryBuilder b) Constructors used by
| |
| _createContext | back to summary |
|---|---|
| protected IOContext _createContext(ContentReference contentRef, boolean resourceManaged) Overrides com. Doc from com. Overridable factory method that actually instantiates desired context object.
| |
| _createGenerator | back to summary |
|---|---|
| protected ProtobufGenerator _createGenerator(Writer out, IOContext ctxt) throws IOException Overrides com. Doc from com. Overridable factory method that actually instantiates generator for
given This method is specifically designed to remain compatible between minor versions so that sub-classes can count on it being called as expected. That is, it is part of official interface from sub-class perspective, although not a public method available to users of factory implementations.
| |
| _createParser | back to summary |
|---|---|
| protected ProtobufParser _createParser(InputStream in, IOContext ctxt) throws IOException Overrides com. Doc from com. Overridable factory method that actually instantiates desired parser
given This method is specifically designed to remain compatible between minor versions so that sub-classes can count on it being called as expected. That is, it is part of official interface from sub-class perspective, although not a public method available to users of factory implementations.
| |
| _createParser | back to summary |
|---|---|
| protected JsonParser _createParser(Reader r, IOContext ctxt) throws IOException Overrides com. Doc from com. Overridable factory method that actually instantiates parser
using given This method is specifically designed to remain compatible between minor versions so that sub-classes can count on it being called as expected. That is, it is part of official interface from sub-class perspective, although not a public method available to users of factory implementations.
| |
| _createParser | back to summary |
|---|---|
| protected JsonParser _createParser(char[] data, int offset, int len, IOContext ctxt, boolean recyclable) throws IOException Overrides com. Doc from com. Overridable factory method that actually instantiates parser
using given
| |
| _createParser | back to summary |
|---|---|
| protected ProtobufParser _createParser(byte[] data, int offset, int len, IOContext ctxt) throws IOException Overrides com. Doc from com. Overridable factory method that actually instantiates parser
using given This method is specifically designed to remain compatible between minor versions so that sub-classes can count on it being called as expected. That is, it is part of official interface from sub-class perspective, although not a public method available to users of factory implementations.
| |
| _createProtobufGenerator | back to summary |
|---|---|
| private final ProtobufGenerator _createProtobufGenerator(IOContext ctxt, int stdFeat, ObjectCodec codec, OutputStream out) throws IOException | |
| _createUTF8Generator | back to summary |
|---|---|
| protected ProtobufGenerator _createUTF8Generator(OutputStream out, IOContext ctxt) throws IOException Overrides com. Doc from com. Overridable factory method that actually instantiates generator for
given This method is specifically designed to remain compatible between minor versions so that sub-classes can count on it being called as expected. That is, it is part of official interface from sub-class perspective, although not a public method available to users of factory implementations.
| |
| _createWriter | back to summary |
|---|---|
| protected Writer _createWriter(OutputStream out, JsonEncoding enc, IOContext ctxt) throws IOException Overrides com.
| |
| _nonByteSource | back to summary |
|---|---|
| protected <T> T _nonByteSource() | |
| _nonByteTarget | back to summary |
|---|---|
| protected <T> T _nonByteTarget() | |
| builder | back to summary |
|---|---|
| public static ProtobufFactoryBuilder builder() Hides com. Main factory method to use for constructing
| |
| canHandleBinaryNatively | back to summary |
|---|---|
| public boolean canHandleBinaryNatively() Overrides com. Doc from com. Introspection method that higher-level functionality may call to see whether underlying data format can read and write binary data natively; that is, embeded it as-is without using encodings such as Base64.
Default implementation returns
| |
| canUseCharArrays | back to summary |
|---|---|
| public boolean canUseCharArrays() Overrides com. Doc from com. Introspection method that can be used by base factory to check
whether access using
| |
| copy | back to summary |
|---|---|
| public ProtobufFactory copy() Overrides com. Doc from com. Method for constructing a new
| |
| createGenerator | back to summary |
|---|---|
| public ProtobufGenerator createGenerator(OutputStream out, JsonEncoding enc) throws IOException Overrides com. Doc from com. Method for constructing JSON generator for writing JSON content using specified output stream. Encoding to use must be specified, and needs to be one of available types (as per JSON specification).
Underlying stream is NOT owned by the generator constructed,
so that generator will NOT close the output stream when
Note there are formats that use fixed encoding (like most binary data formats) and that ignore passed in encoding.
| |
| createGenerator | back to summary |
|---|---|
| public ProtobufGenerator createGenerator(OutputStream out) throws IOException Overrides com. Method for constructing Since protobuf format always uses UTF-8 internally, no encoding need to be passed to this method.
| |
| createParser | back to summary |
|---|---|
| public ProtobufParser createParser(File f) throws IOException Overrides com. Doc from com. Method for constructing JSON parser instance to parse contents of specified file.
Encoding is auto-detected from contents according to JSON
specification recommended mechanism. Json specification
supports only UTF-8, UTF-16 and UTF-32 as valid encodings,
so auto-detection implemented only for this charsets.
For other charsets use Underlying input stream (needed for reading contents) will be owned (and managed, i.e. closed as need be) by the parser, since caller has no access to it.
| |
| createParser | back to summary |
|---|---|
| public ProtobufParser createParser(URL url) throws IOException Overrides com. Doc from com. Method for constructing JSON parser instance to parse contents of resource reference by given URL.
Encoding is auto-detected from contents according to JSON
specification recommended mechanism. Json specification
supports only UTF-8, UTF-16 and UTF-32 as valid encodings,
so auto-detection implemented only for this charsets.
For other charsets use Underlying input stream (needed for reading contents) will be owned (and managed, i.e. closed as need be) by the parser, since caller has no access to it. | |
| createParser | back to summary |
|---|---|
| public ProtobufParser createParser(InputStream in) throws IOException Overrides com. Doc from com. Method for constructing JSON parser instance to parse the contents accessed via specified input stream.
The input stream will not be owned by
the parser, it will still be managed (i.e. closed if
end-of-stream is reacher, or parser close method called)
if (and only if) Note no encoding argument is taken since it can always be
auto-detected as suggested by JSON RFC. Json specification
supports only UTF-8, UTF-16 and UTF-32 as valid encodings,
so auto-detection implemented only for this charsets.
For other charsets use
| |
| createParser | back to summary |
|---|---|
| public ProtobufParser createParser(byte[] data) throws IOException Overrides com. Doc from com. Method for constructing parser for parsing the contents of given byte array.
| |
| createParser | back to summary |
|---|---|
| public ProtobufParser createParser(byte[] data, int offset, int len) throws IOException Overrides com. Doc from com. Method for constructing parser for parsing the contents of given byte array.
| |
| getFormatName | back to summary |
|---|---|
| public String getFormatName() Overrides com. Doc from com. Method that returns short textual id identifying format this factory supports. Note sub-classes should override this method; default implementation will return null for all sub-classes | |
| hasFormat | back to summary |
|---|---|
| public MatchStrength hasFormat(InputAccessor acc) throws IOException Overrides com. Sub-classes need to override this method
| |
| readResolve | back to summary |
|---|---|
| protected Object readResolve() Overrides com. Method that we need to override to actually make restoration go through constructors etc. Also: must be overridden by sub-classes as well.
| |
| rebuild | back to summary |
|---|---|
| public ProtobufFactoryBuilder rebuild() Overrides com. Doc from com. Method that allows construction of differently configured factory, starting with settings of this factory.
| |
| requiresPropertyOrdering | back to summary |
|---|---|
| public boolean requiresPropertyOrdering() Overrides com. Doc from com. Introspection method that higher-level functionality may call to see whether underlying data format requires a stable ordering of object properties or not. This is usually used for determining whether to force a stable ordering (like alphabetic ordering by name) if no ordering if explicitly specified.
Default implementation returns
| |
| version | back to summary |
|---|---|
| public Version version() Overrides com. Implements com. Doc from com. Method called to detect version of the component that implements this interface;
returned version should never be null, but may return specific "not available"
instance (see | |