CBORParser and CBORGenerator
instances; both of which handle
CBOR
encoded data.
Note on using non-byte-based sources/targets (char based, like
java. and java.): these can not be
used for CBOR documents; attempt will throw exception.
| Modifier and Type | Field and Description |
|---|---|
| protected final transient ByteQuadsCanonicalizer | _byteSymbolCanonicalizer
Alternative to the basic symbol table, some stream-based parsers use different name canonicalization method. |
| pack-priv static final int | DEFAULT_CBOR_GENERATOR_FEATURE_FLAGS
Bitfield (set of flags) of all generator features that are enabled by default. |
| pack-priv static final int | DEFAULT_CBOR_PARSER_FEATURE_FLAGS
Bitfield (set of flags) of all generator features that are enabled by default. |
| public static final String | FORMAT_NAME
Name used to identify CBOR format. |
| private static final long |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| protected |
| Modifier and Type | Method and Description |
|---|---|
| protected IOContext | _createContext(ContentReference contentRef, boolean resourceManaged)
Overrides tools. Overridable factory method that actually instantiates desired context object. |
| protected JsonGenerator | _createGenerator(ObjectWriteContext writeCtxt, IOContext ioCtxt, OutputStream out)
Implements abstract tools. Overridable factory method that actually instantiates generator for
given |
| protected CBORParser | _createParser(ObjectReadContext readCtxt, IOContext ioCtxt, InputStream in)
Implements abstract tools. Overridable factory method that actually instantiates desired parser. |
| protected CBORParser | _createParser(ObjectReadContext readCtxt, IOContext ioCtxt, byte[] data, int offset, int len)
Implements abstract tools. Overridable factory method that actually instantiates desired parser. |
| protected JsonParser | _createParser(ObjectReadContext readCtxt, IOContext ctxt, DataInput input)
Implements abstract tools.
|
| public static CBORFactoryBuilder | builder()
Main factory method to use for constructing |
| public boolean | canParseAsync()
Implements abstract tools. Introspection method that can be used to check whether this
factory can create non-blocking parsers: parsers that do not
use blocking I/O abstractions but instead use a
|
| public boolean | canUseSchema(FormatSchema schema)
Implements abstract tools. Method that can be used to quickly check whether given schema is something that parsers and/or generators constructed by this factory could use. |
| public PropertyNameMatcher | constructCINameMatcher(List<Named> matches, boolean alreadyInterned, Locale locale)
Overrides tools. Factory method for constructing case-insensitive |
| public PropertyNameMatcher | constructNameMatcher(List<Named> matches, boolean alreadyInterned)
Overrides tools. Factory method for constructing case-sensitive |
| public CBORFactory | copy()
Implements abstract tools. Method similar to |
| public String | getFormatName()
Implements abstract tools. Method that returns short textual id identifying format this factory supports. |
| public Class | getFormatReadFeatureType()
Overrides tools. Method for accessing kind of |
| public Class | getFormatWriteFeatureType()
Overrides tools. Method for accessing kind of |
| public boolean | |
| public boolean | |
| protected Object | readResolve()
Method that we need to override to actually make restoration go through constructors etc. Also: must be overridden by sub-classes as well. |
| public CBORFactoryBuilder | rebuild()
Implements abstract tools. Method that can be used to create differently configured stream factories: it will create and return a Builder instance with exact settings of this stream factory. |
| public TokenStreamFactory | snapshot()
Implements abstract tools. Implements tools. Instances are immutable so just return `this` |
| public Version | version()
Implements abstract tools. Implements tools. 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 |
| _byteSymbolCanonicalizer | back to summary |
|---|---|
| protected final transient ByteQuadsCanonicalizer _byteSymbolCanonicalizer Alternative to the basic symbol table, some stream-based parsers use different name canonicalization method. | |
| DEFAULT_CBOR_GENERATOR_FEATURE_FLAGS | back to summary |
|---|---|
| pack-priv static final int DEFAULT_CBOR_GENERATOR_FEATURE_FLAGS Bitfield (set of flags) of all generator features that are enabled by default. | |
| DEFAULT_CBOR_PARSER_FEATURE_FLAGS | back to summary |
|---|---|
| pack-priv static final int DEFAULT_CBOR_PARSER_FEATURE_FLAGS Bitfield (set of flags) of all generator features that are enabled by default. | |
| FORMAT_NAME | back to summary |
|---|---|
| public static final String FORMAT_NAME Name used to identify CBOR format.
(and returned by | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides tools. | |
| CBORFactory | back to summary |
|---|---|
| public CBORFactory() Default constructor used to create factory instances. Creation of a factory instance is a light-weight operation, but it is still a good idea to reuse limited number of factory instances (and quite often just a single instance): factories are used as context for storing some reused processing objects (such as symbol tables parsers use) and this reuse only works within context of a single factory instance. | |
| CBORFactory | back to summary |
|---|---|
| public CBORFactory(CBORFactory src) | |
| CBORFactory | back to summary |
|---|---|
| protected CBORFactory(CBORFactoryBuilder b) Constructors used by
| |
| _createContext | back to summary |
|---|---|
| protected IOContext _createContext(ContentReference contentRef, boolean resourceManaged) Overrides tools. Doc from tools. Overridable factory method that actually instantiates desired context object.
| |
| _createGenerator | back to summary |
|---|---|
| protected JsonGenerator _createGenerator(ObjectWriteContext writeCtxt, IOContext ioCtxt, OutputStream out) Implements abstract tools. Doc from tools. 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 CBORParser _createParser(ObjectReadContext readCtxt, IOContext ioCtxt, InputStream in) Implements abstract tools. Overridable factory method that actually instantiates desired parser.
| |
| _createParser | back to summary |
|---|---|
| protected CBORParser _createParser(ObjectReadContext readCtxt, IOContext ioCtxt, byte[] data, int offset, int len) Implements abstract tools. Overridable factory method that actually instantiates desired parser.
| |
| _createParser | back to summary |
|---|---|
| protected JsonParser _createParser(ObjectReadContext readCtxt, IOContext ctxt, DataInput input) Implements abstract tools.
| |
| builder | back to summary |
|---|---|
| public static CBORFactoryBuilder builder() Main factory method to use for constructing | |
| canParseAsync | back to summary |
|---|---|
| public boolean canParseAsync() Implements abstract tools. Doc from tools. Introspection method that can be used to check whether this
factory can create non-blocking parsers: parsers that do not
use blocking I/O abstractions but instead use a
| |
| canUseSchema | back to summary |
|---|---|
| public boolean canUseSchema(FormatSchema schema) Implements abstract tools. Doc from tools. Method that can be used to quickly check whether given schema is something that parsers and/or generators constructed by this factory could use. Note that this means possible use, at the level of data format (i.e. schema is for same data format as parsers and generators this factory constructs); individual schema instances may have further usage restrictions.
| |
| constructCINameMatcher | back to summary |
|---|---|
| public PropertyNameMatcher constructCINameMatcher(List<Named> matches, boolean alreadyInterned, Locale locale) Overrides tools. Doc from tools. Factory method for constructing case-insensitive
| |
| constructNameMatcher | back to summary |
|---|---|
| public PropertyNameMatcher constructNameMatcher(List<Named> matches, boolean alreadyInterned) Overrides tools. Doc from tools. Factory method for constructing case-sensitive
| |
| copy | back to summary |
|---|---|
| public CBORFactory copy() Implements abstract tools. Doc from tools. Method similar to Implementation should be functionally equivalent to:
factoryInstance.rebuild().build();
| |
| getFormatName | back to summary |
|---|---|
| public String getFormatName() Implements abstract tools. Doc from tools. Method that returns short textual id identifying format this factory supports.
| |
| getFormatReadFeatureType | back to summary |
|---|---|
| public Class Overrides tools. Doc from tools. Method for accessing kind of
| |
| getFormatWriteFeatureType | back to summary |
|---|---|
| public Class Overrides tools. Doc from tools. Method for accessing kind of
| |
| isEnabled | back to summary |
|---|---|
| public boolean isEnabled(CBORReadFeature f) Check whether specified CBOR-specific stream read feature is enabled. | |
| isEnabled | back to summary |
|---|---|
| public boolean isEnabled(CBORWriteFeature f) Check whether specified CBOR-specific stream write feature is enabled. | |
| readResolve | back to summary |
|---|---|
| protected Object readResolve() 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 CBORFactoryBuilder rebuild() Implements abstract tools. Doc from tools. Method that can be used to create differently configured stream factories: it will create and return a Builder instance with exact settings of this stream factory.
| |
| snapshot | back to summary |
|---|---|
| public TokenStreamFactory snapshot() Implements abstract tools. Implements tools. Instances are immutable so just return `this`
| |
| version | back to summary |
|---|---|
| public Version version() Implements abstract tools. Implements tools. Doc from tools. 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
| |