Class WriterSerializerSession
java.lang.Object
org.apache.juneau.marshall.ContextSession
org.apache.juneau.marshall.MarshallingSession
org.apache.juneau.marshall.MarshallingTraverseSession
org.apache.juneau.marshall.serializer.SerializerSession
org.apache.juneau.marshall.serializer.WriterSerializerSession
- All Implemented Interfaces:
BeanSession,ConverterSession
- Direct Known Subclasses:
CsvSerializerSession,HjsonSerializerSession,HoconSerializerSession,IniSerializerSession,JsonSerializerSession,MarkdownSerializerSession,PlainTextSerializerSession,RdfSerializerSession,SseSerializerSession,TomlSerializerSession,UonSerializerSession,XmlSerializerSession,YamlSerializerSession
Subclass of
It has 1 abstract method to implement...
SerializerSession for character-based serializers.
Description
This class is typically the parent class of all character-based serializers.It has 1 abstract method to implement...
Notes:
- This class is not thread safe and is typically discarded after one use.
See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder class.static final classConcrete default builder leaf for the non-subclassedcreate()path (CRTP terminal). -
Field Summary
Fields inherited from class org.apache.juneau.marshall.MarshallingTraverseSession
indentFields inherited from class org.apache.juneau.marshall.MarshallingSession
NAME_PROPERTY_NAME -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic WriterSerializerSession.Builder<?>create(WriterSerializer ctx) Creates a new builder for this object.protected SerializerPipecreatePipe(Object output) Wraps the specified output object into aSerializerPipeobject so that it can be easily converted into a stream or writer.protected final intMaximum indentation.protected charQuote character.Returns the stream charset defined on this session.protected final booleanUse whitespace.final booleanReturnstrue if this serializer subclasses fromWriterSerializer.Returns the properties on this bean as a map for debugging.final StringConvenience method for serializing an object to aString .final StringShortcut method for serializing an object to a String.Methods inherited from class org.apache.juneau.marshall.serializer.SerializerSession
addVarBean, canIgnoreValue, canIgnoreValue, create, createBeanTypeNameProperty, createDefaultVarResolverSession, doWrite, forEachEntry, forEachEntry, forEachStreamableEntry, generalize, getBeanTypeName, getCalendarFormat, getDateFormat, getDurationFormat, getExpectedRootType, getJavaMethod, getListener, getListener, getLocaleFormat, getPeriodFormat, getResponseHeaders, getSchema, getTemporalFormat, getTimeZoneFormat, getUriContext, getUriRelativity, getUriResolution, getUriResolver, getVarResolver, handleThrown, isAddBeanTypes, isAddRootType, isKeepNullProperties, isNonDefault, isSortCollections, isSortMaps, isTrimEmptyCollections, isTrimEmptyMaps, isTrimStrings, onBeanGetterException, onError, push2, relativizeUri, resolve, resolveUri, sort, sort, sort, swap, toList, toListFromStreamable, toString, trim, unwrapSupplier, write, writeCalendar, writeDate, writeDuration, writePeriod, writeTemporalMethods inherited from class org.apache.juneau.marshall.MarshallingTraverseSession
getInitialDepth, getLastLocation, getMaxDepth, getOptionalType, getOptionalValue, getStack, isDetectRecursions, isIgnoreRecursions, isOptional, isRoot, pop, push, setCurrentClass, setCurrentProperty, willExceedDepth, willRecurseMethods inherited from class org.apache.juneau.marshall.MarshallingSession
addWarning, convertToMemberType, convertToMemberType, convertToMemberType, convertToType, convertToType, convertToType, convertToType, create, get, getActiveView, getAnnotationProvider, getArgsClassMeta, getBeanClassVisibility, getBeanConstructorVisibility, getBeanDictionary, getBeanFieldVisibility, getBeanMeta, getBeanMethodVisibility, getBeanRegistry, getBeanTypePropertyName, getBeanTypePropertyName, getClassLoader, getClassMeta, getClassMeta, getClassMetaForObject, getClassMetaForObject, getLocale, getMarshallingContext, getMediaType, getNotBeanClasses, getNotBeanPackagesNames, getPropertyNamer, getSwaps, getTimeZone, getTimeZoneId, isBean, isBean, isBeanMapPutReturnsOldValue, isBeansRequireDefaultConstructor, isBeansRequireSerializable, isBeansRequireSettersForGetters, isBeansRequireSomeProperties, isFindFluentSetters, isIgnoreInvocationExceptionsOnGetters, isIgnoreInvocationExceptionsOnSetters, isIgnoreMissingSetters, isIgnoreUnknownBeanProperties, isIgnoreUnknownNullBeanProperties, isPropertyInActiveView, isRecordComponentOrder, isUnsortedProperties, isUseInterfaceProxies, isUseJavaBeanIntrospector, isValidateSchema, newBean, newBean, newBeanMap, newBeanMap, newGenericList, newGenericMap, newGenericMap, object, parseToList, parseToMap, string, toArray, toBeanMap, toBeanMap, toBeanMapMethods inherited from class org.apache.juneau.marshall.ContextSession
checkForWarnings, getContext, getSessionProperties, getWarnings, isDebug, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.juneau.commons.conversion.ConverterSession
get
-
Constructor Details
-
WriterSerializerSession
Constructor.- Parameters:
builder- The builder for this object.
Cannot benull .
-
-
Method Details
-
create
Creates a new builder for this object.- Parameters:
ctx- The context creating this session.
Cannot benull .- Returns:
- A new builder.
-
getStreamCharset
Returns the stream charset defined on this session.- Returns:
- the stream charset defined on this session.
-
isWriterSerializer
Description copied from class:SerializerSessionReturnstrue if this serializer subclasses fromWriterSerializer.- Overrides:
isWriterSerializerin classSerializerSession- Returns:
true if this serializer subclasses fromWriterSerializer.
-
write
Convenience method for serializing an object to aString .- Overrides:
writein classSerializerSession- Parameters:
o- The object to serialize.- Returns:
- The output serialized to a string.
- Throws:
SerializeException- If a problem occurred trying to convert the output.
-
writeToString
Description copied from class:SerializerSessionShortcut method for serializing an object to a String.- Overrides:
writeToStringin classSerializerSession- Parameters:
o- The object to serialize.- Returns:
- The serialized object.
Character-based serializers will return aString
Stream-based serializers will return aconverted to a string based on thebyte []MarshallingContextable.Builder.binaryFormat(BinaryFormat)setting. - Throws:
SerializeException- If a problem occurred trying to convert the output.
-
createPipe
Description copied from class:SerializerSessionWraps the specified output object into aSerializerPipeobject so that it can be easily converted into a stream or writer.- Overrides:
createPipein classSerializerSession- Parameters:
output- The output location.
For character-based serializers, this can be any of the following types:WriterOutputStream- Output will be written as UTF-8 encoded stream.
For byte-based serializers, this must be anOutputStream.- Returns:
- A new
SerializerPipewrapper around the specified output object.
-
getMaxIndent
Maximum indentation.- Returns:
- The maximum indentation level in the serialized document.
- See Also:
-
getQuoteChar
Quote character.- Returns:
- The character used for quoting attributes and values.
- See Also:
-
isUseWhitespace
Use whitespace.- Returns:
true if whitespace is added to the output to improve readability.- See Also:
-
properties
Description copied from class:ContextSessionReturns the properties on this bean as a map for debugging.- Overrides:
propertiesin classSerializerSession- Returns:
- The properties on this bean as a map for debugging.
-