Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package com.fasterxml.jackson.core.json;
  
  
Intermediate base class shared by JSON-backed generators like UTF8JsonGenerator and WriterBasedJsonGenerator.

Since:
2.1
 
 public abstract class JsonGeneratorImpl extends GeneratorBase
 {
     /*
     /**********************************************************
     /* Constants
     /**********************************************************
      */

    
This is the default set of escape codes, over 7-bit ASCII range (first 128 character codes), used for single-byte UTF-8 characters.
 
     protected final static int[] sOutputEscapes = CharTypes.get7BitOutputEscapes();
     
     /*
     /**********************************************************
     /* Configuration, basic I/O
     /**********************************************************
      */
 
     final protected IOContext _ioContext;
 
     /*
     /**********************************************************
     /* Configuration, output escaping
     /**********************************************************
      */

    
Currently active set of output escape code definitions (whether and how to escape or not) for 7-bit ASCII range (first 128 character codes). Defined separately to make potentially customizable
 
     protected int[] _outputEscapes = ;

    
Value between 128 (0x80) and 65535 (0xFFFF) that indicates highest Unicode code point that will not need escaping; or 0 to indicate that all characters can be represented without escaping. Typically used to force escaping of some portion of character set; for example to always escape non-ASCII characters (if value was 127).

NOTE: not all sub-classes make use of this setting.

 
     protected int _maximumNonEscapedChar;

    
Definition of custom character escapes to use for generators created by this factory, if any. If null, standard data format specific escapes are used.
 
     protected CharacterEscapes _characterEscapes;
     
     /*
     /**********************************************************
     /* Configuration, other
     /**********************************************************
      */

    
Separator to use, if any, between root-level values.

Since:
2.1
 
 
     /*
     /**********************************************************
     /* Life-cycle
     /**********************************************************
      */
 
     public JsonGeneratorImpl(IOContext ctxtint featuresObjectCodec codec)
     {
         super(featurescodec);
          = ctxt;
         if (isEnabled(.)) {
             setHighestNonEscapedChar(127);
         }
    }
    /*
    /**********************************************************
    /* Overridden configuration methods
    /**********************************************************
     */
    @Override
    public JsonGenerator setHighestNonEscapedChar(int charCode) {
         = (charCode < 0) ? 0 : charCode;
        return this;
    }
    @Override
    public int getHighestEscapedChar() {
        return ;
    }
    @Override
    {
         = esc;
        if (esc == null) { // revert to standard escapes
             = ;
        } else {
             = esc.getEscapeCodesForAscii();
        }
        return this;
    }

    
Method for accessing custom escapes factory uses for com.fasterxml.jackson.core.JsonGenerators it creates.
    @Override
        return ;
    }
    
    @Override
         = sep;
        return this;
    }
    
    /*
    /**********************************************************
    /* Versioned
    /**********************************************************
     */
    @Override
    public Version version() {
        return VersionUtil.versionFor(getClass());
    }
    /*
    /**********************************************************
    /* Partial API
    /**********************************************************
     */
    // // Overrides just to make things final, to possibly help with inlining
    
    @Override
    public final void writeStringField(String fieldNameString value)
        throws IOExceptionJsonGenerationException
    {
        writeFieldName(fieldName);
        writeString(value);
    }
    
New to GrepCode? Check out our FAQ X