Annotation Interface Marshalled


Annotation that can be applied to classes to control how they are 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 juneau-commons.

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:
  • Element Details

    • as

      Specifies the marshalling strategy for this type.

      Defaults to MarshalledAs.DETECT (auto-detection). Use MarshalledAs.STRING to serialize via toString() and deserialize via fromString/valueOf/single-String constructor — equivalent to the former MarshallingStringSwap pattern.

      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

      Bean 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 for byte[] values.
      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 for BigInteger / BigDecimal values.
      Returns:
      The annotation value.
      Default:
      NOT_SET
    • booleanFormat

      Boolean wire format override for Boolean / boolean values.
      Returns:
      The annotation value.
      Default:
      NOT_SET
    • floatFormat

      Float / Double non-finite wire format override for Float / Double values.
      Returns:
      The annotation value.
      Default:
      NOT_SET
    • currencyFormat

      Currency wire format override for Currency values.
      Returns:
      The annotation value.
      Default:
      NOT_SET
    • classFormat

      Class wire format override for Class values.
      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:
      • 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

      Bean 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 type Object, 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 the typeName() 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:
      ""