blob: 0118c630370ba297bfdf795acf6a6bdcd8bd0b3f [file] [log] [blame]
<!--
/***************************************************************************************************************************
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
***************************************************************************************************************************/
-->
Transforms
<p>
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:
</p>
<ul class='javatree'>
<li class='jc'>{@link oaj.transform.BeanFilter} - Transforms that alter the way beans are handled.
<li class='jac'>{@link oaj.transform.PojoSwap} - Transforms that swap non-serializable POJOs with
serializable POJOs during serialization (and optionally vis-versa during parsing).
<ul>
<li class='jc'>{@link oaj.transform.StringSwap} - Convenience subclass for swaps that convert
objects to strings.
<li class='jc'>{@link oaj.transform.MapSwap} - Convenience subclass for swaps that convert
objects to maps.
</ul>
</li>
</ul>
<p>
Transforms are added to serializers and parsers (and REST clients) using the following configuration properties:
</p>
<ul class='javatree'>
<li class='jc'>{@link oaj.BeanContext}
<ul>
<li class='jf'>{@link oaj.BeanContext#BEAN_beanFilters BEAN_beanFilters}
<li class='jf'>{@link oaj.BeanContext#BEAN_pojoSwaps BEAN_pojoSwaps}
</ul>
</ul>
<p>
Annotations are also provided for specifying transforms directly on classes and methods (all described in later sections):
</p>
<ul class='javatree'>
<li class='ja'>
{@link oaj.annotation.Swap}
- Used to tailor how non-bean POJOs get interpreted by the framework.
<li class='ja'>
{@link oaj.annotation.Bean}
- Used to tailor how beans get interpreted by the framework.
<li class='ja'>
{@link oaj.annotation.Beanc}
- Maps constructor arguments to property names on beans with read-only properties.
<li class='ja'>
{@link oaj.annotation.Beanp}
- Used to tailor how bean properties get interpreted by the framework.
<li class='ja'>
{@link oaj.annotation.BeanIgnore}
- Ignore classes, fields, and methods from being interpreted as bean or bean components.
<li class='ja'>
{@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.
<li class='ja'>
{@link oaj.annotation.ParentProperty}
- Identifies a setter as a method for adding a parent reference to a child object.
<li class='ja'>
{@link oaj.annotation.URI}
- Used to identify a class or bean property as a URI.
</ul>