Annotation Interface Marshalled
Carries the marshalling-only attributes for a class — bean-modeling attributes (such as
properties, excludeProperties, findFluentSetters, interfaceClass,
stopClass, propertyNamer, unsorted, factory, etc.) live on
@BeanType in
Can be used in the following locations:
- Bean classes and parent interfaces.
- Non-bean marshalled classes.
@Rest -annotated classes and@RestOp -annotated methods when used with@MarshalledApply.
See Also:
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionSpecifies the marshalling strategy for this type.Big-number wire format override forBigInteger/BigDecimalvalues.Binary wire format override forvalues.byte []BitSet wire format override.Boolean wire format override forBoolean/values.boolean Calendar wire format override.Class wire format override forClassvalues.Currency wire format override forCurrencyvalues.Date wire format override.String[]Optional description for the exposed API.Class<?>[]Bean dictionary.Duration wire format override.Enum wire format override.POJO example.Class<?>Implementation class.Class<? extends BeanInterceptor<?>>Bean property interceptor.Locale wire format override.Period wire format override.Short, concise summary of the exposed API.Temporal wire format override.Time-zone wire format override.An identifying name for this class.The property name to use for representing the type name.UUID wire format override.
-
Element Details
-
as
Specifies the marshalling strategy for this type.Defaults to
MarshalledAs.DETECT(auto-detection). UseMarshalledAs.STRINGto serialize viatoString()and deserialize viafromString/valueOf/single-String constructor — equivalent to the formerMarshallingStringSwappattern.- Returns:
- The marshalling strategy.
- Default:
- DETECT
-
description
Optional description for the exposed API.- Returns:
- The annotation value.
- Since:
- 9.2.0
- Default:
- {}
-
summary
Short, concise summary of the exposed API.Intended as a brief, single-line description suitable for AI/LLM consumption, compact documentation, or any context where brevity matters. See
Schema.summary()for the canonical definition; this field is the type-level counterpart.- Returns:
- The annotation value.
- Since:
- 10.0.0
- Default:
- ""
-
dictionary
Class<?>[] dictionaryBean dictionary.The list of classes that make up the bean dictionary for all properties in this class and all subclasses.
See Also:
- Returns:
- The annotation value.
- Default:
- {}
-
calendarFormat
Calendar wire format override.- Returns:
- The annotation value.
- Default:
- NOT_SET
-
dateFormat
Date wire format override.- Returns:
- The annotation value.
- Default:
- NOT_SET
-
durationFormat
Duration wire format override.- Returns:
- The annotation value.
- Default:
- NOT_SET
-
localeFormat
Locale wire format override.- Returns:
- The annotation value.
- Default:
- NOT_SET
-
temporalFormat
Temporal wire format override.- Returns:
- The annotation value.
- Default:
- NOT_SET
-
timeZoneFormat
Time-zone wire format override.- Returns:
- The annotation value.
- Default:
- NOT_SET
-
binaryFormat
Binary wire format override forvalues.byte []- Returns:
- The annotation value.
- Default:
- NOT_SET
-
enumFormat
Enum wire format override.- Returns:
- The annotation value.
- Default:
- NOT_SET
-
uuidFormat
UUID wire format override.- Returns:
- The annotation value.
- Default:
- NOT_SET
-
bitSetFormat
BitSet wire format override.- Returns:
- The annotation value.
- Default:
- NOT_SET
-
bigNumberFormat
Big-number wire format override forBigInteger/BigDecimalvalues.- Returns:
- The annotation value.
- Default:
- NOT_SET
-
booleanFormat
Boolean wire format override forBoolean/values.boolean - Returns:
- The annotation value.
- Default:
- NOT_SET
-
floatFormat
- Returns:
- The annotation value.
- Default:
- NOT_SET
-
currencyFormat
Currency wire format override forCurrencyvalues.- Returns:
- The annotation value.
- Default:
- NOT_SET
-
classFormat
Class wire format override forClassvalues.- Returns:
- The annotation value.
- Default:
- NOT_SET
-
example
POJO example.Specifies an example of the specified class in Simplified JSON format.
Examples are used in cases such as POJO examples in Swagger documents.
Example:
@Marshalled (example="{foo:'bar'}" )public class MyClass {...}Notes:
- Setting applies to specified class and all subclasses.
-
Keys are the class of the example.
Values are JSON 5 representation of that class. -
POJO examples can also be defined on classes via the following:
- A static field annotated with
@Example. - A static method annotated with
@Examplewith zero arguments or oneMarshallingSessionargument. - A static method with name
example with no arguments or oneMarshallingSessionargument.
- A static field annotated with
-
Supports VarResolver.DEFAULT (e.g.
"$C{myConfigVar}" ).
See Also:
- Returns:
- The annotation value.
- Default:
- ""
-
periodFormat
Period wire format override.- Returns:
- The annotation value.
- Default:
- NOT_SET
-
implClass
Implementation class.For interfaces and abstract classes this method can be used to specify an implementation class for the interface/abstract class so that instances of the implementation class are used when instantiated (e.g. during a parse).
Example:
@Marshalled (implClass=MyInterfaceImpl.class )public class MyInterface {...}- Returns:
- The annotation value.
- Default:
- void.class
-
interceptor
Class<? extends BeanInterceptor<?>> interceptorBean property interceptor.Bean interceptors can be used to intercept calls to getters and setters and alter their values in transit.
See Also:
- Returns:
- The annotation value.
- Default:
- org.apache.juneau.commons.bean.BeanInterceptor.Void.class
-
typeName
An identifying name for this class.The name is used to identify the class type during parsing when it cannot be inferred through reflection.
For example, if a bean property is of typeObject , then the serializer will add the name to the output so that the class can be determined during parsing.It is also used to specify element names in XML.
Example:
// Use _type='mybean' to identify this bean. @Marshalled (typeName="mybean" )public class MyBean {...}See Also:
- Returns:
- The annotation value.
- Default:
- ""
-
typePropertyName
The property name to use for representing the type name.This can be used to override the name used for the
"_type" property used by thetypeName()setting.The default value if not specified is
"_type" .Example:
// Use 'type' instead of '_type' for bean names. @Marshalled (typePropertyName="type" )public class MyBean {...}See Also:
- Returns:
- The annotation value.
- Default:
- ""
-