Package org.apache.juneau.serializer
Class WriterSerializer
java.lang.Object
org.apache.juneau.Context
org.apache.juneau.BeanContextable
org.apache.juneau.BeanTraverseContext
org.apache.juneau.serializer.Serializer
org.apache.juneau.serializer.WriterSerializer
- All Implemented Interfaces:
- AnnotationProvider
- Direct Known Subclasses:
- CsvSerializer,- JsonSerializer,- PlainTextSerializer,- UonSerializer,- XmlSerializer
Subclass of 
Serializer for character-based serializers.
 Notes:
- This class is thread safe and reusable.
See Also:
- 
Nested Class SummaryNested ClassesNested classes/interfaces inherited from class org.apache.juneau.serializer.SerializerSerializer.Null
- 
Field SummaryFields inherited from class org.apache.juneau.ContextCONTEXT_APPLY_FILTERFields inherited from interface org.apache.juneau.AnnotationProviderDEFAULT, DISABLE_ANNOTATION_CACHING
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedWriterSerializer(WriterSerializer.Builder builder) Constructor.
- 
Method SummaryModifier and TypeMethodDescriptioncopy()Creates a builder from this context object.static WriterSerializer.Buildercreate()Creates a new builder for this object.Create a session builder based on the properties defined on this context.protected final CharsetFile charset.protected final intMaximum indentation.protected charQuote character.Returns a session to use for this context.protected final CharsetOutput stream charset.protected final booleanTrim strings.final booleanReturnstrue if this serializer subclasses fromWriterSerializer.final WriterSerializerConvenience method for serializing an object and sending it to STDOUT.protected JsonMapReturns the properties on this bean as a map for debugging.protected CharacterQuote character.final StringConvenience method for serializing an object to aString .final StringMethods inherited from class org.apache.juneau.serializer.SerializercreateSerializerBuilder, doSerialize, forEachAcceptMediaType, getListener, getMediaTypeRanges, getPrimaryMediaType, getResponseContentType, getResponseHeaders, getUriContext, getUriRelativity, getUriResolution, isAddBeanTypes, isAddRootType, isKeepNullProperties, isSortCollections, isSortMaps, isTrimEmptyCollections, isTrimEmptyMaps, isTrimStrings, serialize, serializeToStringMethods inherited from class org.apache.juneau.BeanTraverseContextgetInitialDepth, getMaxDepth, isDetectRecursions, isIgnoreRecursionsMethods inherited from class org.apache.juneau.BeanContextablegetBeanContextMethods inherited from class org.apache.juneau.ContextcreateBuilder, firstAnnotation, firstAnnotation, firstAnnotation, firstAnnotation, firstDeclaredAnnotation, forEachAnnotation, forEachAnnotation, forEachAnnotation, forEachAnnotation, forEachDeclaredAnnotation, hasAnnotation, hasAnnotation, hasAnnotation, hasAnnotation, init, isDebug, lastAnnotation, lastAnnotation, lastAnnotation, lastAnnotation, lastDeclaredAnnotation, toString
- 
Constructor Details- 
WriterSerializerConstructor.- Parameters:
- builder- The builder for this object.
 
 
- 
- 
Method Details- 
createCreates a new builder for this object.- Returns:
- A new builder.
 
- 
copyDescription copied from class:ContextCreates a builder from this context object.Builders are used to define new contexts (e.g. serializers, parsers) based on existing configurations. - Overrides:
- copyin class- Serializer
- Returns:
- A new Builder object.
 
- 
createSessionDescription copied from class:ContextCreate a session builder based on the properties defined on this context.Use this method for creating sessions where you want to override basic settings. Otherwise, use Context.getSession()directly.- Overrides:
- createSessionin class- Serializer
- Returns:
- A new session builder.
 
- 
getSessionDescription copied from class:ContextReturns a session to use for this context.Note that subclasses may opt to return a reusable non-modifiable session. - Overrides:
- getSessionin class- Serializer
- Returns:
- A new session object.
 
- 
isWriterSerializerDescription copied from class:SerializerReturnstrue if this serializer subclasses fromWriterSerializer.- Overrides:
- isWriterSerializerin class- Serializer
- Returns:
- true if this serializer subclasses from- WriterSerializer.
 
- 
serializeConvenience method for serializing an object to aString .- Overrides:
- serializein class- Serializer
- Parameters:
- o- The object to serialize.
- Returns:
- The output serialized to a string.
- Throws:
- SerializeException- If a problem occurred trying to convert the output.
 
- 
toStringIdentical toserialize(Object)except throws aRuntimeExceptioninstead of aSerializeException.This is typically good enough for debugging purposes. - Parameters:
- o- The object to serialize.
- Returns:
- The serialized object.
 
- 
printlnConvenience method for serializing an object and sending it to STDOUT.- Parameters:
- o- The object to serialize.
- Returns:
- This object.
 
- 
getFileCharsetFile charset.- Returns:
- The character set to use when writing to Files on the file system.
- See Also:
 
- 
getMaxIndentMaximum indentation.- Returns:
- The maximum indentation level in the serialized document.
- See Also:
 
- 
getQuoteCharQuote character.- Returns:
- The character used for quoting attributes and values.
- See Also:
 
- 
quoteCharQuote character.- Returns:
- The character used for quoting attributes and values.
- See Also:
 
- 
getStreamCharsetOutput stream charset.- Returns:
- The character set to use when writing to OutputStreams and byte arrays.
- See Also:
 
- 
isUseWhitespaceTrim strings.- Returns:
- When enabled, whitespace is added to the output to improve readability.
- See Also:
 
- 
propertiesDescription copied from class:ContextReturns the properties on this bean as a map for debugging.- Overrides:
- propertiesin class- Serializer
- Returns:
- The properties on this bean as a map for debugging.
 
 
-