/** * Method that allows overriding String used for separating root-level * JSON values (default is single space character) * * @param sep Separator to use, if any; null means that no separator is * automatically added * * @since 2.1 */ public JsonFactory setRootValueSeparator(String sep) { _rootValueSeparator = (sep == null) ? null : new SerializedString(sep); return this; }
/** * Constructor that specifies separator String to use between root values; * if null, no separator is printed. *<p> * Note: simply constructs a {@link SerializedString} out of parameter, * calls {@link #DefaultPrettyPrinter(SerializableString)} * * @param rootSeparator * * @since 2.1 */ public DefaultPrettyPrinter(String rootSeparator) { this((rootSeparator == null) ? null : new SerializedString(rootSeparator)); }
protected Object readResolve() { return new SerializedString(_jdkSerializeValue); }
public FSTJsonFieldNames(final String TYPE, final String OBJ, final String SEQ_TYPE, final String SEQ, final String ENUM, final String VAL, final String REF) { this.TYPE = TYPE; this.OBJ = OBJ; this.SEQ_TYPE = SEQ_TYPE; this.SEQ = SEQ; this.ENUM = ENUM; this.VAL = VAL; this.REF = REF; this.TYPE_S = new SerializedString(TYPE); this.OBJ_S = new SerializedString(OBJ); this.SEQ_TYPE_S = new SerializedString(SEQ_TYPE); this.SEQ_S = new SerializedString(SEQ); this.ENUM_S = new SerializedString(ENUM); this.VAL_S = new SerializedString(VAL); this.REF_S = new SerializedString(REF); }
/** * Method for constructing a specialized textual object that can typically * be serialized faster than basic {@link java.lang.String} (depending * on escaping needed if any, char-to-byte encoding if needed). * * @param src Text to represent * * @return Optimized text object constructed * * @since 2.4 */ public SerializableString compileString(String src) { /* 20-Jan-2014, tatu: For now we will just construct it directly, but * for 2.4 need to allow overriding to support non-standard extensions * to be used by extensions like Afterburner. */ return new SerializedString(src); }
/** * Constructor that specifies separator String to use between root values; * if null, no separator is printed. *<p> * Note: simply constructs a {@link SerializedString} out of parameter, * calls {@link #DefaultPrettyPrinter(SerializableString)} * * @param rootSeparator */ public DefaultPrettyPrinter(String rootSeparator) { this((rootSeparator == null) ? null : new SerializedString(rootSeparator)); }
/** * Method that allows overriding String used for separating root-level * JSON values (default is single space character) * * @param sep Separator to use, if any; null means that no separator is * automatically added */ public JsonFactoryBuilder rootValueSeparator(String sep) { _rootValueSeparator = (sep == null) ? null : new SerializedString(sep); return this; }
protected Object readResolve() { return new SerializedString(_jdkSerializeValue); }
public ObjectFieldJsonExtractor(String fieldName, JsonExtractor<? extends T> delegate, boolean exceptionOnOutOfBounds) { this.fieldName = new SerializedString(requireNonNull(fieldName, "fieldName is null")); this.delegate = requireNonNull(delegate, "delegate is null"); this.exceptionOnOutOfBounds = exceptionOnOutOfBounds; this.index = tryParseInt(fieldName, -1); }
/** * @since 2.6.0 */ public DefaultPrettyPrinter withRootSeparator(String rootSeparator) { return withRootSeparator((rootSeparator == null) ? null : new SerializedString(rootSeparator)); }
public GeneratorSettings withRootValueSeparator(String sep) { if (sep == null) { if (rootValueSeparator == null) { return this; } return new GeneratorSettings(prettyPrinter, schema, characterEscapes, null); } if (sep.equals(_rootValueSeparatorAsString())) { return this; } return new GeneratorSettings(prettyPrinter, schema, characterEscapes, new SerializedString(sep)); }
public ObjectLinesWriter(final OutputStream outputStream, final ObjectMapper jsonMapper) throws IOException { this.outputStream = outputStream; this.jsonGenerator = jsonMapper.writer().getFactory().createGenerator(outputStream); jsonGenerator.setRootValueSeparator(new SerializedString("\n")); }
/** * Accessor that may be used to get lazily-constructed efficient * representation of the simple name. * * @since 2.4 */ public SerializableString simpleAsEncoded(MapperConfig<?> config) { SerializableString sstr = _encodedSimple; if (sstr == null) { if (config == null) { sstr = new SerializedString(_simpleName); } else { sstr = config.compileString(_simpleName); } _encodedSimple = sstr; } return sstr; }
public ArrayLinesWriter(final OutputStream outputStream, final ObjectMapper jsonMapper) throws IOException { this.outputStream = outputStream; this.jsonGenerator = jsonMapper.writer().getFactory().createGenerator(outputStream); jsonGenerator.setRootValueSeparator(new SerializedString("\n")); }
public DefaultPrettyPrinter withRootSeparator(String rootSeparator) { return withRootSeparator((rootSeparator == null) ? null : new SerializedString(rootSeparator)); }
_name = new SerializedString(name.getSimpleName()); _wrapperName = base._wrapperName;
/** * Factory method called by {@link com.fasterxml.jackson.databind.ser.std.BeanSerializerBase} * with the initial information based on standard settings for the type * for which serializer is being built. * * @since 2.3 */ public static ObjectIdWriter construct(JavaType idType, PropertyName propName, ObjectIdGenerator<?> generator, boolean alwaysAsId) { String simpleName = (propName == null) ? null : propName.getSimpleName(); SerializableString serName = (simpleName == null) ? null : new SerializedString(simpleName); return new ObjectIdWriter(idType, serName, generator, null, alwaysAsId); }
private void writeSymbolicClazz(FSTClazzInfo clzInfo, Class<?> clz) { try { if ( clzInfo != null ) { SerializedString buffered = (SerializedString) clzInfo.getDecoderAttached(); if ( buffered == null ) { buffered = new SerializedString(classToString(clz)); clzInfo.setDecoderAttached(buffered); } gen.writeString(buffered); } else { gen.writeString(classToString(clz)); } } catch (IOException e) { FSTUtil.<RuntimeException>rethrow(e); } }
@Override public UnwrappingBeanPropertyWriter rename(NameTransformer transformer) { String oldName = _name.getValue(); String newName = transformer.transform(oldName); // important: combine transformers: transformer = NameTransformer.chainedTransformer(transformer, _nameTransformer); return _new(transformer, new SerializedString(newName)); }
SerializedString bufferedName = (SerializedString) subInfo.getBufferedName(); if ( bufferedName == null ) { bufferedName = new SerializedString(subInfo.getName()); subInfo.setBufferedName(bufferedName);