Package org.apache.juneau.oapi
Class OpenApiSerializerSession
- All Implemented Interfaces:
HttpPartSerializerSession
Session object that lives for the duration of a single use of
OpenApiSerializer
.
Notes:
- This class is not thread safe and is typically discarded after one use.
See Also:
-
Nested Class Summary
-
Field Summary
Fields inherited from class org.apache.juneau.BeanTraverseSession
indent
-
Constructor Summary
ModifierConstructorDescriptionprotected
Constructor. -
Method Summary
Modifier and TypeMethodDescriptioncreate
(OpenApiSerializer ctx) Creates a new builder for this object.protected void
doSerialize
(SerializerPipe out, Object o) Serializes a POJO to the specified pipe.serialize
(HttpPartType partType, 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.Methods inherited from class org.apache.juneau.uon.UonSerializerSession
create, getParamFormat, getQuoteChar, getUonWriter, isAddBeanTypes, isEncoding, serializeAnything
Methods inherited from class org.apache.juneau.serializer.WriterSerializerSession
create, createPipe, getFileCharset, getMaxIndent, getStreamCharset, isUseWhitespace, isWriterSerializer, properties, serialize, serializeToString
Methods inherited from class org.apache.juneau.serializer.SerializerSession
addVarBean, 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, trim
Methods inherited from class org.apache.juneau.BeanTraverseSession
getInitialDepth, getLastLocation, getMaxDepth, getOptionalType, getOptionalValue, getStack, isDetectRecursions, isIgnoreRecursions, isOptional, isRoot, pop, push, setCurrentClass, setCurrentProperty, willExceedDepth, willRecurse
Methods 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, toBeanMap
Methods inherited from class org.apache.juneau.ContextSession
checkForWarnings, getContext, getSessionProperties, getWarnings, isDebug, toString
-
Constructor Details
-
OpenApiSerializerSession
Constructor.- Parameters:
builder
- The builder for this object.
-
-
Method Details
-
create
Creates a new builder for this object.- Parameters:
ctx
- The context creating this session.- Returns:
- A new builder.
-
doSerialize
Description copied from class:SerializerSession
Serializes 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:
doSerialize
in classUonSerializerSession
- 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.
-
serialize
public String serialize(HttpPartType partType, HttpPartSchema schema, Object value) throws SerializeException, SchemaValidationException Description copied from interface:HttpPartSerializerSession
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.Returned values should NOT be URL-encoded.
- Specified by:
serialize
in interfaceHttpPartSerializerSession
- Overrides:
serialize
in classUonSerializerSession
- Parameters:
partType
- The category of value being serialized.schema
- Schema information about the part.
May benull .
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.
-