Package org.apache.juneau.json
Class Json5Serializer
- All Implemented Interfaces:
AnnotationProvider
,JsonMetaProvider
- Direct Known Subclasses:
Json5Serializer.Readable
Serializes POJO models to Simplified JSON.
Accept types: application/json, text/json
Media types
Handles
Produces
Description
This is a JSON serializer that uses simplified notation:
- Lax quoting of JSON attribute names.
- Single quotes.
Notes:
- This class is thread safe and reusable.
See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Default serializer, single quotes, simple mode, with whitespace.Nested classes/interfaces inherited from class org.apache.juneau.json.JsonSerializer
JsonSerializer.Builder, JsonSerializer.ReadableSafe
Nested classes/interfaces inherited from class org.apache.juneau.serializer.Serializer
Serializer.Null
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Json5Serializer
Default serializer, single quotes,simple mode
.static final Json5Serializer
Default serializer, single quotes, simple mode, with whitespace.Fields inherited from class org.apache.juneau.Context
CONTEXT_APPLY_FILTER
Fields inherited from interface org.apache.juneau.AnnotationProvider
DISABLE_ANNOTATION_CACHING
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncopy()
Creates a builder from this context object.static JsonSerializer.Builder
create()
Creates a new builder for this object.Methods inherited from class org.apache.juneau.json.JsonSerializer
createSession, getJsonBeanPropertyMeta, getJsonClassMeta, getSchemaSerializer, getSession, isAddBeanTypes, isEscapeSolidus, isSimpleAttrs, properties
Methods inherited from class org.apache.juneau.serializer.WriterSerializer
getFileCharset, getMaxIndent, getQuoteChar, getStreamCharset, isUseWhitespace, isWriterSerializer, println, quoteChar, serialize, toString
Methods inherited from class org.apache.juneau.serializer.Serializer
createSerializerBuilder, doSerialize, forEachAcceptMediaType, getListener, getMediaTypeRanges, getPrimaryMediaType, getResponseContentType, getResponseHeaders, getUriContext, getUriRelativity, getUriResolution, isAddRootType, isKeepNullProperties, isSortCollections, isSortMaps, isTrimEmptyCollections, isTrimEmptyMaps, isTrimStrings, serialize, serializeToString
Methods inherited from class org.apache.juneau.BeanTraverseContext
getInitialDepth, getMaxDepth, isDetectRecursions, isIgnoreRecursions
Methods inherited from class org.apache.juneau.BeanContextable
getBeanContext
Methods inherited from class org.apache.juneau.Context
createBuilder, firstAnnotation, firstAnnotation, firstAnnotation, firstAnnotation, firstDeclaredAnnotation, forEachAnnotation, forEachAnnotation, forEachAnnotation, forEachAnnotation, forEachDeclaredAnnotation, hasAnnotation, hasAnnotation, hasAnnotation, hasAnnotation, init, isDebug, lastAnnotation, lastAnnotation, lastAnnotation, lastAnnotation, lastDeclaredAnnotation, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.juneau.AnnotationProvider
firstAnnotation, firstAnnotation, firstAnnotation, firstAnnotation, firstDeclaredAnnotation, forEachAnnotation, forEachAnnotation, forEachAnnotation, forEachAnnotation, forEachDeclaredAnnotation, lastAnnotation, lastAnnotation, lastAnnotation, lastAnnotation, lastDeclaredAnnotation
-
Field Details
-
DEFAULT
Default serializer, single quotes,simple mode
. -
DEFAULT_READABLE
Default serializer, single quotes, simple mode, with whitespace.
-
-
Constructor Details
-
Json5Serializer
Constructor.- Parameters:
builder
- The builder for this object.
-
-
Method Details
-
create
Creates a new builder for this object.- Returns:
- A new builder.
-
copy
Description copied from class:Context
Creates a builder from this context object.Builders are used to define new contexts (e.g. serializers, parsers) based on existing configurations.
- Overrides:
copy
in classJsonSerializer
- Returns:
- A new Builder object.
-