Class YAMLFactory

  • All Implemented Interfaces:
    com.fasterxml.jackson.core.Versioned, java.io.Serializable

    public class YAMLFactory
    extends com.fasterxml.jackson.core.JsonFactory
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.fasterxml.jackson.core.JsonFactory

        com.fasterxml.jackson.core.JsonFactory.Feature
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.yaml.snakeyaml.DumperOptions.Version _version  
      protected int _yamlGeneratorFeatures  
      protected int _yamlParserFeatures  
      protected static int DEFAULT_YAML_GENERATOR_FEATURE_FLAGS
      Bitfield (set of flags) of all generator features that are enabled by default.
      protected static int DEFAULT_YAML_PARSER_FEATURE_FLAGS
      Bitfield (set of flags) of all parser features that are enabled by default.
      static java.lang.String FORMAT_NAME_YAML
      Name used to identify YAML format.
      protected java.nio.charset.Charset UTF8  
      • Fields inherited from class com.fasterxml.jackson.core.JsonFactory

        _byteSymbolCanonicalizer, _characterEscapes, _factoryFeatures, _generatorFeatures, _inputDecorator, _objectCodec, _outputDecorator, _parserFeatures, _rootCharSymbols, _rootValueSeparator, DEFAULT_FACTORY_FEATURE_FLAGS, DEFAULT_GENERATOR_FEATURE_FLAGS, DEFAULT_PARSER_FEATURE_FLAGS, FORMAT_NAME_JSON
    • Constructor Summary

      Constructors 
      Constructor Description
      YAMLFactory()
      Default constructor used to create factory instances.
      YAMLFactory​(com.fasterxml.jackson.core.ObjectCodec oc)  
      YAMLFactory​(YAMLFactory src, com.fasterxml.jackson.core.ObjectCodec oc)  
    • Field Detail

      • DEFAULT_YAML_PARSER_FEATURE_FLAGS

        protected static final int DEFAULT_YAML_PARSER_FEATURE_FLAGS
        Bitfield (set of flags) of all parser features that are enabled by default.
      • DEFAULT_YAML_GENERATOR_FEATURE_FLAGS

        protected static final int DEFAULT_YAML_GENERATOR_FEATURE_FLAGS
        Bitfield (set of flags) of all generator features that are enabled by default.
      • _yamlParserFeatures

        protected int _yamlParserFeatures
      • _yamlGeneratorFeatures

        protected int _yamlGeneratorFeatures
      • _version

        protected org.yaml.snakeyaml.DumperOptions.Version _version
      • UTF8

        protected final java.nio.charset.Charset UTF8
    • Constructor Detail

      • YAMLFactory

        public YAMLFactory()
        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.
      • YAMLFactory

        public YAMLFactory​(com.fasterxml.jackson.core.ObjectCodec oc)
      • YAMLFactory

        public YAMLFactory​(YAMLFactory src,
                           com.fasterxml.jackson.core.ObjectCodec oc)
        Since:
        2.2.1
    • Method Detail

      • copy

        public YAMLFactory copy()
        Overrides:
        copy in class com.fasterxml.jackson.core.JsonFactory
      • readResolve

        protected java.lang.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.
        Overrides:
        readResolve in class com.fasterxml.jackson.core.JsonFactory
      • version

        public com.fasterxml.jackson.core.Version version()
        Specified by:
        version in interface com.fasterxml.jackson.core.Versioned
        Overrides:
        version in class com.fasterxml.jackson.core.JsonFactory
      • canUseCharArrays

        public boolean canUseCharArrays()
        Overrides:
        canUseCharArrays in class com.fasterxml.jackson.core.JsonFactory
      • getFormatName

        public java.lang.String getFormatName()
        Overrides:
        getFormatName in class com.fasterxml.jackson.core.JsonFactory
      • hasFormat

        public com.fasterxml.jackson.core.format.MatchStrength hasFormat​(com.fasterxml.jackson.core.format.InputAccessor acc)
                                                                  throws java.io.IOException
        Sub-classes need to override this method (as of 1.8)
        Overrides:
        hasFormat in class com.fasterxml.jackson.core.JsonFactory
        Throws:
        java.io.IOException
      • isEnabled

        public final boolean isEnabled​(YAMLParser.Feature f)
        Checked whether specified parser feature is enabled.
      • isEnabled

        public final boolean isEnabled​(YAMLGenerator.Feature f)
        Check whether specified generator feature is enabled.
      • createParser

        public YAMLParser createParser​(java.lang.String content)
                                throws java.io.IOException
        Overrides:
        createParser in class com.fasterxml.jackson.core.JsonFactory
        Throws:
        java.io.IOException
      • createParser

        public YAMLParser createParser​(java.io.File f)
                                throws java.io.IOException
        Overrides:
        createParser in class com.fasterxml.jackson.core.JsonFactory
        Throws:
        java.io.IOException
      • createParser

        public YAMLParser createParser​(java.net.URL url)
                                throws java.io.IOException
        Overrides:
        createParser in class com.fasterxml.jackson.core.JsonFactory
        Throws:
        java.io.IOException
      • createParser

        public YAMLParser createParser​(java.io.InputStream in)
                                throws java.io.IOException
        Overrides:
        createParser in class com.fasterxml.jackson.core.JsonFactory
        Throws:
        java.io.IOException
      • createParser

        public YAMLParser createParser​(java.io.Reader r)
                                throws java.io.IOException
        Overrides:
        createParser in class com.fasterxml.jackson.core.JsonFactory
        Throws:
        java.io.IOException
      • createParser

        public YAMLParser createParser​(char[] data)
                                throws java.io.IOException
        Overrides:
        createParser in class com.fasterxml.jackson.core.JsonFactory
        Throws:
        java.io.IOException
      • createParser

        public YAMLParser createParser​(char[] data,
                                       int offset,
                                       int len)
                                throws java.io.IOException
        Overrides:
        createParser in class com.fasterxml.jackson.core.JsonFactory
        Throws:
        java.io.IOException
      • createParser

        public YAMLParser createParser​(byte[] data)
                                throws java.io.IOException
        Overrides:
        createParser in class com.fasterxml.jackson.core.JsonFactory
        Throws:
        java.io.IOException
      • createParser

        public YAMLParser createParser​(byte[] data,
                                       int offset,
                                       int len)
                                throws java.io.IOException
        Overrides:
        createParser in class com.fasterxml.jackson.core.JsonFactory
        Throws:
        java.io.IOException
      • createGenerator

        public YAMLGenerator createGenerator​(java.io.OutputStream out,
                                             com.fasterxml.jackson.core.JsonEncoding enc)
                                      throws java.io.IOException
        Overrides:
        createGenerator in class com.fasterxml.jackson.core.JsonFactory
        Throws:
        java.io.IOException
      • createGenerator

        public YAMLGenerator createGenerator​(java.io.OutputStream out)
                                      throws java.io.IOException
        Overrides:
        createGenerator in class com.fasterxml.jackson.core.JsonFactory
        Throws:
        java.io.IOException
      • createGenerator

        public YAMLGenerator createGenerator​(java.io.Writer out)
                                      throws java.io.IOException
        Overrides:
        createGenerator in class com.fasterxml.jackson.core.JsonFactory
        Throws:
        java.io.IOException
      • createGenerator

        public com.fasterxml.jackson.core.JsonGenerator createGenerator​(java.io.File f,
                                                                        com.fasterxml.jackson.core.JsonEncoding enc)
                                                                 throws java.io.IOException
        Overrides:
        createGenerator in class com.fasterxml.jackson.core.JsonFactory
        Throws:
        java.io.IOException
      • _createParser

        protected YAMLParser _createParser​(java.io.InputStream in,
                                           com.fasterxml.jackson.core.io.IOContext ctxt)
                                    throws java.io.IOException
        Overrides:
        _createParser in class com.fasterxml.jackson.core.JsonFactory
        Throws:
        java.io.IOException
      • _createParser

        protected YAMLParser _createParser​(java.io.Reader r,
                                           com.fasterxml.jackson.core.io.IOContext ctxt)
                                    throws java.io.IOException
        Overrides:
        _createParser in class com.fasterxml.jackson.core.JsonFactory
        Throws:
        java.io.IOException
      • _createParser

        protected YAMLParser _createParser​(char[] data,
                                           int offset,
                                           int len,
                                           com.fasterxml.jackson.core.io.IOContext ctxt,
                                           boolean recyclable)
                                    throws java.io.IOException
        Overrides:
        _createParser in class com.fasterxml.jackson.core.JsonFactory
        Throws:
        java.io.IOException
      • _createParser

        protected YAMLParser _createParser​(byte[] data,
                                           int offset,
                                           int len,
                                           com.fasterxml.jackson.core.io.IOContext ctxt)
                                    throws java.io.IOException
        Overrides:
        _createParser in class com.fasterxml.jackson.core.JsonFactory
        Throws:
        java.io.IOException
      • _createGenerator

        protected YAMLGenerator _createGenerator​(java.io.Writer out,
                                                 com.fasterxml.jackson.core.io.IOContext ctxt)
                                          throws java.io.IOException
        Overrides:
        _createGenerator in class com.fasterxml.jackson.core.JsonFactory
        Throws:
        java.io.IOException
      • _createUTF8Generator

        protected YAMLGenerator _createUTF8Generator​(java.io.OutputStream out,
                                                     com.fasterxml.jackson.core.io.IOContext ctxt)
                                              throws java.io.IOException
        Overrides:
        _createUTF8Generator in class com.fasterxml.jackson.core.JsonFactory
        Throws:
        java.io.IOException
      • _createWriter

        protected java.io.Writer _createWriter​(java.io.OutputStream out,
                                               com.fasterxml.jackson.core.JsonEncoding enc,
                                               com.fasterxml.jackson.core.io.IOContext ctxt)
                                        throws java.io.IOException
        Overrides:
        _createWriter in class com.fasterxml.jackson.core.JsonFactory
        Throws:
        java.io.IOException
      • _createReader

        protected java.io.Reader _createReader​(java.io.InputStream in,
                                               com.fasterxml.jackson.core.JsonEncoding enc,
                                               com.fasterxml.jackson.core.io.IOContext ctxt)
                                        throws java.io.IOException
        Throws:
        java.io.IOException
      • _createReader

        protected java.io.Reader _createReader​(byte[] data,
                                               int offset,
                                               int len,
                                               com.fasterxml.jackson.core.JsonEncoding enc,
                                               com.fasterxml.jackson.core.io.IOContext ctxt)
                                        throws java.io.IOException
        Throws:
        java.io.IOException