Transforms
By default, the Juneau framework can serialize and parse a wide variety of POJOs out-of-the-box.
However, two special classes are provided tailor how certain Java objects are handled by the framework.
These classes are:
- {@link oaj.transform.BeanFilter} - Transforms that alter the way beans are handled.
- {@link oaj.transform.PojoSwap} - Transforms that swap non-serializable POJOs with
serializable POJOs during serialization (and optionally vis-versa during parsing).
- {@link oaj.transform.StringSwap} - Convenience subclass for swaps that convert
objects to strings.
- {@link oaj.transform.MapSwap} - Convenience subclass for swaps that convert
objects to maps.
Transforms are added to serializers and parsers (and REST clients) using the following configuration properties:
- {@link oaj.BeanContext}
- {@link oaj.BeanContext#BEAN_beanFilters BEAN_beanFilters}
- {@link oaj.BeanContext#BEAN_swaps BEAN_swaps}
Annotations are also provided for specifying transforms directly on classes and methods (all described in later sections):
-
{@link oaj.annotation.Swap}
- Used to tailor how non-bean POJOs get interpreted by the framework.
-
{@link oaj.annotation.Bean}
- Used to tailor how beans get interpreted by the framework.
-
{@link oaj.annotation.Beanc}
- Maps constructor arguments to property names on beans with read-only properties.
-
{@link oaj.annotation.Beanp}
- Used to tailor how bean properties get interpreted by the framework.
-
{@link oaj.annotation.BeanIgnore}
- Ignore classes, fields, and methods from being interpreted as bean or bean components.
-
{@link oaj.annotation.NameProperty}
- Identifies a setter as a method for setting the name of a POJO as it's known by its parent object.
-
{@link oaj.annotation.ParentProperty}
- Identifies a setter as a method for adding a parent reference to a child object.
-
{@link oaj.annotation.URI}
- Used to identify a class or bean property as a URI.