Package org.apache.juneau.uon
Class UonSerializerSession
- All Implemented Interfaces:
- HttpPartSerializerSession
- Direct Known Subclasses:
- OpenApiSerializerSession,- UrlEncodingSerializerSession
public class UonSerializerSession
extends WriterSerializerSession
implements HttpPartSerializerSession
Session object that lives for the duration of a single use of 
UonSerializer.
 Notes:
- This class is not thread safe and is typically discarded after one use.
See Also:
- 
Nested Class SummaryNested Classes
- 
Field SummaryFields inherited from class org.apache.juneau.BeanTraverseSessionindent
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic UonSerializerSession.Buildercreate(UonSerializer ctx) Creates a new builder for this object.protected voiddoSerialize(SerializerPipe out, Object o) Serializes a POJO to the specified pipe.protected final ParamFormatFormat to use for query/form-data/header values.protected final charQuote character.protected final UonWriterConverts the specified output target object to anUonWriter.protected final booleanAdd"_type" properties when needed.protected final booleanEncode non-valid URI characters.serialize(HttpPartType type, HttpPartSchema schema, Object value) Converts the specified value to a string that can be used as an HTTP header value, query parameter value, form-data parameter, or URI path variable.protected SerializerWriterserializeAnything(UonWriter out, Object o, ClassMeta<?> eType, String attrName, BeanPropertyMeta pMeta) Workhorse method.Methods inherited from class org.apache.juneau.serializer.WriterSerializerSessioncreate, createPipe, getFileCharset, getMaxIndent, getStreamCharset, isUseWhitespace, isWriterSerializer, properties, serialize, serializeToStringMethods inherited from class org.apache.juneau.serializer.SerializerSessionaddVarBean, canIgnoreValue, create, createBeanTypeNameProperty, createDefaultVarResolverSession, forEachEntry, forEachEntry, generalize, getBeanTypeName, getExpectedRootType, getJavaMethod, getListener, getListener, getResponseHeaders, getSchema, getUriContext, getUriRelativity, getUriResolution, getUriResolver, getVarResolver, handleThrown, isAddRootType, isKeepNullProperties, isSortCollections, isSortMaps, isTrimEmptyCollections, isTrimEmptyMaps, isTrimStrings, onBeanGetterException, onError, push2, relativizeUri, resolve, resolveUri, serialize, sort, sort, sort, swap, toList, toString, trimMethods inherited from class org.apache.juneau.BeanTraverseSessiongetInitialDepth, getLastLocation, getMaxDepth, getOptionalType, getOptionalValue, getStack, isDetectRecursions, isIgnoreRecursions, isOptional, isRoot, pop, push, setCurrentClass, setCurrentProperty, willExceedDepth, willRecurseMethods inherited from class org.apache.juneau.BeanSession_class, addWarning, convertToMemberType, convertToMemberType, convertToType, convertToType, convertToType, create, getArgsClassMeta, getBeanClassVisibility, getBeanConstructorVisibility, getBeanDictionary, getBeanFieldVisibility, getBeanMeta, getBeanMethodVisibility, getBeanRegistry, getBeanTypePropertyName, getBeanTypePropertyName, getClassMeta, getClassMeta, getClassMetaForObject, getClassMetaForObject, getLocale, getMediaType, getNamePropertyName, getNotBeanClasses, getNotBeanPackagesNames, getNotBeanPackagesPrefixes, getPropertyNamer, getSwaps, getTimeZone, getTimeZoneId, isBean, isBean, isBeanMapPutReturnsOldValue, isBeansRequireDefaultConstructor, isBeansRequireSerializable, isBeansRequireSettersForGetters, isBeansRequireSomeProperties, isFindFluentSetters, isIgnoreInvocationExceptionsOnGetters, isIgnoreInvocationExceptionsOnSetters, isIgnoreMissingSetters, isIgnoreUnknownBeanProperties, isIgnoreUnknownNullBeanProperties, isSortProperties, isUseEnumNames, isUseInterfaceProxies, isUseJavaBeanIntrospector, newBean, newBean, newBeanMap, newBeanMap, newGenericMap, object, string, toArray, toBeanMap, toBeanMap, toBeanMapMethods inherited from class org.apache.juneau.ContextSessioncheckForWarnings, getContext, getSessionProperties, getWarnings, isDebug, toString
- 
Constructor Details- 
UonSerializerSessionConstructor.- Parameters:
- builder- The builder for this object.
 
 
- 
- 
Method Details- 
createCreates a new builder for this object.- Parameters:
- ctx- The context creating this session.
- Returns:
- A new builder.
 
- 
getUonWriterConverts the specified output target object to anUonWriter.- Parameters:
- out- The output target object.
- Returns:
- The output target object wrapped in an UonWriter.
- Throws:
- IOException- Thrown by underlying stream.
 
- 
doSerializeDescription copied from class:SerializerSessionSerializes a POJO to the specified pipe.This method should NOT close the context object. The default implementation of this method simply calls Serializer.doSerialize(SerializerSession,SerializerPipe,Object).- Overrides:
- doSerializein class- SerializerSession
- Parameters:
- out- Where to send the output from the serializer.
- o- The object to serialize.
- Throws:
- IOException- Thrown by underlying stream.
- SerializeException- Problem occurred trying to serialize object.
 
- 
serializeAnythingprotected SerializerWriter serializeAnything(UonWriter out, Object o, ClassMeta<?> eType, String attrName, BeanPropertyMeta pMeta) throws SerializeException Workhorse method.Determines the type of object, and then calls the appropriate type-specific serialization method. - Parameters:
- out- The writer to serialize to.
- o- The object being serialized.
- eType- The expected type of the object if this is a bean property.
- attrName- The bean property name if this is a bean property.- null if this isn't a bean property being serialized.
- pMeta- The bean property metadata.
- Returns:
- The same writer passed in.
- Throws:
- SerializeException- Generic serialization error occurred.
 
- 
serializepublic String serialize(HttpPartType type, HttpPartSchema schema, Object value) throws SerializeException, SchemaValidationException Description copied from interface:HttpPartSerializerSessionConverts the specified value to a string that can be used as an HTTP header value, query parameter value, form-data parameter, or URI path variable.Returned values should NOT be URL-encoded. - Specified by:
- serializein interface- HttpPartSerializerSession
- Parameters:
- type- The category of value being serialized.
- schema- Schema information about the part.
 May be- null .
 Not all part serializers use the schema information.
- value- The value being serialized.
- Returns:
- The serialized value.
- Throws:
- SerializeException- If a problem occurred while trying to parse the input.
- SchemaValidationException- If the output fails schema validation.
 
- 
isAddBeanTypesAdd"_type" properties when needed.- Overrides:
- isAddBeanTypesin class- SerializerSession
- Returns:
- true if- "_type" properties will be added to beans if their type cannot be inferred through reflection.
- See Also:
 
- 
isEncodingEncode non-valid URI characters.- Returns:
- true if non-valid URI characters should be encoded with- "%xx" constructs.
- See Also:
 
- 
getParamFormatFormat to use for query/form-data/header values.- Returns:
- Specifies the format to use for URL GET parameter keys and values.
- See Also:
 
- 
getQuoteCharQuote character.- Overrides:
- getQuoteCharin class- WriterSerializerSession
- Returns:
- The character used for quoting attributes and values.
- See Also:
 
 
-