Top Fields Constructors Methods
tools.jackson.dataformat.protobuf

public Class ProtobufFactory

extends BinaryTSFactory
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
java.io.*, tools.jackson.core.*, tools.jackson.core.base.BinaryTSFactory, tools.jackson.core.io.IOContext, .ContentReference, tools.jackson.dataformat.protobuf.schema.ProtobufSchema

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
public
protected
protected
ProtobufFactory(ProtobufFactoryBuilder b)

Constructors used by ProtobufFactoryBuilder for instantiation.

Method Summary

Modifier and TypeMethod and Description
protected IOContext
_createContext(ContentReference contentRef, boolean resourceManaged)

Overrides tools.jackson.core.TokenStreamFactory._createContext.

Overridable factory method that actually instantiates desired context object.

protected ProtobufGenerator
_createGenerator(ObjectWriteContext writeCtxt, IOContext ioCtxt, OutputStream out)

Implements abstract tools.jackson.core.base.BinaryTSFactory._createGenerator.

Overridable factory method that actually instantiates generator for given OutputStream and context object, using UTF-8 encoding.

protected ProtobufParser
protected ProtobufParser
_createParser(ObjectReadContext readCtxt, IOContext ioCtxt, byte[] data, int offset, int len)

Implements abstract tools.jackson.core.base.BinaryTSFactory._createParser.

protected JsonParser
public static ProtobufFactoryBuilder
builder()

Main factory method to use for constructing ProtobufFactory instances with different configuration.

public boolean
canParseAsync()

Implements abstract tools.jackson.core.TokenStreamFactory.canParseAsync.

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 tools.jackson.core.async.NonBlockingInputFeeder.

public boolean
canUseSchema(FormatSchema schema)

Implements abstract tools.jackson.core.TokenStreamFactory.canUseSchema.

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 ProtobufFactory
copy()

Implements abstract tools.jackson.core.TokenStreamFactory.copy.

Method similar to snapshot(), but one that forces creation of actual new copy that does NOT share any state, even non-visible to calling code, such as symbol table reuse.

public String
getFormatName()

Implements abstract tools.jackson.core.TokenStreamFactory.getFormatName.

Method that returns short textual id identifying format this factory supports.

public int
public int
protected Object
readResolve()

Method that we need to override to actually make restoration go through constructors etc.

public ProtobufFactoryBuilder
rebuild()

Implements abstract tools.jackson.core.TokenStreamFactory.rebuild.

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 boolean
requiresPropertyOrdering()

Overrides tools.jackson.core.TokenStreamFactory.requiresPropertyOrdering.

Introspection method that higher-level functionality may call to see whether underlying data format requires a stable ordering of object properties or not.

public TokenStreamFactory
snapshot()

Implements abstract tools.jackson.core.TokenStreamFactory.snapshot.

Implements tools.jackson.core.util.Snapshottable.snapshot.

Instances are immutable so just return `this`

public Version
version()

Implements abstract tools.jackson.core.TokenStreamFactory.version.

Implements tools.jackson.core.Versioned.version.

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 Version for details).

Inherited from tools.jackson.core.base.BinaryTSFactory:
_createContentReference_createContentReference_nonByteSource_nonByteTargetcanHandleBinaryNativelycreateGeneratorcreateGeneratorcreateGeneratorcreateGeneratorcreateParsercreateParsercreateParsercreateParsercreateParsercreateParsercreateParsercreateParser

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides tools.jackson.core.base.BinaryTSFactory.serialVersionUID.

Constructor Detail

ProtobufFactoryback to summary
public ProtobufFactory()
ProtobufFactoryback to summary
protected ProtobufFactory(ProtobufFactory src)
ProtobufFactoryback to summary
protected ProtobufFactory(ProtobufFactoryBuilder b)

Constructors used by ProtobufFactoryBuilder for instantiation.

Since
3.0

Method Detail

_createContextback to summary
protected IOContext _createContext(ContentReference contentRef, boolean resourceManaged)

Overrides tools.jackson.core.TokenStreamFactory._createContext.

Doc from tools.jackson.core.TokenStreamFactory._createContext.

Overridable factory method that actually instantiates desired context object.

Annotations
@Override
_createGeneratorback to summary
protected ProtobufGenerator _createGenerator(ObjectWriteContext writeCtxt, IOContext ioCtxt, OutputStream out)

Implements abstract tools.jackson.core.base.BinaryTSFactory._createGenerator.

Doc from tools.jackson.core.base.BinaryTSFactory._createGenerator.

Overridable factory method that actually instantiates generator for given OutputStream and context object, using UTF-8 encoding.

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.

Annotations
@Override
_createParserback to summary
protected ProtobufParser _createParser(ObjectReadContext readCtxt, IOContext ioCtxt, InputStream in)

Implements abstract tools.jackson.core.base.BinaryTSFactory._createParser.

Annotations
@Override
_createParserback to summary
protected ProtobufParser _createParser(ObjectReadContext readCtxt, IOContext ioCtxt, byte[] data, int offset, int len)

Implements abstract tools.jackson.core.base.BinaryTSFactory._createParser.

Annotations
@Override
_createParserback to summary
protected JsonParser _createParser(ObjectReadContext readCtxt, IOContext ioCtxt, DataInput input)

Implements abstract tools.jackson.core.base.BinaryTSFactory._createParser.

Annotations
@Override
builderback to summary
public static ProtobufFactoryBuilder builder()

Main factory method to use for constructing ProtobufFactory instances with different configuration.

canParseAsyncback to summary
public boolean canParseAsync()

Implements abstract tools.jackson.core.TokenStreamFactory.canParseAsync.

Doc from tools.jackson.core.TokenStreamFactory.canParseAsync.

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 tools.jackson.core.async.NonBlockingInputFeeder.

Annotations
@Override
canUseSchemaback to summary
public boolean canUseSchema(FormatSchema schema)

Implements abstract tools.jackson.core.TokenStreamFactory.canUseSchema.

Doc from tools.jackson.core.TokenStreamFactory.canUseSchema.

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.

Annotations
@Override
copyback to summary
public ProtobufFactory copy()

Implements abstract tools.jackson.core.TokenStreamFactory.copy.

Doc from tools.jackson.core.TokenStreamFactory.copy.

Method similar to snapshot(), but one that forces creation of actual new copy that does NOT share any state, even non-visible to calling code, such as symbol table reuse.

Implementation should be functionally equivalent to:

    factoryInstance.rebuild().build();
Annotations
@Override
getFormatNameback to summary
public String getFormatName()

Implements abstract tools.jackson.core.TokenStreamFactory.getFormatName.

Doc from tools.jackson.core.TokenStreamFactory.getFormatName.

Method that returns short textual id identifying format this factory supports.

Annotations
@Override
getFormatReadFeaturesback to summary
public int getFormatReadFeatures()

Overrides tools.jackson.core.TokenStreamFactory.getFormatReadFeatures.

Annotations
@Override
getFormatWriteFeaturesback to summary
public int getFormatWriteFeatures()

Overrides tools.jackson.core.TokenStreamFactory.getFormatWriteFeatures.

Annotations
@Override
readResolveback to summary
protected Object readResolve()

Method that we need to override to actually make restoration go through constructors etc.

rebuildback to summary
public ProtobufFactoryBuilder rebuild()

Implements abstract tools.jackson.core.TokenStreamFactory.rebuild.

Doc from tools.jackson.core.TokenStreamFactory.rebuild.

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.

Annotations
@Override
requiresPropertyOrderingback to summary
public boolean requiresPropertyOrdering()

Overrides tools.jackson.core.TokenStreamFactory.requiresPropertyOrdering.

Doc from tools.jackson.core.TokenStreamFactory.requiresPropertyOrdering.

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.

Annotations
@Override
snapshotback to summary
public TokenStreamFactory snapshot()

Implements abstract tools.jackson.core.TokenStreamFactory.snapshot.

Implements tools.jackson.core.util.Snapshottable.snapshot.

Instances are immutable so just return `this`

Annotations
@Override
versionback to summary
public Version version()

Implements abstract tools.jackson.core.TokenStreamFactory.version.

Implements tools.jackson.core.Versioned.version.

Doc from tools.jackson.core.Versioned.version.

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 Version for details).

Annotations
@Override