You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@juneau.apache.org by ja...@apache.org on 2018/01/13 22:12:00 UTC
[1/4] juneau git commit: Update javadocs.
Repository: juneau
Updated Branches:
refs/heads/master 56e22ce38 -> 0ab0b2310
http://git-wip-us.apache.org/repos/asf/juneau/blob/0ab0b231/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContext.java
----------------------------------------------------------------------
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContext.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContext.java
index 121b7e1..b56e816 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContext.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContext.java
@@ -65,7 +65,7 @@ public final class RestContext extends BeanContext {
/**
* Configuration property: Allow body URL parameter.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"RestContext.allowBodyParam.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -81,7 +81,7 @@ public final class RestContext extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* When enabled, the HTTP body content on PUT and POST requests can be passed in as text using the <js>"body"</js>
* URL parameter.
@@ -92,14 +92,14 @@ public final class RestContext extends BeanContext {
* <ul class='spaced-list'>
* <li>Parameter name is case-insensitive.
* <li>Useful for debugging PUT and POST methods using only a browser.
- * </ul>
+ * </ul>
*/
public static final String REST_allowBodyParam = PREFIX + "allowBodyParam.b";
/**
* Configuration property: Allowed method parameters.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"RestContext.allowedMethodParams.s"</js>
* <li><b>Data type:</b> <code>String</code>
@@ -115,7 +115,7 @@ public final class RestContext extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* When specified, the HTTP method can be overridden by passing in a <js>"method"</js> URL parameter on a regular
* GET request.
@@ -127,7 +127,7 @@ public final class RestContext extends BeanContext {
* <li>Format is a comma-delimited list of HTTP method names that can be passed in as a method parameter.
* <li>Parameter name is case-insensitive.
* <li>Use <js>"*"</js> to represent all methods.
- * </ul>
+ * </ul>
*
* <p>
* Note that per the <a class="doclink"
@@ -139,7 +139,7 @@ public final class RestContext extends BeanContext {
/**
* Configuration property: Allow header URL parameters.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"RestContext.allowHeaderParams.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -155,7 +155,7 @@ public final class RestContext extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* When enabled, headers such as <js>"Accept"</js> and <js>"Content-Type"</js> to be passed in as URL query
* parameters.
@@ -166,14 +166,14 @@ public final class RestContext extends BeanContext {
* <ul class='spaced-list'>
* <li>Parameter name is case-insensitive.
* <li>Useful for debugging REST interface using only a browser.
- * </ul>
+ * </ul>
*/
public static final String REST_allowHeaderParams = PREFIX + "allowHeaderParams.b";
/**
* Configuration property: REST call handler.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"RestContext.callHandler.o"</js>
* <li><b>Data type:</b> <code>Class<? <jk>extends</jk> {@link RestCallHandler}> | {@link RestCallHandler}</code>
@@ -190,7 +190,7 @@ public final class RestContext extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* This class handles the basic lifecycle of an HTTP REST call.
* <br>Subclasses can be used to customize how these HTTP calls are handled.
@@ -200,7 +200,7 @@ public final class RestContext extends BeanContext {
/**
* Configuration property: Children.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"RestContext.children.lo"</js>
* <li><b>Data type:</b> <code>List<Class | Object | {@link RestChild}></code>
@@ -218,7 +218,7 @@ public final class RestContext extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Defines children of this resource.
*
@@ -270,19 +270,19 @@ public final class RestContext extends BeanContext {
* <li><code><jk>public</jk> T(RestContextBuilder)</code>
* <li><code><jk>public</jk> T()</code>
* </ul>
- * </ul>
+ * </ul>
*
- * <h5 class='section'>Documentation:</h5>
- * <ul>
- * <li><a class="doclink" href="package-summary.html#RestResources.Children">org.apache.juneau.rest > Children</a>
- * </ul>
+ * <h5 class='section'>Documentation:</h5>
+ * <ul>
+ * <li><a class="doclink" href="package-summary.html#RestResources.Children">org.apache.juneau.rest > Children</a>
+ * </ul>
*/
public static final String REST_children = PREFIX + "children.lo";
/**
* Configuration property: Classpath resource finder.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"RestContext.classpathResourceFinder.o"</js>
* <li><b>Data type:</b> {@link ClasspathResourceFinder}
@@ -299,7 +299,7 @@ public final class RestContext extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Used to retrieve localized files from the classpath.
*
@@ -318,7 +318,7 @@ public final class RestContext extends BeanContext {
/**
* Configuration property: Client version header.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"RestContext.clientVersionHeader.s"</js>
* <li><b>Data type:</b> <code>String</code>
@@ -334,7 +334,7 @@ public final class RestContext extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Specifies the name of the header used to denote the client version on HTTP requests.
*
@@ -347,7 +347,7 @@ public final class RestContext extends BeanContext {
/**
* Configuration property: Resource context path.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"RestContext.contextPath.s"</js>
* <li><b>Data type:</b> <code>String</code>
@@ -363,7 +363,7 @@ public final class RestContext extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Overrides the context path value for this resource and any child resources.
*
@@ -378,7 +378,7 @@ public final class RestContext extends BeanContext {
/**
* Configuration property: Class-level response converters.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"RestContext.converters.lo"</js>
* <li><b>Data type:</b> <code>List<{@link RestConverter} | Class<? <jk>extends</jk> {@link RestConverter}>></code>
@@ -396,7 +396,7 @@ public final class RestContext extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Associates one or more {@link RestConverter converters} with a resource class.
* These converters get called immediately after execution of the REST method in the same order specified in the
@@ -405,17 +405,17 @@ public final class RestContext extends BeanContext {
* <p>
* Can be used for performing post-processing on the response object before serialization.
*
- * <h5 class='section'>Documentation:</h5>
- * <ul>
- * <li><a class="doclink" href="package-summary.html#RestResources.Converters">org.apache.juneau.rest > Converters</a>
- * </ul>
+ * <h5 class='section'>Documentation:</h5>
+ * <ul>
+ * <li><a class="doclink" href="package-summary.html#RestResources.Converters">org.apache.juneau.rest > Converters</a>
+ * </ul>
*/
public static final String REST_converters = PREFIX + "converters.lo";
/**
* Configuration property: Default character encoding.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"RestContext.defaultCharset.s"</js>
* <li><b>Data type:</b> <code>String</code>
@@ -432,7 +432,7 @@ public final class RestContext extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* The default character encoding for the request and response if not specified on the request.
*/
@@ -441,7 +441,7 @@ public final class RestContext extends BeanContext {
/**
* Configuration property: Default request headers.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"RestContext.defaultRequestHeaders.smo"</js>
* <li><b>Data type:</b> <code>Map<String,String></code>
@@ -459,7 +459,7 @@ public final class RestContext extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Specifies default values for request headers.
*
@@ -468,14 +468,14 @@ public final class RestContext extends BeanContext {
* <li>Affects values returned by {@link RestRequest#getHeader(String)} when the header is not present on the request.
* <li>The most useful reason for this annotation is to provide a default <code>Accept</code> header when one is not
* specified so that a particular default {@link Serializer} is picked.
- * </ul>
+ * </ul>
*/
public static final String REST_defaultRequestHeaders = PREFIX + "defaultRequestHeaders.smo";
/**
* Configuration property: Default response headers.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"RestContext.defaultResponseHeaders.omo"</js>
* <li><b>Data type:</b> <code>Map<String,String></code>
@@ -492,8 +492,8 @@ public final class RestContext extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
- * <p>
+ * <h5 class='section'>Description:</h5>
+ * <p>
* Specifies default values for response headers.
*
* <h5 class='section'>Notes:</h5>
@@ -501,14 +501,14 @@ public final class RestContext extends BeanContext {
* <li>This is equivalent to calling {@link RestResponse#setHeader(String, String)} programmatically in each of
* the Java methods.
* <li>The header value will not be set if the header value has already been specified (hence the 'default' in the name).
- * </ul>
+ * </ul>
*/
public static final String REST_defaultResponseHeaders = PREFIX + "defaultResponseHeaders.omo";
/**
* Configuration property: Compression encoders.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"RestContext.encoders.o"</js>
* <li><b>Data type:</b> <code>List<Class <? <jk>extends</jk> Encoder> | Encoder></code>
@@ -526,7 +526,7 @@ public final class RestContext extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* These can be used to enable various kinds of compression (e.g. <js>"gzip"</js>) on requests and responses.
*
@@ -551,7 +551,7 @@ public final class RestContext extends BeanContext {
/**
* Configuration property: Class-level guards.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"RestContext.guards.lo"</js>
* <li><b>Data type:</b> <code>List<RestGuard | Class<? <jk>extends</jk> RestGuard>></code>
@@ -569,7 +569,7 @@ public final class RestContext extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Associates one or more {@link RestGuard RestGuards} with all REST methods defined in this class.
* These guards get called immediately before execution of any REST method in this class.
@@ -581,14 +581,14 @@ public final class RestContext extends BeanContext {
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>{@link RestGuard} classes must have either a no-arg or {@link PropertyStore} argument constructors.
- * </ul>
+ * </ul>
*/
public static final String REST_guards = PREFIX + "guards.lo";
/**
* Configuration property: REST info provider.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"RestContext.infoProvider.o"</js>
* <li><b>Data type:</b> <code>Class<? <jk>extends</jk> RestInfoProvider> | RestInfoProvider</code>
@@ -605,7 +605,7 @@ public final class RestContext extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Class used to retrieve title/description/swagger information about a resource.
*
@@ -617,7 +617,7 @@ public final class RestContext extends BeanContext {
/**
* Configuration property: REST logger.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"RestContext.logger.o"</js>
* <li><b>Data type:</b> <code>Class<? <jk>extends</jk> RestLogger> | RestLogger</code>
@@ -634,7 +634,7 @@ public final class RestContext extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Specifies the logger to use for logging.
*
@@ -643,14 +643,14 @@ public final class RestContext extends BeanContext {
* <ul class='spaced-list'>
* <li>Property: {@link RestContext#REST_logger}
* <li>The {@link RestLogger.Normal} logger can be used to provide basic error logging to the Java logger.
- * </ul>
+ * </ul>
*/
public static final String REST_logger = PREFIX + "logger.o";
/**
* Configuration property: The maximum allowed input size (in bytes) on HTTP requests.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"RestContext.maxInput.s"</js>
* <li><b>Data type:</b> <code>String</code>
@@ -667,7 +667,7 @@ public final class RestContext extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Useful for alleviating DoS attacks by throwing an exception when too much input is received instead of resulting
* in out-of-memory errors which could affect system stability.
@@ -678,14 +678,14 @@ public final class RestContext extends BeanContext {
* <li>Can be suffixed with any of the following representing kilobytes, megabytes, and gigabytes:
* <js>'K'</js>, <js>'M'</js>, <js>'G'</js>.
* <li>A value of <js>"-1"</js> can be used to represent no limit.
- * </ul>
+ * </ul>
*/
public static final String REST_maxInput = PREFIX + "maxInput.s";
/**
* Configuration property: Messages.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"RestContext.messages.lo"</js>
* <li><b>Data type:</b> <code>List<MessageBundleLocation></code>
@@ -703,7 +703,7 @@ public final class RestContext extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Identifies the location of the resource bundle for this class.
*
@@ -732,7 +732,7 @@ public final class RestContext extends BeanContext {
/**
* Configuration property: MIME types.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"RestContext.mimeTypes.ss"</js>
* <li><b>Data type:</b> <code>Set<String></code>
@@ -748,7 +748,7 @@ public final class RestContext extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Defines MIME-type file type mappings.
*
@@ -775,7 +775,7 @@ public final class RestContext extends BeanContext {
/**
* Configuration property: Java method parameter resolvers.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"RestContext.paramResolvers.lo"</js>
* <li><b>Data type:</b> <code>List<RestParam | Class<? <jk>extends</jk> RestParam>></code>
@@ -791,7 +791,7 @@ public final class RestContext extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* By default, the Juneau framework will automatically Java method parameters of various types (e.g.
* <code>RestRequest</code>, <code>Accept</code>, <code>Reader</code>).
@@ -820,14 +820,14 @@ public final class RestContext extends BeanContext {
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>{@link RestParam} classes must have either a no-arg or {@link PropertyStore} argument constructors.
- * </ul>
+ * </ul>
*/
public static final String REST_paramResolvers = PREFIX + "paramResolvers.lo";
/**
* Configuration property: Parsers.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"RestContext.parsers.lo"</js>
* <li><b>Data type:</b> <code>List<Class <? <jk>extends</jk> Parser> | Parser></code>
@@ -846,7 +846,7 @@ public final class RestContext extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Adds class-level parsers to this resource.
*
@@ -856,17 +856,17 @@ public final class RestContext extends BeanContext {
* <li>When defined as an instance, properties/transforms defined on the resource/method are NOT inherited.
* </ul>
*
- * <h5 class='section'>Documentation:</h5>
- * <ul>
- * <li><a class="doclink" href="package-summary.html#RestResources.Parsers">org.apache.juneau.rest > Parsers</a>
- * </ul>
+ * <h5 class='section'>Documentation:</h5>
+ * <ul>
+ * <li><a class="doclink" href="package-summary.html#RestResources.Parsers">org.apache.juneau.rest > Parsers</a>
+ * </ul>
*/
public static final String REST_parsers = PREFIX + "parsers.lo";
/**
* Configuration property: HTTP part parser.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"RestContext.partParser.o"</js>
* <li><b>Data type:</b> <code>Class <? <jk>extends</jk> HttpPartParser> | HttpPartParser</code>
@@ -883,7 +883,7 @@ public final class RestContext extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Specifies the {@link HttpPartParser} to use for parsing headers, query/form parameters, and URI parts.
*
@@ -898,7 +898,7 @@ public final class RestContext extends BeanContext {
/**
* Configuration property: HTTP part serializer.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"RestContext.partSerializer.o"</js>
* <li><b>Data type:</b> <code>Class <? <jk>extends</jk> HttpPartSerializer> | HttpPartSerializer</code>
@@ -915,7 +915,7 @@ public final class RestContext extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Specifies the {@link HttpPartSerializer} to use for serializing headers, query/form parameters, and URI parts.
*
@@ -930,7 +930,7 @@ public final class RestContext extends BeanContext {
/**
* Configuration property: Resource path.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"RestContext.path.s"</js>
* <li><b>Data type:</b> <code>String</code>
@@ -946,7 +946,7 @@ public final class RestContext extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Identifies the URL subpath relative to the parent resource.
*
@@ -958,14 +958,14 @@ public final class RestContext extends BeanContext {
* <li>Typically, this setting is only applicable to resources defined as children through the
* {@link RestResource#children() @RestResource.children()} annotation.
* <br>However, it may be used in other ways (e.g. defining paths for top-level resources in microservices).
- * </ul>
+ * </ul>
*/
public static final String REST_path = PREFIX + "path.s";
/**
* Configuration property: Render response stack traces in responses.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"RestContext.renderResponseStackTraces.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -982,7 +982,7 @@ public final class RestContext extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Render stack traces in HTTP response bodies when errors occur.
*
@@ -990,14 +990,14 @@ public final class RestContext extends BeanContext {
* <ul class='spaced-list'>
* <li>Useful for debugging, although allowing stack traces to be rendered may cause security concerns so use
* caution when enabling.
- * </ul>
+ * </ul>
*/
public static final String REST_renderResponseStackTraces = PREFIX + "renderResponseStackTraces.b";
/**
* Configuration property: REST resource resolver.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"RestContext.resourceResolver.o"</js>
* <li><b>Data type:</b> <code>Class<? <jk>extends</jk> RestResourceResolver> | RestResourceResolver</code>
@@ -1014,8 +1014,8 @@ public final class RestContext extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
- * <p>
+ * <h5 class='section'>Description:</h5>
+ * <p>
* The resolver used for resolving child resources.
*
* <p>
@@ -1025,14 +1025,14 @@ public final class RestContext extends BeanContext {
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>Unless overridden, resource resolvers are inherited from parent resources.
- * </ul>
+ * </ul>
*/
public static final String REST_resourceResolver = PREFIX + "resourceResolver.o";
/**
* Configuration property: Response handlers.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"RestContext.responseHandlers.lo"</js>
* <li><b>Data type:</b> <code>List<Class<? <jk>extends</jk> ResponseHandler>></code>
@@ -1049,7 +1049,7 @@ public final class RestContext extends BeanContext {
</ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Specifies a list of {@link ResponseHandler} classes that know how to convert POJOs returned by REST methods or
* set via {@link RestResponse#setOutput(Object)} into appropriate HTTP responses.
@@ -1069,14 +1069,14 @@ public final class RestContext extends BeanContext {
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>{@link ResponseHandler} classes must have either a no-arg or {@link PropertyStore} argument constructors.
- * </ul>
+ * </ul>
*/
public static final String REST_responseHandlers = PREFIX + "responseHandlers.lo";
/**
* Configuration property: Serializers.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"RestContext.serializers.lo"</js>
* <li><b>Data type:</b> <code>List<Class <? <jk>extends</jk> Serializer> | Serializer></code>
@@ -1095,7 +1095,7 @@ public final class RestContext extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Adds class-level serializers to this resource.
*
@@ -1105,17 +1105,17 @@ public final class RestContext extends BeanContext {
* <li>When defined as an instance, properties/transforms defined on the resource/method are NOT inherited.
* </ul>
*
- * <h5 class='section'>Documentation:</h5>
- * <ul>
- * <li><a class="doclink" href="package-summary.html#RestResources.Serializers">org.apache.juneau.rest > Serializers</a>
- * </ul>
+ * <h5 class='section'>Documentation:</h5>
+ * <ul>
+ * <li><a class="doclink" href="package-summary.html#RestResources.Serializers">org.apache.juneau.rest > Serializers</a>
+ * </ul>
*/
public static final String REST_serializers = PREFIX + "serializers.lo";
/**
* Configuration property: Static file response headers.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"RestContext.staticFileResponseHeaders.omo"</js>
* <li><b>Data type:</b> <code>Map<String,String></code>
@@ -1133,7 +1133,7 @@ public final class RestContext extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Used to customize the headers on responses returned for statically-served files.
*/
@@ -1142,7 +1142,7 @@ public final class RestContext extends BeanContext {
/**
* Configuration property: Static file mappings.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"RestContext.staticFiles.lo"</js>
* <li><b>Data type:</b> <code>List<StaticFileMapping></code>
@@ -1162,7 +1162,7 @@ public final class RestContext extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Used to define paths and locations of statically-served files such as images or HTML documents.
*
@@ -1207,7 +1207,7 @@ public final class RestContext extends BeanContext {
/**
* Configuration property: Supported accept media types.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"RestContext.supportedAcceptTypes.ls"</js>
* <li><b>Data type:</b> <code>List<String></code>
@@ -1225,7 +1225,7 @@ public final class RestContext extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Overrides the media types inferred from the serializers that identify what media types can be produced by the resource.
*
@@ -1238,7 +1238,7 @@ public final class RestContext extends BeanContext {
/**
* Configuration property: Supported content media types.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"RestContext.supportedContentTypes.ls"</js>
* <li><b>Data type:</b> <code>List<String></code>
@@ -1256,7 +1256,7 @@ public final class RestContext extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Overrides the media types inferred from the parsers that identify what media types can be consumed by the resource.
*
@@ -1269,7 +1269,7 @@ public final class RestContext extends BeanContext {
/**
* Configuration property: Use classpath resource caching.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"RestContext.useClasspathResourceCaching.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -1285,7 +1285,7 @@ public final class RestContext extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* When enabled, resources retrieved via {@link RestContext#getClasspathResource(String, Locale)} (and related
* methods) will be cached in memory to speed subsequent lookups.
@@ -1295,7 +1295,7 @@ public final class RestContext extends BeanContext {
/**
* Configuration property: Use stack trace hashes.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"RestContext.useStackTraceHashes.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -1311,7 +1311,7 @@ public final class RestContext extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* When enabled, the number of times an exception has occurred will be determined based on stack trace hashsums,
* made available through the {@link RestException#getOccurrence()} method.
@@ -1321,7 +1321,7 @@ public final class RestContext extends BeanContext {
/**
* Configuration property: HTML Widgets.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"RestContext.widgets.lo"</js>
* <li><b>Data type:</b> <code>List<Class<? <jk>extends</jk> Widget> | Widget></code>
@@ -1339,7 +1339,7 @@ public final class RestContext extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Defines widgets that can be used in conjunction with string variables of the form <js>"$W{name}"</js>to quickly
* generate arbitrary replacement text.
http://git-wip-us.apache.org/repos/asf/juneau/blob/0ab0b231/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/StreamResource.java
----------------------------------------------------------------------
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/StreamResource.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/StreamResource.java
index 8a32f59..bb76623 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/StreamResource.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/StreamResource.java
@@ -54,7 +54,7 @@ public class StreamResource implements Streamable {
* <li><code>Reader</code> - Converted to UTF-8 bytes.
* <li><code>File</code>
* <li><code>CharSequence</code> - Converted to UTF-8 bytes.
- * </ul>
+ * </ul>
* @throws IOException
*/
public StreamResource(MediaType mediaType, Object...contents) throws IOException {
@@ -76,7 +76,7 @@ public class StreamResource implements Streamable {
* <li><code>Reader</code> - Converted to UTF-8 bytes.
* <li><code>File</code>
* <li><code>CharSequence</code> - Converted to UTF-8 bytes.
- * </ul>
+ * </ul>
* @throws IOException
*/
public StreamResource(MediaType mediaType, Map<String,Object> headers, Object...contents) throws IOException {
@@ -154,7 +154,7 @@ public class StreamResource implements Streamable {
* <li><code>Reader</code> - Converted to UTF-8 bytes.
* <li><code>File</code>
* <li><code>CharSequence</code> - Converted to UTF-8 bytes.
- * </ul>
+ * </ul>
* @return This object (for method chaining).
*/
public Builder contents(Object...contents) {
http://git-wip-us.apache.org/repos/asf/juneau/blob/0ab0b231/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestMethod.java
----------------------------------------------------------------------
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestMethod.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestMethod.java
index a52be4c..c933f68 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestMethod.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestMethod.java
@@ -59,7 +59,7 @@ public @interface RestMethod {
* In the example below, our 'summary' view is a list of beans where we only want to show the ID property,
* and our detail view is a single bean where we want to expose different fields:
* <p class='bcode'>
- * <jc>// Our bean</jc>
+ * <jc>// Our bean</jc>
* <jk>public class</jk> MyBean {
*
* <jc>// Summary properties</jc>
@@ -70,11 +70,11 @@ public @interface RestMethod {
* <jk>public</jk> String <jf>a</jf>, <jf>b</jf>;
* }
*
- * <jc>// Only render "id" property.</jc>
+ * <jc>// Only render "id" property.</jc>
* <ja>@RestMethod</ja>(name=<jsf>GET</jsf>, path=<js>"/mybeans"</js>, bpi=<js>"MyBean: id"</js>)
* <jk>public</jk> List<MyBean> getBeanSummary();
*
- * <jc>// Only render "a" and "b" properties.</jc>
+ * <jc>// Only render "a" and "b" properties.</jc>
* <ja>@RestMethod</ja>(name=<jsf>GET</jsf>, path=<js>"/mybeans/{id}"</js>, bpi=<js>"MyBean: a,b"</js>)
* <jk>public</jk> MyBean getBeanDetails(<ja>@Path</ja> String id);
* </p>
@@ -110,7 +110,7 @@ public @interface RestMethod {
* <p>
* In the example below, our 'summary' view is a list of beans where we want to exclude some properties:
* <p class='bcode'>
- * <jc>// Our bean</jc>
+ * <jc>// Our bean</jc>
* <jk>public class</jk> MyBean {
*
* <jc>// Summary properties</jc>
@@ -121,11 +121,11 @@ public @interface RestMethod {
* <jk>public</jk> String <jf>a</jf>, <jf>b</jf>;
* }
*
- * <jc>// Don't show "a" and "b" properties.</jc>
+ * <jc>// Don't show "a" and "b" properties.</jc>
* <ja>@RestMethod</ja>(name=<jsf>GET</jsf>, path=<js>"/mybeans"</js>, bpx=<js>"MyBean: a,b"</js>)
* <jk>public</jk> List<MyBean> getBeanSummary();
*
- * <jc>// Render all properties.</jc>
+ * <jc>// Render all properties.</jc>
* <ja>@RestMethod</ja>(name=<jsf>GET</jsf>, path=<js>"/mybeans/{id}"</js>)
* <jk>public</jk> MyBean getBeanDetails(<ja>@Path</ja> String id);
* </p>
@@ -218,7 +218,7 @@ public @interface RestMethod {
String clientVersion() default "";
/**
- * Class-level response converters.
+ * Class-level response converters.
*
* <p>
* Associates one or more {@link RestConverter converters} with this method.
http://git-wip-us.apache.org/repos/asf/juneau/blob/0ab0b231/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestResource.java
----------------------------------------------------------------------
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestResource.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestResource.java
index 0dfdf00..c127d2b 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestResource.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestResource.java
@@ -153,7 +153,7 @@ public @interface RestResource {
Class<? extends RestCallHandler> callHandler() default RestCallHandler.class;
/**
- * Children.
+ * Children.
*
* <p>
* Defines children of this resource.
[4/4] juneau git commit: Update javadocs.
Posted by ja...@apache.org.
Update javadocs.
Project: http://git-wip-us.apache.org/repos/asf/juneau/repo
Commit: http://git-wip-us.apache.org/repos/asf/juneau/commit/0ab0b231
Tree: http://git-wip-us.apache.org/repos/asf/juneau/tree/0ab0b231
Diff: http://git-wip-us.apache.org/repos/asf/juneau/diff/0ab0b231
Branch: refs/heads/master
Commit: 0ab0b23102b9b0fb56d3d7c14e262f7eb5c1d74d
Parents: 56e22ce
Author: JamesBognar <ja...@apache.org>
Authored: Sat Jan 13 17:11:12 2018 -0500
Committer: JamesBognar <ja...@apache.org>
Committed: Sat Jan 13 17:11:12 2018 -0500
----------------------------------------------------------------------
.../java/org/apache/juneau/ini/ConfigFile.java | 2 +-
.../juneau/a/rttests/RoundTripBeanMapsTest.java | 2 +-
.../apache/juneau/dto/jsonschema/Sample.java | 1 +
.../java/org/apache/juneau/jena/RdfCommon.java | 120 ++---
.../java/org/apache/juneau/jena/RdfParser.java | 4 +-
.../org/apache/juneau/jena/RdfSerializer.java | 18 +-
.../java/org/apache/juneau/BeanContext.java | 357 +++++++------
.../org/apache/juneau/BeanContextBuilder.java | 139 ++++-
.../java/org/apache/juneau/BeanSession.java | 4 +-
.../java/org/apache/juneau/BeanSessionArgs.java | 66 ++-
.../java/org/apache/juneau/SessionArgs.java | 26 +-
.../apache/juneau/annotation/BeanProperty.java | 2 +-
.../java/org/apache/juneau/annotation/Swap.java | 16 +-
.../apache/juneau/html/HtmlDocSerializer.java | 48 +-
.../juneau/html/HtmlDocSerializerSession.java | 4 +-
.../org/apache/juneau/html/HtmlSerializer.java | 20 +-
.../apache/juneau/internal/JuneauLogger.java | 2 +-
.../org/apache/juneau/json/JsonSerializer.java | 12 +-
.../juneau/msgpack/MsgPackSerializer.java | 4 +-
.../main/java/org/apache/juneau/package.html | 177 -------
.../java/org/apache/juneau/parser/Parser.java | 169 +++++--
.../org/apache/juneau/parser/ParserBuilder.java | 41 ++
.../org/apache/juneau/parser/ParserSession.java | 20 +
.../apache/juneau/parser/ParserSessionArgs.java | 71 ++-
.../apache/juneau/serializer/Serializer.java | 507 ++++++++++++++++---
.../juneau/serializer/SerializerBuilder.java | 82 +++
.../juneau/serializer/SerializerSession.java | 27 +-
.../serializer/SerializerSessionArgs.java | 73 ++-
.../apache/juneau/soap/SoapXmlSerializer.java | 2 +-
.../transform/AnnotationBeanFilterBuilder.java | 2 +-
.../juneau/transform/BeanFilterBuilder.java | 16 +-
.../transform/InterfaceBeanFilterBuilder.java | 2 +-
.../org/apache/juneau/transform/PojoSwap.java | 28 +-
.../apache/juneau/transform/PropertyFilter.java | 46 +-
.../java/org/apache/juneau/uon/UonParser.java | 4 +-
.../org/apache/juneau/uon/UonSerializer.java | 12 +-
.../juneau/urlencoding/UrlEncodingParser.java | 4 +-
.../urlencoding/UrlEncodingSerializer.java | 4 +-
.../org/apache/juneau/utils/MessageBundle.java | 4 +-
.../java/org/apache/juneau/xml/XmlParser.java | 22 +-
.../org/apache/juneau/xml/XmlSerializer.java | 28 +-
.../juneau/yaml/proto/YamlSerializer.java | 12 +-
juneau-doc/src/main/javadoc/overview.html | 301 +++++++----
.../org/apache/juneau/rest/client/RestCall.java | 12 +-
.../apache/juneau/rest/client/RestClient.java | 60 +--
.../org/apache/juneau/rest/ReaderResource.java | 4 +-
.../org/apache/juneau/rest/RestContext.java | 204 ++++----
.../org/apache/juneau/rest/StreamResource.java | 6 +-
.../juneau/rest/annotation/RestMethod.java | 14 +-
.../juneau/rest/annotation/RestResource.java | 2 +-
50 files changed, 1860 insertions(+), 943 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/juneau/blob/0ab0b231/juneau-core/juneau-config/src/main/java/org/apache/juneau/ini/ConfigFile.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-config/src/main/java/org/apache/juneau/ini/ConfigFile.java b/juneau-core/juneau-config/src/main/java/org/apache/juneau/ini/ConfigFile.java
index 914f106..69aec1e 100644
--- a/juneau-core/juneau-config/src/main/java/org/apache/juneau/ini/ConfigFile.java
+++ b/juneau-core/juneau-config/src/main/java/org/apache/juneau/ini/ConfigFile.java
@@ -344,7 +344,7 @@ public abstract class ConfigFile implements Map<String,Section> {
* @param type
* The object type to create.
* <br>Can be any of the following: {@link ClassMeta}, {@link Class}, {@link ParameterizedType},
- * {@link GenericArrayType}
+ * {@link GenericArrayType}
* @param args
* The type arguments of the class if it's a collection or map.
* <br>Can be any of the following: {@link ClassMeta}, {@link Class}, {@link ParameterizedType},
http://git-wip-us.apache.org/repos/asf/juneau/blob/0ab0b231/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/a/rttests/RoundTripBeanMapsTest.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/a/rttests/RoundTripBeanMapsTest.java b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/a/rttests/RoundTripBeanMapsTest.java
index 20d6091..982ec2c 100755
--- a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/a/rttests/RoundTripBeanMapsTest.java
+++ b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/a/rttests/RoundTripBeanMapsTest.java
@@ -520,7 +520,7 @@ public class RoundTripBeanMapsTest extends RoundTripTest {
}
public static class D2Filter extends BeanFilterBuilder<D2> {
public D2Filter() {
- includeProperties("f3,f2");
+ properties("f3,f2");
}
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/0ab0b231/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/jsonschema/Sample.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/jsonschema/Sample.java b/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/jsonschema/Sample.java
index 728cf18..1d6c176 100644
--- a/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/jsonschema/Sample.java
+++ b/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/jsonschema/Sample.java
@@ -48,6 +48,7 @@ class Sample {
};
// Get schema from the schema map.
+ @SuppressWarnings("unlikely-arg-type")
Schema purchaseOrderSchema = schemaMap.get("http://www.apache.org/purchase-order/PurchaseOrder#");
JsonType streetType = purchaseOrderSchema
http://git-wip-us.apache.org/repos/asf/juneau/blob/0ab0b231/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfCommon.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfCommon.java b/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfCommon.java
index f5b312b..c962179 100644
--- a/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfCommon.java
+++ b/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfCommon.java
@@ -45,7 +45,7 @@ public interface RdfCommon {
/**
* Configuration property: RDF language.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"Rdf.language.s"</js>
* <li><b>Data type:</b> <code>String</code>
@@ -66,7 +66,7 @@ public interface RdfCommon {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Can be any of the following:
* <ul class='spaced-list'>
@@ -102,7 +102,7 @@ public interface RdfCommon {
/**
* Configuration property: XML namespace for Juneau properties.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"Rdf.juneauNs.s"</js>
* <li><b>Data type:</b> {@link Namespace}
@@ -119,7 +119,7 @@ public interface RdfCommon {
/**
* Configuration property: Default XML namespace for bean properties.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"Rdf.juneauBpNs.s"</js>
* <li><b>Data type:</b> {@link Namespace}
@@ -136,7 +136,7 @@ public interface RdfCommon {
/**
* Configuration property: Reuse XML namespaces when RDF namespaces not specified.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"Rdf.useXmlNamespaces.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -148,7 +148,7 @@ public interface RdfCommon {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* When specified, namespaces defined using {@link XmlNs @XmlNs} and {@link Xml @Xml} will be inherited by the RDF serializers.
* Otherwise, namespaces will be defined using {@link RdfNs @RdfNs} and {@link Rdf @Rdf}.
@@ -158,14 +158,14 @@ public interface RdfCommon {
/**
* Configuration property: RDF/XML property: <code>iri_rules</code>.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"Rdf.jena.rdfXml.iri-rules.s"</js>
* <li><b>Data type:</b> <code>String</code>
* <li><b>Default:</b> <js>"lax"</js>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Set the engine for checking and resolving.
*
@@ -189,14 +189,14 @@ public interface RdfCommon {
/**
* Configuration property: RDF/XML ARP property: <code>error-mode</code>.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"Rdf.jena.rdfXml.error-mode.s"</js>
* <li><b>Data type:</b> <code>String</code>
* <li><b>Default:</b> <js>"lax"</js>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* This allows a coarse-grained approach to control of error handling.
*
@@ -230,14 +230,14 @@ public interface RdfCommon {
/**
* Configuration property: RDF/XML ARP property: <code>embedding</code>.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"Rdf.jena.rdfXml.embedding.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
* <li><b>Default:</b> <jk>false</jk>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Sets ARP to look for RDF embedded within an enclosing XML document.
*
@@ -253,13 +253,13 @@ public interface RdfCommon {
/**
* Configuration property: RDF/XML ARP property: <code>ERR_xxx</code>.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"Rdf.jena.rdfXml.ERR_"</js>
* <li><b>Data type:</b> <code>String</code>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Provides fine-grained control over detected error conditions.
*
@@ -286,13 +286,13 @@ public interface RdfCommon {
/**
* Configuration property: RDF/XML ARP property: <code>WARN_xxx</code>.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"Rdf.jena.rdfXml.WARN_"</js>
* <li><b>Data type:</b> <code>String</code>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* See {@link #RDF_arp_err_} for details.
*/
@@ -301,13 +301,13 @@ public interface RdfCommon {
/**
* RDF/XML ARP property: <code>IGN_xxx</code>.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"Rdf.jena.rdfXml.IGN_"</js>
* <li><b>Data type:</b> <code>String</code>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* See {@link #RDF_arp_err_} for details.
*/
@@ -316,14 +316,14 @@ public interface RdfCommon {
/**
* Configuration property: RDF/XML property: <code>xmlbase</code>.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"Rdf.jena.rdfXml.xmlbase.s"</js>
* <li><b>Data type:</b> <code>String</code>
* <li><b>Default:</b> <jk>null</jk>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* The value to be included for an <xa>xml:base</xa> attribute on the root element in the file.
*/
@@ -332,14 +332,14 @@ public interface RdfCommon {
/**
* Configuration property: RDF/XML property: <code>longId</code>.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"Rdf.jena.rdfXml.longId.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
* <li><b>Default:</b> <jk>false</jk>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Whether to use long ID's for anon resources.
* Short ID's are easier to read, but can run out of memory on very large models.
@@ -349,14 +349,14 @@ public interface RdfCommon {
/**
* Configuration property: RDF/XML property: <code>allowBadURIs</code>.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"Rdf.jena.rdfXml.allowBadURIs.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
* <li><b>Default:</b> <jk>false</jk>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* URIs in the graph are, by default, checked prior to serialization.
*/
@@ -365,14 +365,14 @@ public interface RdfCommon {
/**
* Configuration property: RDF/XML property: <code>relativeURIs</code>.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"Rdf.jena.rdfXml.relativeURIs.s"</js>
* <li><b>Data type:</b> <code>String</code>
* <li><b>Default:</b> <js>"same-document, absolute, relative, parent"</js>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* What sort of relative URIs should be used.
*
@@ -403,14 +403,14 @@ public interface RdfCommon {
/**
* Configuration property: RDF/XML property: <code>showXmlDeclaration</code>.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"Rdf.jena.rdfXml.showXmlDeclaration.s"</js>
* <li><b>Data type:</b> <code>String</code>
* <li><b>Default:</b> <js>"default"</js>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Possible values:
* <ul class='spaced-list'>
@@ -429,14 +429,14 @@ public interface RdfCommon {
/**
* Configuration property: RDF/XML property: <code>showDoctypeDeclaration</code>.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"Rdf.jena.rdfXml.showDoctypeDeclaration.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
* <li><b>Default:</b> <jk>true</jk>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* If true, an XML doctype declaration is included in the output.
* This declaration includes a <code>!ENTITY</code> declaration for each prefix mapping in the model, and any
@@ -448,14 +448,14 @@ public interface RdfCommon {
/**
* Configuration property: RDF/XML property: <code>tab</code>.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"Rdf.jena.rdfXml.tab.i"</js>
* <li><b>Data type:</b> <code>Integer</code>
* <li><b>Default:</b> <code>2</code>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* The number of spaces with which to indent XML child elements.
*/
@@ -464,14 +464,14 @@ public interface RdfCommon {
/**
* Configuration property: RDF/XML property: <code>attributeQuoteChar</code>.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"Rdf.jena.rdfXml.attributeQuoteChar.s"</js>
* <li><b>Data type:</b> <code>Character</code>
* <li><b>Default:</b> <js>'"'</js>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* The XML attribute quote character.
*/
@@ -480,14 +480,14 @@ public interface RdfCommon {
/**
* Configuration property: RDF/XML property: <code>blockRules</code>.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"Rdf.jena.rdfXml.blockRules.s"</js>
* <li><b>Data type:</b> <code>String</code>
* <li><b>Default:</b> <js>""</js>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* A list of <code>Resource</code> or a <code>String</code> being a comma separated list of fragment IDs from
* <a class="doclink" href="http://www.w3.org/TR/rdf-syntax-grammar">RDF Syntax Grammar</a> indicating grammar
@@ -498,14 +498,14 @@ public interface RdfCommon {
/**
* Configuration property: N3/Turtle property: <code>minGap</code>.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"Rdf.jena.n3.minGap.i"</js>
* <li><b>Data type:</b> <code>Integer</code>
* <li><b>Default:</b> <code>1</code>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Minimum gap between items on a line.
*/
@@ -514,14 +514,14 @@ public interface RdfCommon {
/**
* Configuration property: N3/Turtle property: <code>objectLists</code>.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"Rdf.jena.n3.objectLists.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
* <li><b>Default:</b> <jk>true</jk>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Print object lists as comma separated lists.
*/
@@ -530,14 +530,14 @@ public interface RdfCommon {
/**
* Configuration property: N3/Turtle property: <code>subjectColumn</code>.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"Rdf.jena.n3.subjectColumn.i"</js>
* <li><b>Data type:</b> <code>Integer</code>
* <li><b>Default:</b> indentProperty
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* If the subject is shorter than this value, the first property may go on the same line.
*/
@@ -546,14 +546,14 @@ public interface RdfCommon {
/**
* Configuration property: N3/Turtle property: <code>propertyColumn</code>.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"Rdf.jena.n3.propertyColumn.i"</js>
* <li><b>Data type:</b> <code>Integer</code>
* <li><b>Default:</b> <code>8</code>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Width of the property column.
*/
@@ -562,14 +562,14 @@ public interface RdfCommon {
/**
* Configuration property: N3/Turtle property: <code>indentProperty</code>.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"Rdf.jena.n3.indentProperty.i"</js>
* <li><b>Data type:</b> <code>Integer</code>
* <li><b>Default:</b> <code>6</code>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Width to indent properties.
*/
@@ -578,14 +578,14 @@ public interface RdfCommon {
/**
* Configuration property: N3/Turtle property: <code>widePropertyLen</code>.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"Rdf.jena.n3.widePropertyLen.i"</js>
* <li><b>Data type:</b> <code>Integer</code>
* <li><b>Default:</b> <code>20</code>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Width of the property column.
* Must be longer than <code>propertyColumn</code>.
@@ -595,14 +595,14 @@ public interface RdfCommon {
/**
* Configuration property: N3/Turtle property: <code>abbrevBaseURI</code>.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"Rdf.jena.n3.abbrevBaseURI.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
* <li><b>Default:</b> <jk>true</jk>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Control whether to use abbreviations <code><></code> or <code><#></code>.
*/
@@ -611,14 +611,14 @@ public interface RdfCommon {
/**
* Configuration property: N3/Turtle property: <code>usePropertySymbols</code>.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"Rdf.jena.n3.usePropertySymbols.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
* <li><b>Default:</b> <jk>true</jk>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Control whether to use <code>a</code>, <code>=</code> and <code>=></code> in output
*/
@@ -627,14 +627,14 @@ public interface RdfCommon {
/**
* Configuration property: N3/Turtle property: <code>useTripleQuotedStrings</code>.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"Rdf.jena.n3.useTripleQuotedStrings.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
* <li><b>Default:</b> <jk>true</jk>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Allow the use of <code>"""</code> to delimit long strings.
*/
@@ -643,14 +643,14 @@ public interface RdfCommon {
/**
* Configuration property: N3/Turtle property: <code>useDoubles</code>.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"Rdf.jena.n3.useDoubles.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
* <li><b>Default:</b> <jk>true</jk>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Allow the use doubles as <code>123.456</code>.
*/
@@ -659,7 +659,7 @@ public interface RdfCommon {
/**
* Configuration property: RDF format for representing collections and arrays.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"Rdf.collectionFormat.s"</js>
* <li><b>Data type:</b> <code>String</code>
@@ -671,7 +671,7 @@ public interface RdfCommon {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Possible values:
* <ul class='spaced-list'>
@@ -698,7 +698,7 @@ public interface RdfCommon {
/**
* Configuration property: Collections should be serialized and parsed as loose collections.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"Rdf.looseCollections.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -712,7 +712,7 @@ public interface RdfCommon {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* When specified, collections of resources are handled as loose collections of resources in RDF instead of
* resources that are children of an RDF collection (e.g. Sequence, Bag).
http://git-wip-us.apache.org/repos/asf/juneau/blob/0ab0b231/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfParser.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfParser.java b/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfParser.java
index 2fa67eb..8680794 100644
--- a/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfParser.java
+++ b/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfParser.java
@@ -56,7 +56,7 @@ public class RdfParser extends ReaderParser implements RdfCommon {
/**
* Configuration property: Trim whitespace from text elements.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"RdfParser.trimWhitespace.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -69,7 +69,7 @@ public class RdfParser extends ReaderParser implements RdfCommon {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* If <jk>true</jk>, whitespace in text elements will be automatically trimmed.
*/
http://git-wip-us.apache.org/repos/asf/juneau/blob/0ab0b231/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfSerializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfSerializer.java b/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfSerializer.java
index db02826..9b8c3e2 100644
--- a/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfSerializer.java
+++ b/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfSerializer.java
@@ -54,7 +54,7 @@ public class RdfSerializer extends WriterSerializer implements RdfCommon {
/**
* Configuration property: Add <js>"_type"</js> properties when needed.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"RdfSerializer.addBeanTypeProperties.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -66,7 +66,7 @@ public class RdfSerializer extends WriterSerializer implements RdfCommon {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* If <jk>true</jk>, then <js>"_type"</js> properties will be added to beans if their type cannot be inferred
* through reflection.
@@ -83,7 +83,7 @@ public class RdfSerializer extends WriterSerializer implements RdfCommon {
/**
* Configuration property: Add XSI data types to non-<code>String</code> literals.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"RdfSerializer.addLiteralTypes.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -101,7 +101,7 @@ public class RdfSerializer extends WriterSerializer implements RdfCommon {
/**
* Configuration property: Add RDF root identifier property to root node.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"RdfSerializer.addRootProperty.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -114,7 +114,7 @@ public class RdfSerializer extends WriterSerializer implements RdfCommon {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* When enabled an RDF property <code>http://www.apache.org/juneau/root</code> is added with a value of <js>"true"</js>
* to identify the root node in the graph.
@@ -129,7 +129,7 @@ public class RdfSerializer extends WriterSerializer implements RdfCommon {
/**
* Configuration property: Auto-detect namespace usage.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"RdfSerializer.autoDetectNamespaces.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -141,7 +141,7 @@ public class RdfSerializer extends WriterSerializer implements RdfCommon {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Detect namespace usage before serialization.
*
@@ -154,7 +154,7 @@ public class RdfSerializer extends WriterSerializer implements RdfCommon {
/**
* Configuration property: Default namespaces.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"RdfSerializer.namespaces.ls"</js>
* <li><b>Data type:</b> <code>List<String></code> (serialized {@link Namespace} objects)
@@ -170,7 +170,7 @@ public class RdfSerializer extends WriterSerializer implements RdfCommon {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* The default list of namespaces associated with this serializer.
*/
http://git-wip-us.apache.org/repos/asf/juneau/blob/0ab0b231/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanContext.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanContext.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanContext.java
index 230be65..ae50c93 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanContext.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanContext.java
@@ -151,7 +151,7 @@ public class BeanContext extends Context {
/**
* Configuration property: Minimum bean class visibility.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"BeanContext.beanClassVisibility.s"</js>
* <li><b>Data type:</b> <code>String</code> ({@link Visibility})
@@ -163,7 +163,7 @@ public class BeanContext extends Context {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Classes are not considered beans unless they meet the minimum visibility requirements.
*
@@ -172,8 +172,8 @@ public class BeanContext extends Context {
* will not be interpreted as a bean class and be serialized as a string.
* <br>Use this setting to reduce the visibility requirement.
*
- * <h5 class='section'>Example:</h5>
- * <p class='bcode'>
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode'>
* <jc>// Create a serializer that serializes protected classes.</jc>
* WriterSerializer s = JsonSerializer
* .<jsm>create</jsm>()
@@ -185,14 +185,14 @@ public class BeanContext extends Context {
* .<jsm>create</jsm>()
* .set(<jsf>BEAN_beanClassVisibility</jsf>, <js>"PROTECTED"</js>)
* .build();
- * </p>
+ * </p>
*/
public static final String BEAN_beanClassVisibility = PREFIX + "beanClassVisibility.s";
/**
* Configuration property: Minimum bean constructor visibility.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"BeanContext.beanConstructorVisibility.s"</js>
* <li><b>Data type:</b> <code>String</code> ({@link Visibility})
@@ -204,7 +204,7 @@ public class BeanContext extends Context {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Only look for constructors with the specified minimum visibility.
*
@@ -213,8 +213,8 @@ public class BeanContext extends Context {
* <br>Normally, only <jk>public</jk> no-arg constructors are used.
* <br>Use this setting if you want to reduce the visibility requirement.
*
- * <h5 class='section'>Example:</h5>
- * <p class='bcode'>
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode'>
* <jc>// Create a serializer that looks for protected no-arg constructors.</jc>
* WriterSerializer s = JsonSerializer
* .<jsm>create</jsm>()
@@ -226,14 +226,14 @@ public class BeanContext extends Context {
* .<jsm>create</jsm>()
* .set(<jsf>BEAN_beanConstructorVisibility</jsf>, <js>"PROTECTED"</js>)
* .build();
- * </p>
+ * </p>
*/
public static final String BEAN_beanConstructorVisibility = PREFIX + "beanConstructorVisibility.s";
/**
* Configuration property: Bean dictionary.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"BeanContext.beanDictionary.lc"</js>
* <li><b>Data type:</b> <code>List<Class></code>
@@ -254,7 +254,7 @@ public class BeanContext extends Context {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* The list of classes that make up the bean dictionary in this bean context.
*
@@ -270,15 +270,15 @@ public class BeanContext extends Context {
*
* <p>
* Values can consist of any of the following types:
- * <ul>
+ * <ul>
* <li>Any bean class that specifies a value for {@link Bean#typeName() @Bean.typeName()}.
* <li>Any subclass of {@link BeanDictionaryList} containing a collection of bean classes with type name annotations.
* <li>Any subclass of {@link BeanDictionaryMap} containing a mapping of type names to classes without type name annotations.
* <li>Any array or collection of the objects above.
* </ul>
*
- * <h5 class='section'>Example:</h5>
- * <p class='bcode'>
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode'>
* <jc>// Create a parser and tell it which classes to try to resolve.</jc>
* ReaderParser p = JsonParser
* .<jsm>create</jsm>()
@@ -304,10 +304,10 @@ public class BeanContext extends Context {
* .build();
* </p>
*
- * <h5 class='section'>Documentation:</h5>
- * <ul>
- * <li><a class="doclink" href="../../../overview-summary.html#juneau-marshall.BeanDictionaries">Overview > Bean Names and Dictionaries</a>
- * </ul>
+ * <h5 class='section'>Documentation:</h5>
+ * <ul>
+ * <li><a class="doclink" href="../../../overview-summary.html#juneau-marshall.BeanDictionaries">Overview > Bean Names and Dictionaries</a>
+ * </ul>
*/
public static final String BEAN_beanDictionary = PREFIX + "beanDictionary.lc";
@@ -324,7 +324,7 @@ public class BeanContext extends Context {
/**
* Configuration property: Minimum bean field visibility.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"BeanContext.beanFieldVisibility.s"</js>
* <li><b>Data type:</b> <code>String</code> ({@link Visibility})
@@ -336,7 +336,7 @@ public class BeanContext extends Context {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Only look for bean fields with the specified minimum visibility.
*
@@ -345,8 +345,8 @@ public class BeanContext extends Context {
* <br>Normally only <jk>public</jk> fields are considered.
* <br>Use this setting if you want to reduce the visibility requirement.
*
- * <h5 class='section'>Example:</h5>
- * <p class='bcode'>
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode'>
* <jc>// Create a serializer that looks for protected fields.</jc>
* WriterSerializer s = JsonSerializer
* .<jsm>create</jsm>()
@@ -364,14 +364,14 @@ public class BeanContext extends Context {
* .<jsm>create</jsm>()
* .beanFieldVisibility(<jsf>NONE</jsf>)
* .build();
- * </p>
+ * </p>
*/
public static final String BEAN_beanFieldVisibility = PREFIX + "beanFieldVisibility.s";
/**
* Configuration property: Bean filters.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"BeanContext.beanFilters.lc"</js>
* <li><b>Data type:</b> <code>List<Class></code>
@@ -386,7 +386,7 @@ public class BeanContext extends Context {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* This is a programmatic equivalent to the {@link Bean @Bean} annotation.
* <br>It's useful when you want to use the <code>@Bean</code> annotation functionality, but you don't have the ability to alter
@@ -404,7 +404,7 @@ public class BeanContext extends Context {
* <li>Any array or collection of the objects above.
* </ul>
*
- * <h5 class='section'>Example:</h5>
+ * <h5 class='section'>Example:</h5>
* <p class='bcode'>
* <jc>// Create a bean filter for the MyBean class.</jc>
* <jk>public class</jk> MyBeanFilter <jk>extends</jk> BeanFilterBuilder<MyBean> {
@@ -428,11 +428,11 @@ public class BeanContext extends Context {
* .build();
* </p>
*
- * <h5 class='section'>Documentation:</h5>
- * <ul>
- * <li><a class="doclink" href="../../../overview-summary.html#juneau-marshall.BeanFilters">Overview > BeanFilters</a>
- * <li><a class="doclink" href="../../../overview-summary.html#juneau-marshall.StopClasses">Overview > Stop Classes</a>
- * </ul>
+ * <h5 class='section'>Documentation:</h5>
+ * <ul>
+ * <li><a class="doclink" href="../../../overview-summary.html#juneau-marshall.BeanFilters">Overview > BeanFilters</a>
+ * <li><a class="doclink" href="../../../overview-summary.html#juneau-marshall.InterfaceFilters">Overview > Interface Filters</a>
+ * </ul>
*/
public static final String BEAN_beanFilters = PREFIX + "beanFilters.lc";
@@ -449,7 +449,7 @@ public class BeanContext extends Context {
/**
* Configuration property: BeanMap.put() returns old property value.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"BeanContext.beanMapPutReturnsOldValue.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -462,7 +462,7 @@ public class BeanContext extends Context {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
*
* <p>
* If <jk>true</jk>, then the {@link BeanMap#put(String,Object) BeanMap.put()} method will return old property
@@ -470,10 +470,10 @@ public class BeanContext extends Context {
* <br>Otherwise, it returns <jk>null</jk>.
*
* <p>
- * Disabled by default because it introduces a slight performance penalty during serilalization.
+ * Disabled by default because it introduces a slight performance penalty during serialization.
*
- * <h5 class='section'>Example:</h5>
- * <p class='bcode'>
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode'>
* <jc>// Create a serializer that creates BeanMaps with normal put() behavior.</jc>
* WriterSerializer s = JsonSerializer
* .<jsm>create</jsm>()
@@ -489,14 +489,14 @@ public class BeanContext extends Context {
* BeanMap<MyBean> bm = s.createSession().toBeanMap(<jk>new</jk> MyBean());
* bm.put(<js>"foo"</js>, <js>"bar"</js>);
* Object oldValue = bm.put(<js>"foo"</js>, <js>"baz"</js>); <jc>// oldValue == "bar"</jc>
- * </p>
+ * </p>
*/
public static final String BEAN_beanMapPutReturnsOldValue = PREFIX + "beanMapPutReturnsOldValue.b";
/**
* Configuration property: Minimum bean method visibility.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"BeanContext.beanMethodVisibility.s"</js>
* <li><b>Data type:</b> <code>String</code> ({@link Visibility})
@@ -508,7 +508,7 @@ public class BeanContext extends Context {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Only look for bean methods with the specified minimum visibility.
*
@@ -517,8 +517,8 @@ public class BeanContext extends Context {
* <br>Normally only <jk>public</jk> getters and setters are considered.
* <br>Use this setting if you want to reduce the visibility requirement.
*
- * <h5 class='section'>Example:</h5>
- * <p class='bcode'>
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode'>
* <jc>// Create a serializer that looks for protected getters and setters.</jc>
* WriterSerializer s = JsonSerializer
* .<jsm>create</jsm>()
@@ -530,14 +530,14 @@ public class BeanContext extends Context {
* .<jsm>create</jsm>()
* .set(<jsf>BEAN_beanMethodVisibility</jsf>, <js>"PROTECTED"</js>)
* .build();
- * </p>
+ * </p>
*/
public static final String BEAN_beanMethodVisibility = PREFIX + "beanMethodVisibility.s";
/**
* Configuration property: Beans require no-arg constructors.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"BeanContext.beansRequireDefaultConstructor.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -550,7 +550,7 @@ public class BeanContext extends Context {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* If <jk>true</jk>, a Java class must implement a default no-arg constructor to be considered a bean.
* <br>Otherwise, the bean will be serialized as a string using the {@link Object#toString()} method.
@@ -558,8 +558,8 @@ public class BeanContext extends Context {
* <p>
* The {@link Bean @Bean} annotation can be used on a class to override this setting when <jk>true</jk>.
*
- * <h5 class='section'>Example:</h5>
- * <p class='bcode'>
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode'>
* <jc>// Create a serializer that ignores beans without default constructors.</jc>
* WriterSerializer s = JsonSerializer
* .<jsm>create</jsm>()
@@ -571,14 +571,14 @@ public class BeanContext extends Context {
* .<jsm>create</jsm>()
* .set(<jsf>BEAN_beansRequireDefaultConstructor</jsf>, <jk>true</jk>)
* .build();
- * </p>
+ * </p>
*/
public static final String BEAN_beansRequireDefaultConstructor = PREFIX + "beansRequireDefaultConstructor.b";
/**
* Configuration property: Beans require Serializable interface.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"BeanContext.beansRequireSerializable.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -591,7 +591,7 @@ public class BeanContext extends Context {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* If <jk>true</jk>, a Java class must implement the {@link Serializable} interface to be considered a bean.
* <br>Otherwise, the bean will be serialized as a string using the {@link Object#toString()} method.
@@ -599,8 +599,8 @@ public class BeanContext extends Context {
* <p>
* The {@link Bean @Bean} annotation can be used on a class to override this setting when <jk>true</jk>.
*
- * <h5 class='section'>Example:</h5>
- * <p class='bcode'>
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode'>
* <jc>// Create a serializer that ignores beans not implementing Serializable.</jc>
* WriterSerializer s = JsonSerializer
* .<jsm>create</jsm>()
@@ -612,14 +612,14 @@ public class BeanContext extends Context {
* .<jsm>create</jsm>()
* .set(<jsf>BEAN_beansRequireSerializable</jsf>, <jk>true</jk>)
* .build();
- * </p>
+ * </p>
*/
public static final String BEAN_beansRequireSerializable = PREFIX + "beansRequireSerializable.b";
/**
* Configuration property: Beans require setters for getters.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"BeanContext.beansRequireSettersForGetters.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -632,13 +632,13 @@ public class BeanContext extends Context {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* If <jk>true</jk>, only getters that have equivalent setters will be considered as properties on a bean.
* <br>Otherwise, they will be ignored.
*
- * <h5 class='section'>Example:</h5>
- * <p class='bcode'>
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode'>
* <jc>// Create a serializer that ignores bean properties without setters.</jc>
* WriterSerializer s = JsonSerializer
* .<jsm>create</jsm>()
@@ -650,14 +650,14 @@ public class BeanContext extends Context {
* .<jsm>create</jsm>()
* .set(<jsf>BEAN_beansRequireSettersForGetters</jsf>, <jk>true</jk>)
* .build();
- * </p>
+ * </p>
*/
public static final String BEAN_beansRequireSettersForGetters = PREFIX + "beansRequireSettersForGetters.b";
/**
* Configuration property: Beans require at least one property.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"BeanContext.beansRequireSomeProperties.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -669,7 +669,7 @@ public class BeanContext extends Context {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* If <jk>true</jk>, then a Java class must contain at least 1 property to be considered a bean.
* <br>Otherwise, the bean will be serialized as a string using the {@link Object#toString()} method.
@@ -677,8 +677,8 @@ public class BeanContext extends Context {
* <p>
* The {@link Bean @Bean} annotation can be used on a class to override this setting when <jk>true</jk>.
*
- * <h5 class='section'>Example:</h5>
- * <p class='bcode'>
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode'>
* <jc>// Create a serializer that serializes beans even if they have zero properties.</jc>
* WriterSerializer s = JsonSerializer
* .<jsm>create</jsm>()
@@ -690,14 +690,14 @@ public class BeanContext extends Context {
* .<jsm>create</jsm>()
* .set(<jsf>BEAN_beansRequireSomeProperties</jsf>, <jk>false</jk>)
* .build();
- * </p>
+ * </p>
*/
public static final String BEAN_beansRequireSomeProperties = PREFIX + "beansRequireSomeProperties.b";
/**
* Configuration property: Bean type property name.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"BeanContext.beanTypePropertyName.s"</js>
* <li><b>Data type:</b> <code>String</code>
@@ -717,8 +717,8 @@ public class BeanContext extends Context {
* This specifies the name of the bean property used to store the dictionary name of a bean type so that the
* parser knows the data type to reconstruct.
*
- * <h5 class='section'>Example:</h5>
- * <p class='bcode'>
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode'>
* <jc>// Create a serializer that uses 'type' instead of '_type' for dictionary names.</jc>
* WriterSerializer s = JsonSerializer
* .<jsm>create</jsm>()
@@ -730,19 +730,19 @@ public class BeanContext extends Context {
* .<jsm>create</jsm>()
* .set(<jsf>BEAN_beanTypePropertyName</jsf>, <js>"type"</js>)
* .build();
- * </p>
+ * </p>
*
- * <h5 class='section'>Documentation:</h5>
- * <ul>
- * <li><a class="doclink" href="../../../overview-summary.html#juneau-marshall.BeanDictionaries">Overview > Bean Names and Dictionaries</a>
- * </ul>
+ * <h5 class='section'>Documentation:</h5>
+ * <ul>
+ * <li><a class="doclink" href="../../../overview-summary.html#juneau-marshall.BeanDictionaries">Overview > Bean Names and Dictionaries</a>
+ * </ul>
*/
public static final String BEAN_beanTypePropertyName = PREFIX + "beanTypePropertyName.s";
/**
* Configuration property: Debug mode.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"BeanContext.debug.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -755,7 +755,7 @@ public class BeanContext extends Context {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Enables the following additional information during serialization:
* <ul class='spaced-list'>
@@ -774,8 +774,8 @@ public class BeanContext extends Context {
* in order to determine how that method was invoked.
* </ul>
*
- * <h5 class='section'>Example:</h5>
- * <p class='bcode'>
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode'>
* <jc>// Create a serializer with debug enabled.</jc>
* WriterSerializer s = JsonSerializer
* .<jsm>create</jsm>()
@@ -787,14 +787,14 @@ public class BeanContext extends Context {
* .<jsm>create</jsm>()
* .set(<jsf>BEAN_debug</jsf>, <jk>true</jk>)
* .build();
- * </p>
+ * </p>
*/
public static final String BEAN_debug = PREFIX + "debug.b";
/**
* Configuration property: Bean property excludes.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"BeanContext.excludeProperties.sms"</js>
* <li><b>Data type:</b> <code>Map<String,String></code>
@@ -813,7 +813,7 @@ public class BeanContext extends Context {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Specifies to exclude the specified list of properties for the specified bean class.
*
@@ -829,8 +829,8 @@ public class BeanContext extends Context {
* <p>
* Setting applies to specified class and all subclasses.
*
- * <h5 class='section'>Example:</h5>
- * <p class='bcode'>
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode'>
* <jc>// Create a serializer that excludes the 'foo' and 'bar' properties on the MyBean class.</jc>
* WriterSerializer s = JsonSerializer
* .<jsm>create</jsm>()
@@ -848,14 +848,14 @@ public class BeanContext extends Context {
* .<jsm>create</jsm>()
* .addTo(<jsf>BEAN_excludeProperties</jsf>, <js>"{'org.apache.MyBean':'foo,bar'}"</js>)
* .build();
- * </p>
+ * </p>
*/
public static final String BEAN_excludeProperties = PREFIX + "excludeProperties.sms";
/**
* Configuration property: Ignore invocation errors on getters.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"BeanContext.ignoreInvocationExceptionsOnGetters.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -868,13 +868,13 @@ public class BeanContext extends Context {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* If <jk>true</jk>, errors thrown when calling bean getter methods will silently be ignored.
* <br>Otherwise, a {@code BeanRuntimeException} is thrown.
*
- * <h5 class='section'>Example:</h5>
- * <p class='bcode'>
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode'>
* <jc>// Create a serializer that ignores bean getter exceptions.</jc>
* WriterSerializer s = JsonSerializer
* .<jsm>create</jsm>()
@@ -886,14 +886,14 @@ public class BeanContext extends Context {
* .<jsm>create</jsm>()
* .set(<jsf>BEAN_ignoreInvocationExceptionsOnGetters</jsf>, <jk>true</jk>)
* .build();
- * </p>
+ * </p>
*/
public static final String BEAN_ignoreInvocationExceptionsOnGetters = PREFIX + "ignoreInvocationExceptionsOnGetters.b";
/**
* Configuration property: Ignore invocation errors on setters.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"BeanContext.ignoreInvocationExceptionsOnSetters.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -906,13 +906,13 @@ public class BeanContext extends Context {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* If <jk>true</jk>, errors thrown when calling bean setter methods will silently be ignored.
* <br>Otherwise, a {@code BeanRuntimeException} is thrown.
*
- * <h5 class='section'>Example:</h5>
- * <p class='bcode'>
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode'>
* <jc>// Create a parser that ignores bean setter exceptions.</jc>
* ReaderParser p = JsonParser
* .<jsm>create</jsm>()
@@ -924,14 +924,14 @@ public class BeanContext extends Context {
* .<jsm>create</jsm>()
* .set(<jsf>BEAN_ignoreInvocationExceptionsOnSetters</jsf>, <jk>true</jk>)
* .build();
- * </p>
+ * </p>
*/
public static final String BEAN_ignoreInvocationExceptionsOnSetters = PREFIX + "ignoreInvocationExceptionsOnSetters.b";
/**
* Configuration property: Ignore properties without setters.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"BeanContext.ignorePropertiesWithoutSetters.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -943,13 +943,13 @@ public class BeanContext extends Context {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* If <jk>true</jk>, trying to set a value on a bean property without a setter will silently be ignored.
* <br>Otherwise, a {@code RuntimeException} is thrown.
*
- * <h5 class='section'>Example:</h5>
- * <p class='bcode'>
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode'>
* <jc>// Create a parser that throws an exception if a setter is not found but a getter is.</jc>
* ReaderParser p = JsonParser
* .<jsm>create</jsm>()
@@ -961,14 +961,14 @@ public class BeanContext extends Context {
* .<jsm>create</jsm>()
* .set(<jsf>BEAN_ignorePropertiesWithoutSetters</jsf>, <jk>false</jk>)
* .build();
- * </p>
+ * </p>
*/
public static final String BEAN_ignorePropertiesWithoutSetters = PREFIX + "ignorePropertiesWithoutSetters.b";
/**
* Configuration property: Ignore unknown properties.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"BeanContext.ignoreUnknownBeanProperties.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -981,13 +981,13 @@ public class BeanContext extends Context {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* If <jk>true</jk>, trying to set a value on a non-existent bean property will silently be ignored.
* <br>Otherwise, a {@code RuntimeException} is thrown.
*
- * <h5 class='section'>Example:</h5>
- * <p class='bcode'>
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode'>
* <jc>// Create a parser that ignores missing bean properties.</jc>
* ReaderParser p = JsonParser
* .<jsm>create</jsm>()
@@ -999,14 +999,14 @@ public class BeanContext extends Context {
* .<jsm>create</jsm>()
* .set(<jsf>BEAN_ignoreUnknownBeanProperties</jsf>, <jk>true</jk>)
* .build();
- * </p>
+ * </p>
*/
public static final String BEAN_ignoreUnknownBeanProperties = PREFIX + "ignoreUnknownBeanProperties.b";
/**
* Configuration property: Ignore unknown properties with null values.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"BeanContext.ignoreUnknownNullBeanProperties.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -1018,13 +1018,13 @@ public class BeanContext extends Context {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* If <jk>true</jk>, trying to set a <jk>null</jk> value on a non-existent bean property will silently be ignored.
* <br>Otherwise, a {@code RuntimeException} is thrown.
*
- * <h5 class='section'>Example:</h5>
- * <p class='bcode'>
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode'>
* <jc>// Create a parser that throws an exception on an unknown property even if the value being set is null.</jc>
* ReaderParser p = JsonParser
* .<jsm>create</jsm>()
@@ -1036,14 +1036,14 @@ public class BeanContext extends Context {
* .<jsm>create</jsm>()
* .set(<jsf>BEAN_ignoreUnknownNullBeanProperties</jsf>, <jk>false</jk>)
* .build();
- * </p>
+ * </p>
*/
public static final String BEAN_ignoreUnknownNullBeanProperties = PREFIX + "ignoreUnknownNullBeanProperties.b";
/**
* Configuration property: Implementation classes.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"BeanContext.implClasses.smc"</js>
* <li><b>Data type:</b> <code>Map<String,Class></code>
@@ -1056,14 +1056,14 @@ public class BeanContext extends Context {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* 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).
*
- * <h5 class='section'>Example:</h5>
- * <p class='bcode'>
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode'>
* <jc>// Create a parser that instantiates MyBeanImpls when parsing MyBeanInterfaces.</jc>
* ReaderParser p = JsonParser
* .<jsm>create</jsm>()
@@ -1075,14 +1075,14 @@ public class BeanContext extends Context {
* .<jsm>create</jsm>()
* .addTo(<jsf>BEAN_implClasses</jsf>, MyBeanInterface.<jk>class</jk>.getName(), MyBeanImpl.<jk>class</jk>)
* .build();
- * </p>
+ * </p>
*/
public static final String BEAN_implClasses = PREFIX + "implClasses.smc";
/**
* Configuration property: Bean property includes.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"BeanContext.properties.sms"</js>
* <li><b>Data type:</b> <code>Map<String,String></code>
@@ -1098,17 +1098,17 @@ public class BeanContext extends Context {
* <li class='jm'>{@link BeanContextBuilder#includeProperties(Class, String)}
* <li class='jm'>{@link BeanContextBuilder#includeProperties(String, String)}
* <li class='jm'>{@link BeanContextBuilder#includeProperties(Map)}
- * <li class='jm'>{@link BeanFilterBuilder#includeProperties(String...)}
+ * <li class='jm'>{@link BeanFilterBuilder#properties(String...)}
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Specifies the set and order of names of properties associated with the bean class.
*
* <p>
* The keys are either fully-qualified or simple class names, and the values are comma-delimited lists of property
- * names.
+ * names.
* The key <js>"*"</js> means all bean classes.
*
* <p>
@@ -1118,8 +1118,8 @@ public class BeanContext extends Context {
* <p>
* Setting applies to specified class and all subclasses.
*
- * <h5 class='section'>Example:</h5>
- * <p class='bcode'>
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode'>
* <jc>// Create a serializer that includes only the 'foo' and 'bar' properties on the MyBean class.</jc>
* WriterSerializer s = JsonSerializer
* .<jsm>create</jsm>()
@@ -1137,14 +1137,14 @@ public class BeanContext extends Context {
* .<jsm>create</jsm>()
* .addTo(<jsf>BEAN_includeProperties</jsf>, <js>"{'org.apache.MyBean':'foo,bar'}"</js>)
* .build();
- * </p>
+ * </p>
*/
- public static final String BEAN_includeProperties = PREFIX + "properties.sms";
+ public static final String BEAN_includeProperties = PREFIX + "includeProperties.sms";
/**
* Configuration property: Locale.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"BeanContext.locale.s"</js>
* <li><b>Data type:</b> <code>String</code> ({@link Locale})
@@ -1153,11 +1153,12 @@ public class BeanContext extends Context {
* <li><b>Methods:</b>
* <ul>
* <li class='jm'>{@link BeanContextBuilder#locale(Locale)}
+ * <li class='jm'>{@link BeanSessionArgs#locale(Locale)}
* </ul>
* </ul>
*
- * <h5 class='section'>Example:</h5>
- * <p class='bcode'>
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode'>
* <jc>// Create a serializer that uses the specified locale if it's not passed in through session args.</jc>
* WriterSerializer s = JsonSerializer
* .<jsm>create</jsm>()
@@ -1169,14 +1170,20 @@ public class BeanContext extends Context {
* .<jsm>create</jsm>()
* .set(<jsf>BEAN_locale</jsf>, Locale.<jsf>UK</jsf>)
* .build();
- * </p>
+ *
+ * <jc>// Define on session-args instead.</jc>
+ * SerializerSessionArgs sessionArgs = <jk>new</jk> SerializerSessionArgs().locale(Locale.<jsf>UK</jsf>);
+ * <jk>try</jk> (WriterSerializerSession session = s.createSession(sessionArgs)) {
+ * ...
+ * }
+ * </p>
*/
public static final String BEAN_locale = PREFIX + "locale.s";
/**
* Configuration property: Media type.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"BeanContext.mediaType.s"</js>
* <li><b>Data type:</b> <code>String</code> ({@link MediaType})
@@ -1185,15 +1192,16 @@ public class BeanContext extends Context {
* <li><b>Methods:</b>
* <ul>
* <li class='jm'>{@link BeanContextBuilder#mediaType(MediaType)}
+ * <li class='jm'>{@link BeanSessionArgs#mediaType(MediaType)}
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Specifies a default media type value for serializer and parser sessions.
*
- * <h5 class='section'>Example:</h5>
- * <p class='bcode'>
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode'>
* <jc>// Create a serializer that uses the specified media type if it's not passed in through session args.</jc>
* WriterSerializer s = JsonSerializer
* .<jsm>create</jsm>()
@@ -1205,14 +1213,20 @@ public class BeanContext extends Context {
* .<jsm>create</jsm>()
* .set(<jsf>BEAN_mediaType</jsf>, MediaType.<jsf>JSON</jsf>)
* .build();
- * </p>
+ *
+ * <jc>// Define on session-args instead.</jc>
+ * SerializerSessionArgs sessionArgs = <jk>new</jk> SerializerSessionArgs().mediaType(MediaType.<jsf>JSON</jsf>);
+ * <jk>try</jk> (WriterSerializerSession session = s.createSession(sessionArgs)) {
+ * ...
+ * }
+ * </p>
*/
public static final String BEAN_mediaType = PREFIX + "mediaType.s";
/**
* Configuration property: Bean class exclusions.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"BeanContext.notBeanClasses.sc"</js>
* <li><b>Data type:</b> <code>Set<Class></code>
@@ -1231,13 +1245,20 @@ public class BeanContext extends Context {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
- * Not-bean classes are converted to <code>Strings</code> during serialization even if they appear to be
- * bean-like.
+ * List of classes that should not be treated as beans even if they appear to be bean-like.
+ * <br>Not-bean classes are converted to <code>Strings</code> during serialization.
+ *
+ * <p>
+ * Values can consist of any of the following types:
+ * <ul>
+ * <li>Classes.
+ * <li>Arrays and collections of classes.
+ * </ul>
*
- * <h5 class='section'>Example:</h5>
- * <p class='bcode'>
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode'>
* <jc>// Create a serializer that doesn't treat MyBean as a bean class.</jc>
* WriterSerializer s = JsonSerializer
* .<jsm>create</jsm>()
@@ -1249,7 +1270,7 @@ public class BeanContext extends Context {
* .<jsm>create</jsm>()
* .addTo(<jsf>BEAN_notBeanClasses</jsf>, MyBean.<jk>class</jk>)
* .build();
- * </p>
+ * </p>
*/
public static final String BEAN_notBeanClasses = PREFIX + "notBeanClasses.sc";
@@ -1266,7 +1287,7 @@ public class BeanContext extends Context {
/**
* Configuration property: Bean package exclusions.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"BeanContext.notBeanPackages.ss"</js>
* <li><b>Data type:</b> <code>Set<String></code>
@@ -1291,7 +1312,7 @@ public class BeanContext extends Context {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* When specified, the current list of ignore packages are appended to.
*
@@ -1301,8 +1322,15 @@ public class BeanContext extends Context {
* <p>
* Note that you can specify suffix patterns to include all subpackages.
*
- * <h5 class='section'>Example:</h5>
- * <p class='bcode'>
+ * <p>
+ * Values can consist of any of the following types:
+ * <ul>
+ * <li>Strings.
+ * <li>Arrays and collections of strings.
+ * </ul>
+ *
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode'>
* <jc>// Create a serializer that ignores beans in the specified packages.</jc>
* WriterSerializer s = JsonSerializer
* .<jsm>create</jsm>()
@@ -1315,7 +1343,7 @@ public class BeanContext extends Context {
* .addTo(<jsf>BEAN_notBeanPackages</jsf>, <js>"org.apache.foo"</js>)
* .addTo(<jsf>BEAN_notBeanPackages</jsf>, <js>"org.apache.bar.*"</js>)
* .build();
- * </p>
+ * </p>
*/
public static final String BEAN_notBeanPackages = PREFIX + "notBeanPackages.ss";
@@ -1332,7 +1360,7 @@ public class BeanContext extends Context {
/**
* Configuration property: POJO swaps.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"BeanContext.pojoSwaps.lc"</js>
* <li><b>Data type:</b> <code>List<Class></code>
@@ -1352,7 +1380,7 @@ public class BeanContext extends Context {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* POJO swaps are used to "swap out" non-serializable classes with serializable equivalents during serialization,
* and "swap in" the non-serializable class during parsing.
@@ -1373,7 +1401,7 @@ public class BeanContext extends Context {
* <li>Any array or collection of the objects above.
* </ul>
*
- * <h5 class='section'>Example:</h5>
+ * <h5 class='section'>Example:</h5>
* <p class='bcode'>
* <jc>// Sample swap for converting Dates to ISO8601 strings.</jc>
* <jk>public class</jk> MyDateSwap <jk>extends</jk> StringSwap<Date> {
@@ -1421,15 +1449,15 @@ public class BeanContext extends Context {
* MyBean bean = p.parse(json, MyBean.<jk>class</jk>);
* </p>
*
- * <h5 class='section'>Documentation:</h5>
- * <ul>
- * <li><a class="doclink" href="../../../overview-summary.html#juneau-marshall.PojoSwaps">Overview > PojoSwaps</a>
- * <li><a class="doclink" href="../../../overview-summary.html#juneau-marshall.PerMediaTypePojoSwaps">Overview > Per-media-type PojoSwaps</a>
- * <li><a class="doclink" href="../../../overview-summary.html#juneau-marshall.OneWayPojoSwaps">Overview > One-way PojoSwaps</a>
- * <li><a class="doclink" href="../../../overview-summary.html#juneau-marshall.SwapAnnotation">Overview > @Swap Annotation</a>
- * <li><a class="doclink" href="../../../overview-summary.html#juneau-marshall.SwapMethods">Overview > Swap Methods</a>
- * <li><a class="doclink" href="../../../overview-summary.html#juneau-marshall.SurrogateClasses">Overview > Surrogate Classes</a>
- * </ul>
+ * <h5 class='section'>Documentation:</h5>
+ * <ul>
+ * <li><a class="doclink" href="../../../overview-summary.html#juneau-marshall.PojoSwaps">Overview > PojoSwaps</a>
+ * <li><a class="doclink" href="../../../overview-summary.html#juneau-marshall.PerMediaTypePojoSwaps">Overview > Per-media-type PojoSwaps</a>
+ * <li><a class="doclink" href="../../../overview-summary.html#juneau-marshall.OneWayPojoSwaps">Overview > One-way PojoSwaps</a>
+ * <li><a class="doclink" href="../../../overview-summary.html#juneau-marshall.SwapAnnotation">Overview > @Swap Annotation</a>
+ * <li><a class="doclink" href="../../../overview-summary.html#juneau-marshall.SwapMethods">Overview > Swap Methods</a>
+ * <li><a class="doclink" href="../../../overview-summary.html#juneau-marshall.SurrogateClasses">Overview > Surrogate Classes</a>
+ * </ul>
*/
public static final String BEAN_pojoSwaps = PREFIX + "pojoSwaps.lc";
@@ -1446,7 +1474,7 @@ public class BeanContext extends Context {
/**
* Configuration property: Bean property namer.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"BeanContext.propertyNamer.c"</js>
* <li><b>Data type:</b> <code>Class<? <jk>implements</jk> {@link PropertyNamer}></code>
@@ -1463,7 +1491,7 @@ public class BeanContext extends Context {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* The class to use for calculating bean property names.
*
@@ -1496,7 +1524,7 @@ public class BeanContext extends Context {
/**
* Configuration property: Sort bean properties.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"BeanContext.sortProperties.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -1515,7 +1543,7 @@ public class BeanContext extends Context {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* When <jk>true</jk>, all bean properties will be serialized and access in alphabetical order.
* <br>Otherwise, the natural order of the bean properties is used which is dependent on the JVM vendor.
@@ -1547,7 +1575,7 @@ public class BeanContext extends Context {
/**
* Configuration property: TimeZone.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"BeanContext.timeZone.s"</js>
* <li><b>Data type:</b> <code>String</code> ({@link TimeZone})
@@ -1556,6 +1584,7 @@ public class BeanContext extends Context {
* <li><b>Methods:</b>
* <ul>
* <li class='jm'>{@link BeanContextBuilder#timeZone(TimeZone)}
+ * <li class='jm'>{@link BeanSessionArgs#timeZone(TimeZone)}
* </ul>
* </ul>
*
@@ -1572,6 +1601,12 @@ public class BeanContext extends Context {
* .<jsm>create</jsm>()
* .set(<jsf>BEAN_timeZone</jsf>, TimeZone.<jsf>GMT</jsf>)
* .build();
+ *
+ * <jc>// Define on session-args instead.</jc>
+ * SerializerSessionArgs sessionArgs = <jk>new</jk> SerializerSessionArgs().timeZone(TimeZone.<jsf>GMT</jsf>);
+ * <jk>try</jk> (WriterSerializerSession ss = JsonSerializer.<jsf>DEFAULT</jsf>.createSession(sessionArgs)) {
+ * String json = s.serialize(<jk>new</jk> MyBean());
+ * }
* </p>
*/
public static final String BEAN_timeZone = PREFIX + "timeZone.s";
@@ -1579,7 +1614,7 @@ public class BeanContext extends Context {
/**
* Configuration property: Use interface proxies.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"BeanContext.useInterfaceProxies.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -1591,7 +1626,7 @@ public class BeanContext extends Context {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* If <jk>true</jk>, then interfaces will be instantiated as proxy classes through the use of an
* {@link InvocationHandler} if there is no other way of instantiating them.
@@ -1617,7 +1652,7 @@ public class BeanContext extends Context {
/**
* Configuration property: Use Java Introspector.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"BeanContext.useJavaBeanIntrospector.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -1630,7 +1665,7 @@ public class BeanContext extends Context {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Using the built-in Java bean introspector will not pick up fields or non-standard getters/setters.
* <br>Most {@link Bean @Bean} annotations will be ignored.
http://git-wip-us.apache.org/repos/asf/juneau/blob/0ab0b231/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanContextBuilder.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanContextBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanContextBuilder.java
index f0620d2..bf815bf 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanContextBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanContextBuilder.java
@@ -21,6 +21,7 @@ import java.util.*;
import org.apache.juneau.annotation.*;
import org.apache.juneau.http.*;
import org.apache.juneau.serializer.*;
+import org.apache.juneau.transform.*;
/**
* Builder class for building instances of serializers, parsers, and bean contexts.
@@ -243,6 +244,13 @@ public class BeanContextBuilder extends ContextBuilder {
*
* @param values
* The values to add to this property.
+ * <br>Values can consist of any of the following types:
+ * <ul>
+ * <li>Any bean class that specifies a value for {@link Bean#typeName() @Bean.typeName()}.
+ * <li>Any subclass of {@link BeanDictionaryList} containing a collection of bean classes with type name annotations.
+ * <li>Any subclass of {@link BeanDictionaryMap} containing a mapping of type names to classes without type name annotations.
+ * <li>Any array or collection of the objects above.
+ * </ul>
* @return This object (for method chaining).
*/
public BeanContextBuilder beanFilters(Object...values) {
@@ -283,6 +291,13 @@ public class BeanContextBuilder extends ContextBuilder {
* If <jk>true</jk>, the previous value is appended to. Otherwise, the previous value is replaced.
* @param values
* The new values for this property.
+ * <br>Values can consist of any of the following types:
+ * <ul>
+ * <li>Any bean class that specifies a value for {@link Bean#typeName() @Bean.typeName()}.
+ * <li>Any subclass of {@link BeanDictionaryList} containing a collection of bean classes with type name annotations.
+ * <li>Any subclass of {@link BeanDictionaryMap} containing a mapping of type names to classes without type name annotations.
+ * <li>Any array or collection of the objects above.
+ * </ul>
* @return This object (for method chaining).
*/
public BeanContextBuilder beanFilters(boolean append, Object...values) {
@@ -302,6 +317,13 @@ public class BeanContextBuilder extends ContextBuilder {
*
* @param values
* The values to remove from this property.
+ * <br>Values can consist of any of the following types:
+ * <ul>
+ * <li>Any bean class that specifies a value for {@link Bean#typeName() @Bean.typeName()}.
+ * <li>Any subclass of {@link BeanDictionaryList} containing a collection of bean classes with type name annotations.
+ * <li>Any subclass of {@link BeanDictionaryMap} containing a mapping of type names to classes without type name annotations.
+ * <li>Any array or collection of the objects above.
+ * </ul>
* @return This object (for method chaining).
*/
public BeanContextBuilder beanFiltersRemove(Object...values) {
@@ -613,7 +635,9 @@ public class BeanContextBuilder extends ContextBuilder {
* <li class='jf'>{@link BeanContext#BEAN_excludeProperties}
* </ul>
*
- * @param beanClassName The bean class name. Can be a simple name, fully-qualified name, or <js>"*"</js>.
+ * @param beanClassName
+ * The bean class name.
+ * <br>Can be a simple name, fully-qualified name, or <js>"*"</js> for all bean classes.
* @param value Comma-delimited list of property names.
* @return This object (for method chaining).
*/
@@ -664,7 +688,7 @@ public class BeanContextBuilder extends ContextBuilder {
*
* <p>
* If <jk>true</jk>, errors thrown when calling bean setter methods will silently be ignored.
- * Otherwise, a {@code BeanRuntimeException} is thrown.
+ * <br>Otherwise, a {@code BeanRuntimeException} is thrown.
*
* <h5 class='section'>See Also:</h5>
* <ul>
@@ -702,7 +726,7 @@ public class BeanContextBuilder extends ContextBuilder {
*
* <p>
* If <jk>true</jk>, trying to set a value on a bean property without a setter will silently be ignored.
- * Otherwise, a {@code BeanRuntimeException} is thrown.
+ * <br>Otherwise, a {@code BeanRuntimeException} is thrown.
*
* <h5 class='section'>See Also:</h5>
* <ul>
@@ -723,7 +747,7 @@ public class BeanContextBuilder extends ContextBuilder {
*
* <p>
* If <jk>true</jk>, trying to set a value on a non-existent bean property will silently be ignored.
- * Otherwise, a {@code BeanRuntimeException} is thrown.
+ * <br>Otherwise, a {@code BeanRuntimeException} is thrown.
*
* <h5 class='section'>See Also:</h5>
* <ul>
@@ -761,7 +785,7 @@ public class BeanContextBuilder extends ContextBuilder {
*
* <p>
* If <jk>true</jk>, trying to set a <jk>null</jk> value on a non-existent bean property will silently be ignored.
- * Otherwise, a {@code BeanRuntimeException} is thrown.
+ * <br>Otherwise, a {@code BeanRuntimeException} is thrown.
*
* <h5 class='section'>See Also:</h5>
* <ul>
@@ -862,7 +886,9 @@ public class BeanContextBuilder extends ContextBuilder {
* <li class='jf'>{@link BeanContext#BEAN_includeProperties}
* </ul>
*
- * @param beanClassName The bean class name. Can be a simple name, fully-qualified name, or <js>"*"</js>.
+ * @param beanClassName
+ * The bean class name.
+ * <br>Can be a simple name, fully-qualified name, or <js>"*"</js> for all beans.
* @param value Comma-delimited list of property names.
* @return This object (for method chaining).
*/
@@ -873,6 +899,9 @@ public class BeanContextBuilder extends ContextBuilder {
/**
* Configuration property: Locale.
*
+ * <p>
+ * Specifies a default locale for serializer and parser sessions.
+ *
* <h5 class='section'>See Also:</h5>
* <ul>
* <li class='jf'>{@link BeanContext#BEAN_locale}
@@ -907,7 +936,7 @@ public class BeanContextBuilder extends ContextBuilder {
* Configuration property: Bean class exclusions.
*
* <p>
- * Not-bean classes are typically converted to <code>Strings</code> during serialization even if they appear to be
+ * Not-bean classes are converted to <code>Strings</code> during serialization even if they appear to be
* bean-like.
*
* <h5 class='section'>See Also:</h5>
@@ -916,8 +945,15 @@ public class BeanContextBuilder extends ContextBuilder {
* </ul>
*
* @param append
- * If <jk>true</jk>, the previous value is appended to. Otherwise, the previous value is replaced.
- * @param values The new value for this property.
+ * If <jk>true</jk>, the previous value is appended to.
+ * <br>Otherwise, the previous value is replaced.
+ * @param values
+ * The new value for this property.
+ * <br>Values can consist of any of the following types:
+ * <ul>
+ * <li>Classes.
+ * <li>Arrays and collections of classes.
+ * </ul>
* @return This object (for method chaining).
*/
public BeanContextBuilder notBeanClasses(boolean append, Object...values) {
@@ -926,7 +962,11 @@ public class BeanContextBuilder extends ContextBuilder {
/**
* Configuration property: Bean class exclusions.
- *
+ *
+ * <p>
+ * List of classes that should not be treated as beans even if they appear to be bean-like.
+ * <br>Not-bean classes are converted to <code>Strings</code> during serialization.
+ *
* <h5 class='section'>See Also:</h5>
* <ul>
* <li class='jf'>{@link BeanContext#BEAN_notBeanClasses}
@@ -941,13 +981,23 @@ public class BeanContextBuilder extends ContextBuilder {
/**
* Configuration property: Bean class exclusions.
+ *
+ * <p>
+ * List of classes that should not be treated as beans even if they appear to be bean-like.
+ * <br>Not-bean classes are converted to <code>Strings</code> during serialization.
*
* <h5 class='section'>See Also:</h5>
* <ul>
* <li class='jf'>{@link BeanContext#BEAN_notBeanClasses}
* </ul>
*
- * @param values The values to add to this property.
+ * @param values
+ * The values to add to this property.
+ * <br>Values can consist of any of the following types:
+ * <ul>
+ * <li>Classes.
+ * <li>Arrays and collections of classes.
+ * </ul>
* @return This object (for method chaining).
*/
public BeanContextBuilder notBeanClasses(Object...values) {
@@ -962,7 +1012,13 @@ public class BeanContextBuilder extends ContextBuilder {
* <li class='jf'>{@link BeanContext#BEAN_notBeanClasses}
* </ul>
*
- * @param values The values to remove from this property.
+ * @param values
+ * The values to remove from this property.
+ * <br>Values can consist of any of the following types:
+ * <ul>
+ * <li>Classes.
+ * <li>Arrays and collections of classes.
+ * </ul>
* @return This object (for method chaining).
*/
public BeanContextBuilder notBeanClassesRemove(Object...values) {
@@ -981,8 +1037,15 @@ public class BeanContextBuilder extends ContextBuilder {
* </ul>
*
* @param append
- * If <jk>true</jk>, the previous value is appended to. Otherwise, the previous value is replaced.
- * @param values The new value for this property.
+ * If <jk>true</jk>, the previous value is appended to.
+ * <br>Otherwise, the previous value is replaced.
+ * @param values
+ * The new values for this property.
+ * <br>Values can consist of any of the following types:
+ * <ul>
+ * <li>Classes.
+ * <li>Arrays and collections of classes.
+ * </ul>
* @return This object (for method chaining).
*/
public BeanContextBuilder notBeanPackages(boolean append, Object...values) {
@@ -997,7 +1060,13 @@ public class BeanContextBuilder extends ContextBuilder {
* <li class='jf'>{@link BeanContext#BEAN_notBeanPackages}
* </ul>
*
- * @param values The values to add to this property.
+ * @param values
+ * The values to add to this property.
+ * <br>Values can consist of any of the following types:
+ * <ul>
+ * <li>Strings.
+ * <li>Arrays and collections of strings.
+ * </ul>
* @return This object (for method chaining).
*/
public BeanContextBuilder notBeanPackages(Object...values) {
@@ -1012,7 +1081,8 @@ public class BeanContextBuilder extends ContextBuilder {
* <li class='jf'>{@link BeanContext#BEAN_notBeanPackages}
* </ul>
*
- * @param values The values to add to this property.
+ * @param values
+ * The values to add to this property.
* @return This object (for method chaining).
*/
public BeanContextBuilder notBeanPackages(String...values) {
@@ -1027,7 +1097,13 @@ public class BeanContextBuilder extends ContextBuilder {
* <li class='jf'>{@link BeanContext#BEAN_notBeanPackages}
* </ul>
*
- * @param values The values to remove from this property.
+ * @param values
+ * <br>Values can consist of any of the following types:
+ * <br>Possible values are:
+ * <ul>
+ * <li>Strings.
+ * <li>Arrays and collections of strings.
+ * </ul>
* @return This object (for method chaining).
*/
public BeanContextBuilder notBeanPackagesRemove(Object...values) {
@@ -1050,8 +1126,15 @@ public class BeanContextBuilder extends ContextBuilder {
* </ul>
*
* @param append
- * If <jk>true</jk>, the previous value is appended to. Otherwise, the previous value is replaced.
- * @param values The new value for this property.
+ * If <jk>true</jk>, the previous value is appended to.
+ * <br>Otherwise, the previous value is replaced.
+ * @param values
+ * The new value for this property.
+ * <br>Values can consist of any of the following types:
+ * <ul>
+ * <li>Strings.
+ * <li>Arrays and collections of strings.
+ * </ul>
* @return This object (for method chaining).
*/
public BeanContextBuilder pojoSwaps(boolean append, Object...values) {
@@ -1081,7 +1164,14 @@ public class BeanContextBuilder extends ContextBuilder {
* <li class='jf'>{@link BeanContext#BEAN_pojoSwaps}
* </ul>
*
- * @param values The values to add to this property.
+ * @param values
+ * The values to add to this property.
+ * <br>Values can consist of any of the following types:
+ * <ul>
+ * <li>Any subclass of {@link PojoSwap}.
+ * <li>Any surrogate class. A shortcut for defining a {@link SurrogateSwap}.
+ * <li>Any array or collection of the objects above.
+ * </ul>
* @return This object (for method chaining).
*/
public BeanContextBuilder pojoSwaps(Object...values) {
@@ -1096,7 +1186,14 @@ public class BeanContextBuilder extends ContextBuilder {
* <li class='jf'>{@link BeanContext#BEAN_pojoSwaps}
* </ul>
*
- * @param values The values to remove from this property.
+ * @param values
+ * The values to remove from this property.
+ * <br>Values can consist of any of the following types:
+ * <ul>
+ * <li>Any subclass of {@link PojoSwap}.
+ * <li>Any surrogate class. A shortcut for defining a {@link SurrogateSwap}.
+ * <li>Any array or collection of the objects above.
+ * </ul>
* @return This object (for method chaining).
*/
public BeanContextBuilder pojoSwapsRemove(Object...values) {
http://git-wip-us.apache.org/repos/asf/juneau/blob/0ab0b231/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanSession.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanSession.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanSession.java
index d7f4707..829e7a5 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanSession.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanSession.java
@@ -248,7 +248,7 @@ public class BeanSession extends Session {
* <br>{@code List<X[]>}
* <br>{@code List[]<X>}
* </td>
- * <td> </td>
+ * <td> </td>
* </tr>
* <tr>
* <td>
@@ -293,7 +293,7 @@ public class BeanSession extends Session {
* <br>
* </td>
* </tr>
- * </table>
+ * </table>
*
* @param <T> The class type to convert the value to.
* @param value The value to be converted.
[2/4] juneau git commit: Update javadocs.
Posted by ja...@apache.org.
http://git-wip-us.apache.org/repos/asf/juneau/blob/0ab0b231/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializerBuilder.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializerBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializerBuilder.java
index 7b5b921..a0b090f 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializerBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializerBuilder.java
@@ -531,6 +531,32 @@ public class SerializerBuilder extends BeanContextBuilder {
}
/**
+ * Configuration property: URI context bean.
+ *
+ * <p>
+ * Same as {@link #uriContext(UriContext)} but allows you to pass in a JSON string.
+ *
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode'>
+ * WriterSerializer s = JsonSerializer
+ * .<jsm>create</jsm>()
+ * .uriContext(<js>"{authority:'http://localhost:10000',contextRoot:'/myContext',servletPath:'/myServlet',pathInfo:'/foo'}"</js>)
+ * .build();
+ * </p>
+ *
+ * <h5 class='section'>See Also:</h5>
+ * <ul>
+ * <li class='jf'>{@link Serializer#SERIALIZER_uriContext}
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ */
+ public SerializerBuilder uriContext(String value) {
+ return set(SERIALIZER_uriContext, value);
+ }
+
+ /**
* Configuration property: URI relativity.
*
* <p>
@@ -551,6 +577,34 @@ public class SerializerBuilder extends BeanContextBuilder {
}
/**
+ * Configuration property: URI relativity.
+ *
+ * <p>
+ * Same as {@link #uriRelativity(UriRelativity)} but allows you to pass in a string.
+ *
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode'>
+ * WriterSerializer s = JsonSerializer
+ * .<jsm>create</jsm>()
+ * .uriRelativity(<js>"PATH_INFO"</js>)
+ * .build();
+ * </p>
+ *
+ * <h5 class='section'>See Also:</h5>
+ * <ul>
+ * <li class='jf'>{@link Serializer#SERIALIZER_uriRelativity}
+ * </ul>
+ *
+ * @param value
+ * The new value for this property.
+ * <br>The default is {@link UriRelativity#RESOURCE}
+ * @return This object (for method chaining).
+ */
+ public SerializerBuilder uriRelativity(String value) {
+ return set(SERIALIZER_uriRelativity, value);
+ }
+
+ /**
* Configuration property: URI resolution.
*
* <p>
@@ -571,6 +625,34 @@ public class SerializerBuilder extends BeanContextBuilder {
}
/**
+ * Configuration property: URI resolution.
+ *
+ * <p>
+ * Same as {@link #uriResolution(UriResolution)} but allows you to pass in a string.
+ *
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode'>
+ * WriterSerializer s = JsonSerializer
+ * .<jsm>create</jsm>()
+ * .uriResolution(<js>"ROOT_RELATIVE"</js>)
+ * .build();
+ * </p>
+ *
+ * <h5 class='section'>See Also:</h5>
+ * <ul>
+ * <li class='jf'>{@link Serializer#SERIALIZER_uriResolution}
+ * </ul>
+ *
+ * @param value
+ * The new value for this property.
+ * <br>The default is {@link UriResolution#NONE}
+ * @return This object (for method chaining).
+ */
+ public SerializerBuilder uriResolution(String value) {
+ return set(SERIALIZER_uriResolution, value);
+ }
+
+ /**
* Configuration property: Use whitespace.
*
* <p>
http://git-wip-us.apache.org/repos/asf/juneau/blob/0ab0b231/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializerSession.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializerSession.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializerSession.java
index c4a1b0e..b55768b 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializerSession.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializerSession.java
@@ -672,7 +672,7 @@ public abstract class SerializerSession extends BeanSession {
* <li><js>"context:/foo"</js> - Context-root-relative URI.
* <li><js>"context:/"</js> - Context-root URI.
* <li><js>"servlet:/foo"</js> - Servlet-path-relative URI.
- * <li><js>"servlet:/"</js> - Servlet-path URI.
+ * <li><js>"servlet:/"</js> - Servlet-path URI.
* <li><js>"request:/foo"</js> - Request-path-relative URI.
* <li><js>"request:/"</js> - Request-path URI.
* <li><js>"foo"</js> - Path-info-relative URI.
@@ -791,8 +791,8 @@ public abstract class SerializerSession extends BeanSession {
*
* @return A map, typically containing something like <code>{line:123,column:456,currentProperty:"foobar"}</code>
*/
- protected final Map<String,Object> getLastLocation() {
- Map<String,Object> m = new LinkedHashMap<>();
+ protected final ObjectMap getLastLocation() {
+ ObjectMap m = new ObjectMap();
if (currentClass != null)
m.put("currentClass", currentClass);
if (currentProperty != null)
@@ -897,4 +897,25 @@ public abstract class SerializerSession extends BeanSession {
public Map<String,String> getResponseHeaders() {
return Collections.emptyMap();
}
+
+
+ /**
+ * Returns the listener associated with this session.
+ *
+ * @return The listener associated with this session, or <jk>null</jk> if there is no listener.
+ */
+ public SerializerListener getListener() {
+ return listener;
+ }
+
+ /**
+ * Returns the listener associated with this session.
+ *
+ * @param c The listener class to cast to.
+ * @return The listener associated with this session, or <jk>null</jk> if there is no listener.
+ */
+ @SuppressWarnings("unchecked")
+ public <T extends SerializerListener> T getListener(Class<T> c) {
+ return (T)listener;
+ }
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/0ab0b231/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializerSessionArgs.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializerSessionArgs.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializerSessionArgs.java
index e1c2928..3edf746 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializerSessionArgs.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializerSessionArgs.java
@@ -26,35 +26,90 @@ import org.apache.juneau.http.*;
*/
public final class SerializerSessionArgs extends BeanSessionArgs {
- final Method javaMethod;
- final UriContext uriContext;
+ Method javaMethod;
+ UriContext uriContext;
+
+ /**
+ * Constructor
+ */
+ public SerializerSessionArgs() {}
/**
* Constructor.
*
* @param properties
* Session-level properties.
- * These override context-level properties.
- * Can be <jk>null</jk>.
+ * <br>These override context-level properties.
+ * <br>Can be <jk>null</jk>.
* @param javaMethod
* The java method that called this serializer, usually the method in a REST servlet.
- * Can be <jk>null</jk>.
+ * <br>Can be <jk>null</jk>.
* @param locale
* The session locale.
- * If <jk>null</jk>, then the locale defined on the context is used.
+ * <br>If <jk>null</jk>, then the locale defined on the context is used.
* @param timeZone
* The session timezone.
- * If <jk>null</jk>, then the timezone defined on the context is used.
+ * <br>If <jk>null</jk>, then the timezone defined on the context is used.
* @param mediaType
* The session media type (e.g. <js>"application/json"</js>).
- * Can be <jk>null</jk>.
+ * <br>Can be <jk>null</jk>.
* @param uriContext
* The URI context.
- * Identifies the current request URI used for resolution of URIs to absolute or root-relative form.
+ * <br>Identifies the current request URI used for resolution of URIs to absolute or root-relative form.
*/
public SerializerSessionArgs(ObjectMap properties, Method javaMethod, Locale locale, TimeZone timeZone, MediaType mediaType, UriContext uriContext) {
super(properties, locale, timeZone, mediaType);
this.javaMethod = javaMethod;
this.uriContext = uriContext;
}
+
+ /**
+ * The java method that called this serializer, usually the method in a REST servlet.
+ *
+ * @param javaMethod
+ * The java method that called this serializer, usually the method in a REST servlet.
+ * <br>Can be <jk>null</jk>.
+ * @return This object (for method chaining).
+ */
+ public SerializerSessionArgs javaMethod(Method javaMethod) {
+ this.javaMethod = javaMethod;
+ return this;
+ }
+
+ /**
+ * The URI context.
+ *
+ * @param uriContext
+ * The URI context.
+ * <br>Identifies the current request URI used for resolution of URIs to absolute or root-relative form.
+ * @return This object (for method chaining).
+ */
+ public SerializerSessionArgs uriContext(UriContext uriContext) {
+ this.uriContext = uriContext;
+ return this;
+ }
+
+ @Override /* BeanSessionArgs */
+ public SerializerSessionArgs locale(Locale locale) {
+ super.locale(locale);
+ return this;
+ }
+
+ @Override /* BeanSessionArgs */
+ public SerializerSessionArgs timeZone(TimeZone timeZone) {
+ super.timeZone(timeZone);
+ return this;
+ }
+
+ @Override /* BeanSessionArgs */
+ public SerializerSessionArgs mediaType(MediaType mediaType) {
+ super.mediaType(mediaType);
+ return this;
+ }
+
+ @Override /* SessionArgs */
+ public SerializerSessionArgs properties(ObjectMap properties) {
+ super.properties(properties);
+ return this;
+ }
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/0ab0b231/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/soap/SoapXmlSerializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/soap/SoapXmlSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/soap/SoapXmlSerializer.java
index 3ba6ce8..e910294 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/soap/SoapXmlSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/soap/SoapXmlSerializer.java
@@ -41,7 +41,7 @@ public final class SoapXmlSerializer extends XmlSerializer {
/**
* Configuration property: The <code>SOAPAction</code> HTTP header value to set on responses.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"SoapXmlSerializer.SOAPAction.s"</js>
* <li><b>Data type:</b> <code>String</code>
http://git-wip-us.apache.org/repos/asf/juneau/blob/0ab0b231/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/transform/AnnotationBeanFilterBuilder.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/transform/AnnotationBeanFilterBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/transform/AnnotationBeanFilterBuilder.java
index 7e56858..b583756 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/transform/AnnotationBeanFilterBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/transform/AnnotationBeanFilterBuilder.java
@@ -45,7 +45,7 @@ public final class AnnotationBeanFilterBuilder<T> extends BeanFilterBuilder<T> {
Bean b = li.previous();
if (! b.properties().isEmpty())
- includeProperties(split(b.properties()));
+ properties(split(b.properties()));
if (! b.typeName().isEmpty())
typeName(b.typeName());
http://git-wip-us.apache.org/repos/asf/juneau/blob/0ab0b231/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/transform/BeanFilterBuilder.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/transform/BeanFilterBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/transform/BeanFilterBuilder.java
index 5ed83f7..54288a6 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/transform/BeanFilterBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/transform/BeanFilterBuilder.java
@@ -50,9 +50,9 @@ import org.apache.juneau.annotation.*;
* </p>
*
* <h6 class='topic'>Documentation</h6>
- * <ul>
- * <li><a class="doclink" href="../../../../overview-summary.html#juneau-marshall.BeanFilters">Overview > BeanFilters</a>
- * </ul>
+ * <ul>
+ *. <li><a class="doclink" href="../../../../overview-summary.html#juneau-marshall.BeanFilters">Overview > BeanFilters</a>
+ *.</ul>
*
* @param <T> The bean type that this filter applies to.
*/
@@ -94,7 +94,7 @@ public class BeanFilterBuilder<T> {
*
* <h5 class='section'>Example:</h5>
* <p class='bcode'>
- * <jc>// Define our filter.</jc>
+ * <jc>// Define our filter.</jc>
* <jk>public class</jk> MyFilter <jk>extends</jk> BeanFilterBuilder<MyBean> {
* <jk>public</jk> MyFilter() {
* typeName(<js>"mybean"</js>);
@@ -160,7 +160,7 @@ public class BeanFilterBuilder<T> {
* <br>Values can contain comma-delimited list of property names.
* @return This object (for method chaining).
*/
- public BeanFilterBuilder<T> includeProperties(String...value) {
+ public BeanFilterBuilder<T> properties(String...value) {
this.includeProperties = value;
return this;
}
@@ -476,8 +476,8 @@ public class BeanFilterBuilder<T> {
* <p>
* The property filter to use for intercepting and altering getter and setter calls.
*
- * <h5 class='section'>Example:</h5>
- * <p class='bcode'>
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode'>
* <jc>// Define our filter.</jc>
* <jk>public class</jk> MyFilter <jk>extends</jk> BeanFilterBuilder<MyBean> {
* <jk>public</jk> MyFilter() {
@@ -491,7 +491,7 @@ public class BeanFilterBuilder<T> {
* .<jsm>create</jsm>()
* .beanFilters(MyFilter.<jk>class</jk>)
* .build();
- * </p>
+ * </p>
*
* <h5 class='section'>See Also:</h5>
* <ul>
http://git-wip-us.apache.org/repos/asf/juneau/blob/0ab0b231/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/transform/InterfaceBeanFilterBuilder.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/transform/InterfaceBeanFilterBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/transform/InterfaceBeanFilterBuilder.java
index ae1eef0..6faff41 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/transform/InterfaceBeanFilterBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/transform/InterfaceBeanFilterBuilder.java
@@ -61,7 +61,7 @@ public class InterfaceBeanFilterBuilder<T> extends BeanFilterBuilder<T> {
Bean b = li.previous();
if (! b.properties().isEmpty())
- includeProperties(split(b.properties()));
+ properties(split(b.properties()));
if (! b.typeName().isEmpty())
typeName(b.typeName());
http://git-wip-us.apache.org/repos/asf/juneau/blob/0ab0b231/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/transform/PojoSwap.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/transform/PojoSwap.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/transform/PojoSwap.java
index 6b6fa1c..4f46c6c 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/transform/PojoSwap.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/transform/PojoSwap.java
@@ -152,9 +152,9 @@ public abstract class PojoSwap<T,S> {
* This method is the programmatic equivalent to the {@link Swap#mediaTypes() @Swap.mediaTypes()} annotation.
*
* <h6 class='topic'>Documentation</h6>
- * <ul>
- * <li><a class="doclink" href="../../../../overview-summary.html#juneau-marshall.PerMediaTypePojoSwaps">Overview > Per-media-type PojoSwaps</a>
- * </ul>
+ * <ul>
+ * <li><a class="doclink" href="../../../../overview-summary.html#juneau-marshall.PerMediaTypePojoSwaps">Overview > Per-media-type PojoSwaps</a>
+ * </ul>
* @return The media types that this swap is applicable to, or <jk>null</jk> if it's applicable for all media types.
*/
public MediaType[] forMediaTypes() {
@@ -173,10 +173,10 @@ public abstract class PojoSwap<T,S> {
* <p>
* This method is the programmatic equivalent to the {@link Swap#template() @Swap.template()} annotation.
*
- * <h5 class='section'>Documentation:</h5>
- * <ul>
- * <li><a class="doclink" href="../../../../overview-summary.html#juneau-marshall.TemplatedSwaps">Overview > Templated Swaps</a>
- * </ul>
+ * <h5 class='section'>Documentation:</h5>
+ * <ul>
+ * <li><a class="doclink" href="../../../../overview-summary.html#juneau-marshall.TemplatedSwaps">Overview > Templated Swaps</a>
+ * </ul>
*
* @return Additional context information, or <jk>null</jk> if not specified.
*/
@@ -188,9 +188,9 @@ public abstract class PojoSwap<T,S> {
* Sets the media types that this swap is associated with.
*
* <h6 class='topic'>Documentation</h6>
- * <ul>
- * <li><a class="doclink" href="../../../../overview-summary.html#juneau-marshall.PerMediaTypePojoSwaps">Overview > Per-media-type PojoSwaps</a>
- * </ul>
+ * <ul>
+ * <li><a class="doclink" href="../../../../overview-summary.html#juneau-marshall.PerMediaTypePojoSwaps">Overview > Per-media-type PojoSwaps</a>
+ * </ul>
*
* @param mediaTypes The media types that this swap is associated with.
* @return This object (for method chaining).
@@ -203,10 +203,10 @@ public abstract class PojoSwap<T,S> {
/**
* Sets the template string on this swap.
*
- * <h5 class='section'>Documentation:</h5>
- * <ul>
- * <li><a class="doclink" href="../../../../overview-summary.html#juneau-marshall.TemplatedSwaps">Overview > Templated Swaps</a>
- * </ul>
+ * <h5 class='section'>Documentation:</h5>
+ * <ul>
+ * <li><a class="doclink" href="../../../../overview-summary.html#juneau-marshall.TemplatedSwaps">Overview > Templated Swaps</a>
+ * </ul>
*
* @param template The template string on this swap.
* @return This object (for method chaining).
http://git-wip-us.apache.org/repos/asf/juneau/blob/0ab0b231/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/transform/PropertyFilter.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/transform/PropertyFilter.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/transform/PropertyFilter.java
index 18b7c32..16c641b 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/transform/PropertyFilter.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/transform/PropertyFilter.java
@@ -87,18 +87,18 @@ public class PropertyFilter {
* <p>
* Subclasses can override this property to convert property values to some other object just before serialization.
*
- * <h5 class='section'>Example:</h5>
- * <p class='bcode'>
- * <jc>// Address filter that strips out sensitive information.</jc>
- * <jk>public class</jk> AddressPropertyFilter <jk>extends</jk> PropertyFilter {
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode'>
+ * <jc>// Address filter that strips out sensitive information.</jc>
+ * <jk>public class</jk> AddressPropertyFilter <jk>extends</jk> PropertyFilter {
*
- * <jk>public</jk> Object readProperty(Object bean, String name, Object value) {
- * <jk>if</jk> (<js>"taxInfo"</js>.equals(name))
- * <jk>return</jk> <js>"redacted"</js>;
- * <jk>return</jk> value;
- * }
- * }
- * </p>
+ * <jk>public</jk> Object readProperty(Object bean, String name, Object value) {
+ * <jk>if</jk> (<js>"taxInfo"</js>.equals(name))
+ * <jk>return</jk> <js>"redacted"</js>;
+ * <jk>return</jk> value;
+ * }
+ * }
+ * </p>
*
* @param bean The bean from which the property was read.
* @param name The property name.
@@ -116,19 +116,19 @@ public class PropertyFilter {
* Subclasses can override this property to convert property values to some other object just before calling the
* bean setter.
*
- * <h5 class='section'>Example:</h5>
- * <p class='bcode'>
- * <jc>// Address filter that strips out sensitive information.</jc>
- * <jk>public class</jk> AddressPropertyFilter <jk>extends</jk> PropertyFilter {
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode'>
+ * <jc>// Address filter that strips out sensitive information.</jc>
+ * <jk>public class</jk> AddressPropertyFilter <jk>extends</jk> PropertyFilter {
*
- * <jk>public</jk> Object writeProperty(Object bean, String name, Object value) {
- * AddressBook a = (Address)bean;
- * <jk>if</jk> (<js>"taxInfo"</js>.equals(name) && <js>"redacted"</js>.equals(value))
- * <jk>return</jk> TaxInfoUtils.<jsm>lookup</jsm>(a.getStreet(), a.getCity(), a.getState());
- * <jk>return</jk> value;
- * }
- * }
- * </p>
+ * <jk>public</jk> Object writeProperty(Object bean, String name, Object value) {
+ * AddressBook a = (Address)bean;
+ * <jk>if</jk> (<js>"taxInfo"</js>.equals(name) && <js>"redacted"</js>.equals(value))
+ * <jk>return</jk> TaxInfoUtils.<jsm>lookup</jsm>(a.getStreet(), a.getCity(), a.getState());
+ * <jk>return</jk> value;
+ * }
+ * }
+ * </p>
*
* @param bean The bean from which the property was read.
* @param name The property name.
http://git-wip-us.apache.org/repos/asf/juneau/blob/0ab0b231/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/UonParser.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/UonParser.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/UonParser.java
index 122f033..ad8838e 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/UonParser.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/UonParser.java
@@ -38,7 +38,7 @@ public class UonParser extends ReaderParser {
/**
* Configuration property: Decode <js>"%xx"</js> sequences.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"UonParser.decoding.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -50,7 +50,7 @@ public class UonParser extends ReaderParser {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Specify <jk>true</jk> if URI encoded characters should be decoded, <jk>false</jk> if they've already been decoded
* before being passed to this parser.
http://git-wip-us.apache.org/repos/asf/juneau/blob/0ab0b231/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/UonSerializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/UonSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/UonSerializer.java
index 0f0ad07..1a93afe 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/UonSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/UonSerializer.java
@@ -125,7 +125,7 @@ public class UonSerializer extends WriterSerializer {
/**
* Configuration property: Add <js>"_type"</js> properties when needed.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"UonSerializer.addBeanTypeProperties.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -137,7 +137,7 @@ public class UonSerializer extends WriterSerializer {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* If <jk>true</jk>, then <js>"_type"</js> properties will be added to beans if their type cannot be inferred
* through reflection.
@@ -154,7 +154,7 @@ public class UonSerializer extends WriterSerializer {
/**
* Configuration property: Encode non-valid URI characters.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"UonSerializer.encoding.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -167,7 +167,7 @@ public class UonSerializer extends WriterSerializer {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Encode non-valid URI characters with <js>"%xx"</js> constructs.
*
@@ -181,7 +181,7 @@ public class UonSerializer extends WriterSerializer {
/**
* Configuration property: Format to use for query/form-data/header values.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"UrlEncodingSerializer.paramFormat.s"</js>
* <li><b>Data type:</b> <code>String</code> ({@link ParamFormat})
@@ -194,7 +194,7 @@ public class UonSerializer extends WriterSerializer {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Specifies the format to use for URL GET parameter keys and values.
*/
http://git-wip-us.apache.org/repos/asf/juneau/blob/0ab0b231/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParser.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParser.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParser.java
index e7191cd..8dd9270 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParser.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParser.java
@@ -44,7 +44,7 @@ public class UrlEncodingParser extends UonParser {
/**
* Configuration property: Parser bean property collections/arrays as separate key/value pairs
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"UrlEncodingParser.expandedParams.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -56,7 +56,7 @@ public class UrlEncodingParser extends UonParser {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* This is the parser-side equivalent of the {@link #URLENC_expandedParams} setting.
*
http://git-wip-us.apache.org/repos/asf/juneau/blob/0ab0b231/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializer.java
index cabb5b6..6482448 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializer.java
@@ -120,7 +120,7 @@ public class UrlEncodingSerializer extends UonSerializer {
/**
* Configuration property: Serialize bean property collections/arrays as separate key/value pairs.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"UrlEncodingSerializer.expandedParams.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -133,7 +133,7 @@ public class UrlEncodingSerializer extends UonSerializer {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* If <jk>false</jk>, serializing the array <code>[1,2,3]</code> results in <code>?key=$a(1,2,3)</code>.
* If <jk>true</jk>, serializing the same array results in <code>?key=1&key=2&key=3</code>.
http://git-wip-us.apache.org/repos/asf/juneau/blob/0ab0b231/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/utils/MessageBundle.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/utils/MessageBundle.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/utils/MessageBundle.java
index ce1f34d..28df465 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/utils/MessageBundle.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/utils/MessageBundle.java
@@ -351,7 +351,7 @@ public class MessageBundle extends ResourceBundle {
*
* <p>
* Useful for debugging purposes.
- * Note that any class that implements a <code>toObjectMap()</code> method will automatically be serialized by
+ * Note that any class that implements a <code>swap()</code> method will automatically be serialized by
* calling this method and serializing the result.
*
* <p>
@@ -359,7 +359,7 @@ public class MessageBundle extends ResourceBundle {
*
* @return A new map containing all the keys and values in this bundle.
*/
- public ObjectMap toObjectMap() {
+ public ObjectMap swap() {
ObjectMap om = new ObjectMap();
for (String k : allKeys)
om.put(k, getString(k));
http://git-wip-us.apache.org/repos/asf/juneau/blob/0ab0b231/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlParser.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlParser.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlParser.java
index 96a3f8b..df6e8ef 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlParser.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlParser.java
@@ -40,7 +40,7 @@ public class XmlParser extends ReaderParser {
/**
* Configuration property: XML event allocator.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"XmlParser.eventAllocator.c"</js>
* <li><b>Data type:</b> <code>Class<? <jk>extends</jk> {@link XMLEventAllocator}></code>
@@ -52,7 +52,7 @@ public class XmlParser extends ReaderParser {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Associates an {@link XMLEventAllocator} with this parser.
*/
@@ -61,7 +61,7 @@ public class XmlParser extends ReaderParser {
/**
* Configuration property: Preserve root element during generalized parsing.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"XmlParser.preserveRootElement.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -74,12 +74,12 @@ public class XmlParser extends ReaderParser {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* If <jk>true</jk>, when parsing into a generic {@link ObjectMap}, the map will contain a single entry whose key
* is the root element name.
*
- * <h5 class='section'>Example:</h5>
+ * <h5 class='section'>Example:</h5>
* <table class='styled'>
* <tr>
* <td>XML</td>
@@ -98,7 +98,7 @@ public class XmlParser extends ReaderParser {
/**
* Configuration property: XML reporter.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"XmlParser.reporter.c"</js>
* <li><b>Data type:</b> <code>Class<? <jk>extends</jk> {@link XMLReporter}></code>
@@ -110,7 +110,7 @@ public class XmlParser extends ReaderParser {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Associates an {@link XMLReporter} with this parser.
*
@@ -124,7 +124,7 @@ public class XmlParser extends ReaderParser {
/**
* Configuration property: XML resolver.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"XmlParser.resolver.c"</js>
* <li><b>Data type:</b> <code>Class<? <jk>extends</jk> {@link XMLResolver}></code>
@@ -136,7 +136,7 @@ public class XmlParser extends ReaderParser {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Associates an {@link XMLResolver} with this parser.
*/
@@ -145,7 +145,7 @@ public class XmlParser extends ReaderParser {
/**
* Configuration property: Enable validation.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"XmlParser.validating.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -158,7 +158,7 @@ public class XmlParser extends ReaderParser {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* If <jk>true</jk>, XML document will be validated.
*
http://git-wip-us.apache.org/repos/asf/juneau/blob/0ab0b231/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlSerializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlSerializer.java
index ea9a891..29cc1db 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlSerializer.java
@@ -120,7 +120,7 @@ public class XmlSerializer extends WriterSerializer {
/**
* Configuration property: Add <js>"_type"</js> properties when needed.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"XmlSerializer.addBeanTypeProperties.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -132,7 +132,7 @@ public class XmlSerializer extends WriterSerializer {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* If <jk>true</jk>, then <js>"_type"</js> properties will be added to beans if their type cannot be inferred
* through reflection.
@@ -149,7 +149,7 @@ public class XmlSerializer extends WriterSerializer {
/**
* Configuration property: Add namespace URLs to the root element.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"XmlSerializer.addNamespaceUrisToRoot.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -162,7 +162,7 @@ public class XmlSerializer extends WriterSerializer {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Use this setting to add {@code xmlns:x} attributes to the root element for the default and all mapped namespaces.
*
@@ -174,7 +174,7 @@ public class XmlSerializer extends WriterSerializer {
/**
* Configuration property: Auto-detect namespace usage.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"XmlSerializer.autoDetectNamespaces.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -186,7 +186,7 @@ public class XmlSerializer extends WriterSerializer {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Detect namespace usage before serialization.
*
@@ -213,7 +213,7 @@ public class XmlSerializer extends WriterSerializer {
/**
* Configuration property: Default namespace.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"XmlSerializer.defaultNamespace.s"</js>
* <li><b>Data type:</b> <code>String</code> ({@link Namespace})
@@ -225,7 +225,7 @@ public class XmlSerializer extends WriterSerializer {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Specifies the default namespace URI for this document.
*/
@@ -234,7 +234,7 @@ public class XmlSerializer extends WriterSerializer {
/**
* Configuration property: Enable support for XML namespaces.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"XmlSerializer.enableNamespaces.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -246,7 +246,7 @@ public class XmlSerializer extends WriterSerializer {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* If not enabled, XML output will not contain any namespaces regardless of any other settings.
*/
@@ -255,7 +255,7 @@ public class XmlSerializer extends WriterSerializer {
/**
* Configuration property: Default namespaces.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"XmlSerializer.namespaces.ls"</js>
* <li><b>Data type:</b> <code>Set<String></code> ({@link Namespace})
@@ -267,7 +267,7 @@ public class XmlSerializer extends WriterSerializer {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* The default list of namespaces associated with this serializer.
*/
@@ -276,7 +276,7 @@ public class XmlSerializer extends WriterSerializer {
/**
* Configuration property: XMLSchema namespace.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"XmlSerializer.xsNamespace.s"</js>
* <li><b>Data type:</b> <code>String</code> ({@link Namespace})
@@ -288,7 +288,7 @@ public class XmlSerializer extends WriterSerializer {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Specifies the namespace for the <code>XMLSchema</code> namespace, used by the schema generated by the
* {@link XmlSchemaSerializer} class.
http://git-wip-us.apache.org/repos/asf/juneau/blob/0ab0b231/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/yaml/proto/YamlSerializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/yaml/proto/YamlSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/yaml/proto/YamlSerializer.java
index 8257bfb..e9e63fe 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/yaml/proto/YamlSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/yaml/proto/YamlSerializer.java
@@ -87,7 +87,7 @@ public class YamlSerializer extends WriterSerializer {
/**
* Configuration property: Add <js>"_type"</js> properties when needed.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"JsonSerializer.addBeanTypeProperties.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -99,7 +99,7 @@ public class YamlSerializer extends WriterSerializer {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* If <jk>true</jk>, then <js>"_type"</js> properties will be added to beans if their type cannot be inferred
* through reflection.
@@ -116,7 +116,7 @@ public class YamlSerializer extends WriterSerializer {
/**
* Configuration property: Prefix solidus <js>'/'</js> characters with escapes.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"JsonSerializer.escapeSolidus.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -128,7 +128,7 @@ public class YamlSerializer extends WriterSerializer {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* If <jk>true</jk>, solidus (e.g. slash) characters should be escaped.
* The JSON specification allows for either format.
@@ -140,7 +140,7 @@ public class YamlSerializer extends WriterSerializer {
/**
* Configuration property: Simple JSON mode.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"JsonSerializer.simpleMode.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -153,7 +153,7 @@ public class YamlSerializer extends WriterSerializer {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* If <jk>true</jk>, JSON attribute names will only be quoted when necessary.
* Otherwise, they are always quoted.
http://git-wip-us.apache.org/repos/asf/juneau/blob/0ab0b231/juneau-doc/src/main/javadoc/overview.html
----------------------------------------------------------------------
diff --git a/juneau-doc/src/main/javadoc/overview.html b/juneau-doc/src/main/javadoc/overview.html
index 903684b..d592213 100644
--- a/juneau-doc/src/main/javadoc/overview.html
+++ b/juneau-doc/src/main/javadoc/overview.html
@@ -105,11 +105,11 @@
<li><p><a class='doclink' href='#juneau-marshall.BeanIgnoreAnnotation'>@BeanIgnore Annotation</a></p>
<li><p><a class='doclink' href='#juneau-marshall.NamePropertyAnnotation'>@NameProperty Annotation</a></p>
<li><p><a class='doclink' href='#juneau-marshall.ParentPropertyAnnotation'>@ParentProperty Annotation</a></p>
- <li><p><a class='doclink' href='#juneau-marshall.URIAnnotation'>@URI Annotation</a></p>
+ <li><p><a class='doclink' href='#juneau-marshall.URIs'>URIs</a></p>
<li><p><a class='doclink' href='#juneau-marshall.BeanFilters'>BeanFilters</a></p>
+ <li><p><a class='doclink' href='#juneau-marshall.InterfaceFilters'>Interface filters</a></p>
<li><p><a class='doclink' href='#juneau-marshall.StopClasses'>Stop Classes</a></p>
- <li><p><a class='doclink' href='#juneau-marshall.SerializingToObjectMaps'>Serializing to ObjectMaps</a></p>
- <li><p><a class='doclink' href='#juneau-marshall.SerializingReadersAndInputStreams'>Serializing Readers and InputStreams</a></p>
+ <li><p><a class='doclink' href='#juneau-marshall.BypassSerialization'>Bypass Serialization using Readers and InputStreams</a></p>
</ol>
<li><p><a class='doclink' href='#juneau-marshall.BeanDictionaries'>Bean Name and Dictionaries</a></p>
<ol>
@@ -2283,31 +2283,109 @@
</div>
<!-- =================================================================================================== -->
- <a id="juneau-marshall.URIAnnotation"></a>
- <h4 class='topic' onclick='toggle(this)'>2.1.7.14 - @URI Annotation</h4>
+ <a id="juneau-marshall.URIs"></a>
+ <h4 class='topic' onclick='toggle(this)'>2.1.7.14 - URIs</h4>
<div class='topic'>
<p>
- The {@link org.apache.juneau.annotation.URI @URI} annotation is used to identify a class or bean
- property as a URI.
+ Juneau serializers have sophisticated support for transforming relative URIs to absolute form.
</p>
<p>
- By default, instances of {@link java.net.URL} and {@link java.net.URI} are considered URIs during serialization and
- are handled differently depending on the serializer (e.g. <code>HtmlSerializer</code> creates a
- hyperlink, <code>RdfXmlSerializer</code> creates an <code>rdf:resource</code> object, etc...).
- <br>This annotation allows you to identify other classes that return URIs via <code>toString()</code>
- as URI objects.
+ The following example shows a bean containing URIs of various forms and how they end up serialized.
</p>
- <p>
- URIs are automatically resolved to absolute or root-relative form based on the serializer
- {@link org.apache.juneau.serializer.Serializer#SERIALIZER_uriResolution} and
- {@link org.apache.juneau.serializer.Serializer#SERIALIZER_uriRelativity}
- configuration settings, and the URI context defined by the {@link org.apache.juneau.UriContext} that's part of the
- serializer session.
- <br>Refer to the {@link org.apache.juneau.UriResolver} class for information about the types of URIs that can be
- resolved during serialization.
+ <p class='bcode'>
+ <jc>// Our bean with properties containing various kinds of URIs.</jc>
+ <jk>public class</jk> TestURIs {
+ <jk>public</jk> URI
+ <jf>f1a</jf> = URI.<jsm>create</jsm>(<js>"http://www.apache.org/f1a"</js>),
+ <jf>f1b</jf> = URI.<jsm>create</jsm>(<js>"/f1b"</js>),
+ <jf>f1c</jf> = URI.<jsm>create</jsm>(<js>"/f1c/x/y"</js>),
+ <jf>f1d</jf> = URI.<jsm>create</jsm>(<js>"f1d"</js>),
+ <jf>f1e</jf> = URI.<jsm>create</jsm>(<js>"f1e/x/y"</js>),
+ <jf>f1f</jf> = URI.<jsm>create</jsm>(<js>""</js>),
+ <jf>f2a</jf> = URI.<jsm>create</jsm>(<js>"context:/f2a/x"</js>),
+ <jf>f2b</jf> = URI.<jsm>create</jsm>(<js>"context:/f2b"</js>),
+ <jf>f2c</jf> = URI.<jsm>create</jsm>(<js>"context:/"</js>),
+ <jf>f2d</jf> = URI.<jsm>create</jsm>(<js>"context:/.."</js>),
+ <jf>f3a</jf> = URI.<jsm>create</jsm>(<js>"servlet:/f3a/x"</js>),
+ <jf>f3b</jf> = URI.<jsm>create</jsm>(<js>"servlet:/f3b"</js>),
+ <jf>f3c</jf> = URI.<jsm>create</jsm>(<js>"servlet:/"</js>),
+ <jf>f3d</jf> = URI.<jsm>create</jsm>(<js>"servlet:/.."</js>),
+ <jf>f4a</jf> = URI.<jsm>create</jsm>(<js>"request:/f4a/x"</js>),
+ <jf>f4b</jf> = URI.<jsm>create</jsm>(<js>"request:/f4b"</js>),
+ <jf>f4c</jf> = URI.<jsm>create</jsm>(<js>"request:/"</js>),
+ <jf>f4d</jf> = URI.<jsm>create</jsm>(<js>"request:/.."</js>),
+ <jf>f5 </jf> = <jk>null</jk>;
+ }
+
+ <jc>// Create a serializer.</jc>
+ WriterSerializer s = JsonSerializer
+ <jsm>create</jsm>()
+ .simple()
+ .uriContext(<js>"{authority:'http://foo.com:123',contextRoot:'/myContext',servletPath:'/myServlet',pathInfo:'/myPath'}"</js>)
+ .uriResolution(<jsf>ABSOLUTE</jsf>)
+ .uriRelativity(<jsf>RESOURCE</jsf>)
+ .build();
+
+ <jc>// Produces:</jc>
+ <jc>// {</jc>
+ <jc>// f1a:'http://www.apache.org/f1a',</jc>
+ <jc>// f1b:'http://foo.com:123/f1b',</jc>
+ <jc>// f1c:'http://foo.com:123/f1c/x/y',</jc>
+ <jc>// f1d:'http://foo.com:123/myContext/myServlet/f1d',</jc>
+ <jc>// f1e:'http://foo.com:123/myContext/myServlet/f1e/x/y',</jc>
+ <jc>// f1f:'http://foo.com:123/myContext/myServlet',</jc>
+ <jc>// f2a:'http://foo.com:123/myContext/f2a/x',</jc>
+ <jc>// f2b:'http://foo.com:123/myContext/f2b',</jc>
+ <jc>// f2c:'http://foo.com:123/myContext',</jc>
+ <jc>// f2d:'http://foo.com:123'</jc>
+ <jc>// f3a:'http://foo.com:123/myContext/myServlet/f3a/x',</jc>
+ <jc>// f3b:'http://foo.com:123/myContext/myServlet/f3b',</jc>
+ <jc>// f3c:'http://foo.com:123/myContext/myServlet',</jc>
+ <jc>// f3d:'http://foo.com:123/myContext',</jc>
+ <jc>// f4a:'http://foo.com:123/myContext/myServlet/myPath/f4a/x',</jc>
+ <jc>// f4b:'http://foo.com:123/myContext/myServlet/myPath/f4b',</jc>
+ <jc>// f4c:'http://foo.com:123/myContext/myServlet/myPath',</jc>
+ <jc>// f4d:'http://foo.com:123/myContext/myServlet',</jc>
+ <jc>// }</jc>
+ String json = s.serialize(<jk>new</jk> TestURIs());
+ </p>
+ <p>
+ URI resolution is controlled by the following settings:
</p>
+ <ul class='doctree'>
+ <li class='jf'>{@link org.apache.juneau.serializer.Serializer#SERIALIZER_uriContext}
+ <br>Setting that defines the URI contextual information used to resolve relative URIs.
+ <li class='jf'>{@link org.apache.juneau.serializer.Serializer#SERIALIZER_uriRelativity}
+ <br>Setting that defines how relative URIs should be interpreted.
+ <br>Possible values:
+ <ul>
+ <li class='jf'>{@link org.apache.juneau.UriRelativity#RESOURCE}
+ <br>Relative URIs should be considered relative to the servlet URI.
+ <br>(e.g. <js>"http://host:port/context-root/servlet-path"</js>).
+ <li class='jf'>{@link org.apache.juneau.UriRelativity#PATH_INFO}
+ <br>Relative URIs should be considered relative to the request URI.
+ <br>(e.g. <js>"http://host:port/context-root/servlet-path/path-info"</js>).
+ </ul>
+ <li class='jf'>{@link org.apache.juneau.serializer.Serializer#SERIALIZER_uriResolution}
+ <br>Setting that defines the final format of serialized URIs.
+ <br>Possible values:
+ <ul>
+ <li class='jf'>{@link org.apache.juneau.UriResolution#ABSOLUTE}
+ <br>Resolve to an absolute URL.
+ <br>(e.g. <js>"http://host:port/context-root/servlet-path/path-info"</js>).
+ <li class='jf'>{@link org.apache.juneau.UriResolution#ROOT_RELATIVE}
+ <br>Resolve to a root-relative URL.
+ <br>(e.g. <js>"/context-root/servlet-path/path-info"</js>).
+ <li class='jf'>{@link org.apache.juneau.UriResolution#NONE}
+ <br>Don't do any URL resolution.
+ </ul>
+ </ul>
<p>
- This annotation can be applied to classes, interfaces, or bean property methods for fields.
+ Juneau automatically interprets any {@link java.net.URL} and {@link java.net.URI} objects as URIs and will
+ resolve them accordingly.
+ <br>The {@link org.apache.juneau.annotation.URI @URI} annotation can be used to extend that to other bean
+ properties and class types so that they also get interpreted as URIs.
+ <br>For example:
</p>
<p class='bcode'>
<jc>// Applied to a class whose toString() method returns a URI.</jc>
@@ -2423,133 +2501,163 @@
</div>
<!-- =================================================================================================== -->
- <a id="juneau-marshall.StopClasses"></a>
- <h4 class='topic' onclick='toggle(this)'>2.1.7.16 - Stop Classes</h4>
+ <a id="juneau-marshall.InterfaceFilters"></a>
+ <h4 class='topic' onclick='toggle(this)'>2.1.7.16 - Interface Filters</h4>
<div class='topic'>
<p>
Occasionally, you may want to limit bean properties to only those defined on a parent class or interface.
- <br>There are a couple of ways of doing this.
+ <br>This is accomplished through interface filters.
</p>
<p>
- For example, let's define the following parent class and subclass:
+ Interface filters are defined through the following:
+ </p>
+ <ul>
+ <li class='jf'>{@link org.apache.juneau.BeanContext#BEAN_beanFilters}
+ <li class='ja'>{@link org.apache.juneau.annotation.Bean#interfaceClass() @Bean.interfaceClass()}
+ <li class='jm'>{@link org.apache.juneau.transform.BeanFilterBuilder#interfaceClass(Class)}
+ </ul>
+ <p>
+ For example, let's define the following interface and implementation:
</p>
<p class='bcode'>
- <jc>// Abstract parent class</jc>
- <jk>public abstract class</jk> MyClass {
- <jk>public</jk> String <jf>foo</jf>=<js>"foo"</js>;
+ <jc>// Interface</jc>
+ <jk>public class</jk> MyInterface {
+ <jk>public</jk> String getFoo();
}
- <jc>// Subclass</jc>
- <jk>public class</jk> MyClassBar <jk>extends</jk> MyClass {
- <jk>public</jk> String <jf>bar</jf>=<js>"bar"</js>;
+ <jc>// Implementation</jc>
+ <jk>public class</jk> MyInterfaceImpl <jk>implements</jk> MyInterface {
+ <jk>public</jk> String getFoo() {...}
+ <jk>public</jk> String getBar() {...}
}
</p>
<p>
- Suppose we only want to render the properties defined on <code>MyClass</code>, not those defined on
- child classes.
+ Suppose we only want to render the properties defined on our interface, not the implementation.
<br>To do so, we can define the following bean filter:
</p>
<p class='bcode'>
<jc>// Define transform that limits properties to only those defined on MyClass</jc>
- <jk>public class</jk> MyBeanFilter <jk>extends</jk> BeanFilter<MyClass> {
- <jk>public</jk> MyBeanFilter() {
- interfaceClass(MyClass.<jk>class</jk>);
+ <jk>public class</jk> MyInterfaceFilter <jk>extends</jk> BeanFilter<MyInterface> {
+ <jk>public</jk> MyInterfaceFilter() {
+ interfaceClass(MyInterface.<jk>class</jk>);
}
}
</p>
<p>
- When serialized, the serialized bean will only include properties defined on the parent class.
+ When serialized, the serialized bean will only include properties defined on the interface.
</p>
<p class='bcode'>
WriterSerializer s = JsonSerializer
.<jsm>create</jsm>()
.simple()
- .beanFilters(MyBeanFilter.<jk>class</jk>)
+ .beanFilters(MyInterfaceFilter.<jk>class</jk>)
.build();
- MyClass c = <jk>new</jk> MyClassBar();
- String json = s.serialize(p); <jc>// Prints "{foo:'foo'}"</jc>
+ MyInterface o = <jk>new</jk> MyInterfaceImpl();
+
+ <jc>// Prints "{foo:'foo'}"</jc>
+ <jc>// bar is ignored because it's not on the interface</jc>
+ String json = s.serialize(o);
</p>
<p>
- The equivalent can be done through an annotation on the parent class, which applies to all child classes:
+ The {@link org.apache.juneau.BeanContextBuilder#beanFilters(Object...)} method will automatically interpret any
+ non-<code>BeanFilter</code> classes passed in as meaning interface classes.
+ <br>So in the previous example, the <code>BeanFilter</code> class could have been avoided altogether by just
+ passing in <code>MyInterface.<jk>class</jk></code> to the serializer, like so:
</p>
<p class='bcode'>
- <jc>// All subclasses of MyClass should only show the 'foo' property.</jc>
- <ja>@Bean</ja>(interfaceClass=MyClass.<jk>class</jk>)
- <jk>public abstract class</jk> MyClass {
- <jk>public</jk> String <jf>foo</jf>=<js>"foo"</js>;
- }
+ WriterSerializer s = JsonSerializer
+ .<jsm>create</jsm>()
+ .beanFilters(MyInterface.<jk>class</jk>) <jc>Shortcut!</jc>
+ .build();
</p>
<p>
- The annotation can also be applied on the individual child classes, like so...
+ The annotation equivalent is {@link org.apache.juneau.annotation.Bean#interfaceClass() Bean#interfaceClass()}.
</p>
<p class='bcode'>
- <jc>// Only serialize 'foo' property from parent class.</jc>
- <ja>@Bean</ja>(interfaceClass=MyClass.<jk>class</jk>)
- <jk>public class</jk> MyClassBar <jk>extends</jk> MyClass {
- <jk>public</jk> String <jf>bar</jf>=<js>"bar"</js>;
+ <ja>@Bean</ja>(interfaceClass=MyInterface.<jk>class</jk>)
+ <jk>public class</jk> MyInterfaceImpl <jk>implements</jk> MyInterface {
+ <jk>public</jk> String getFoo() {...}
+ <jk>public</jk> String getBar() {...}
}
</p>
<p>
- Also, the <code>beanFilters()</code> methods will automatically interpret any non-<code>BeanFilter</code>
- classes passed in as meaning interface classes.
- <br>So in the previous example, the <code>BeanFilter</code> class could have been avoided altogether by just
- passing in <code>MyClass.<jk>class</jk></code> to the serializer, like so:
+ The annotation can be used in a couple of ways.
+ </p>
+ <p>
+ Using the annotation on an interface will be inherited by all children.
</p>
<p class='bcode'>
- WriterSerializer s = JsonSerializer
- .<jsm>create</jsm>()
- .beanFilters(MyClass.<jk>class</jk>) <jc>Shortcut!</jc>
- .build();
+ <ja>@Bean</ja>(interfaceClass=MyInterface.<jk>class</jk>)
+ <jk>public class</jk> MyInterface {
+ <jk>public</jk> String getFoo();
+ }
</p>
<p>
- The {@link org.apache.juneau.transform.BeanFilterBuilder#stopClass(Class)} method and
- {@link org.apache.juneau.annotation.Bean#stopClass() @Bean.stopClass()} annotation are equivalent,
- but filters from the other direction.
- <br>(i.e. filter out properties found on parent classes and interfaces)
+ The annotation can be used on parent classes as well.
+ <br>Child beans will only serialize properties defined on the parent class.
+ <p class='bcode'>
+ <ja>@Bean</ja>(interfaceClass=MyAbstractClass.<jk>class</jk>)
+ <jk>public abstract class</jk> MyAbstractClass {
+ <jk>public</jk> String getFoo() {...};
+ }
+ </p>
</div>
-
+
<!-- =================================================================================================== -->
- <a id="juneau-marshall.SerializingToObjectMaps"></a>
- <h4 class='topic' onclick='toggle(this)'>2.1.7.17 - Serializing to ObjectMaps</h4>
+ <a id="juneau-marshall.StopClasses"></a>
+ <h4 class='topic' onclick='toggle(this)'>2.1.7.17 - Stop Classes</h4>
<div class='topic'>
<p>
- A shortcut method for transforming is provided that can often be simpler than defining transforms.
- In this case, we add methods to our class to serialize to {@link org.apache.juneau.ObjectMap ObjectMaps}
+ Whereas interface filters limit properties defined on child classes, stop filters
+ do the opposite and limit properties defined on parent classes.
</p>
<p>
- <p class='bcode'>
- <jk>public class</jk> MyClass {
- <jk>private</jk> String <jf>f1</jf>;
-
- <jc>// Constructor that takes in an ObjectMap</jc>
- <jk>public</jk> MyClass(ObjectMap m) {
- <jf>f1</jf> = m.getString(<js>"f1"</js>);
- }
-
- <jc>// Method that converts object to an ObjectMap</jc>
- <jk>public</jk> ObjectMap toObjectMap() {
- <jk>return new</jk> ObjectMap().append(<js>"f1"</js>, <jf>f1</jf>);
- }
+ Stop classes are defined through the following:
</p>
+ <ul>
+ <li class='ja'>{@link org.apache.juneau.annotation.Bean#stopClass() @Bean.stopClass()}
+ <li class='jf'>{@link org.apache.juneau.transform.BeanFilterBuilder#stopClass(Class)}
+ </ul>
<p>
- The <code>toObjectMap()</code> method will automatically be used during serialization, and
- the constructor will automatically be used during parsing.
- This will work for all serializers and parsers.
+ Stop classes are identical in purpose to the stop class specified by {@link java.beans.Introspector#getBeanInfo(Class, Class)}.
+ <br>Any properties in the stop class or in its base classes will be ignored during serialization.
+ </p>
+ <p>
+ For example, in the following class hierarchy, instances of <code>C3</code> will include property <code>p3</code>,
+ but not <code>p1</code> or <code>p2</code>.
+ </p>
+ <p class='bcode'>
+ <jk>public class</jk> C1 {
+ <jk>public int</jk> getP1();
+ }
+
+ <jk>public class</jk> C2 <jk>extends</jk> C1 {
+ <jk>public int</jk> getP2();
+ }
+
+ <ja>@Bean</ja>(stopClass=C2.<jk>class</jk>)
+ <jk>public class</jk> C3 <jk>extends</jk> C2 {
+ <jk>public int</jk> getP3();
+ }
+
+ <jc>// Serializes property 'p3', but NOT 'p1' or 'p2'.</jc>
+ String json = JsonSerializer.<jsf>DEFAULT</jsf>.serialize(<jk>new</jk> C3());
</p>
</div>
<!-- =================================================================================================== -->
- <a id="juneau-marshall.SerializingReadersAndInputStreams"></a>
- <h4 class='topic' onclick='toggle(this)'>2.1.7.18 - Serializing Readers and InputStreams</h4>
+ <a id="juneau-marshall.BypassSerialization"></a>
+ <h4 class='topic' onclick='toggle(this)'>2.1.7.18 - Bypass Serialization using Readers and InputStreams</h4>
<div class='topic'>
<p>
Juneau serializers treat instances of <code>Readers</code> and <code>InputStreams</code> special by
simply serializing their contents directly to the output stream or writer.
- This allows you to embed fully customized serializer output.
+ <br>This allows you to embed fully customized serializer output.
</p>
<p class='bcode'>
<jk>public class</jk> MyBean {
+ <jc>// A bean property that produces raw JSON.</jc>
<jk>public</jk> Reader f1 = <jk>new</jk> StringReader(<js>"{'foo':'bar'}"</js>);
}
@@ -2570,6 +2678,8 @@
<ja>@Swap</ja>(MyBeanSwapSometimes.<jk>class</jk>)
<jk>public class</jk> MyBean {...}
+ <jc>// A swap that produces specialized output for JSON, but default serialization for</jc>
+ <jc>// all other media types.</jc>
<jk>public class</jk> MyBeanSwapSometimes <jk>extends</jk> PojoSwap<MyBean,Object> {
<jk>public</jk> Object swap(BeanSession session, MyPojo o) <jk>throws</jk> Exception {
MediaType mt = session.getMediaType();
@@ -9028,14 +9138,27 @@
Code for marshalling of parts have been removed from the URL-Encoding serializers and parsers.
<li>
<code>ContextBuilder.property(String,Object)</code> renamed to {@link org.apache.juneau.ContextBuilder#set(String,Object)}.
- <li><code>ResourceFinder</code> class has been replaced with the following:
+ <li>
+ <code>ResourceFinder</code> class has been replaced with the following:
<ul>
<li>{@link org.apache.juneau.utils.ClasspathResourceFinder}
<li>{@link org.apache.juneau.utils.ClasspathResourceFinderSimple}
<li>{@link org.apache.juneau.utils.ClasspathResourceFinderBasic}
<li>{@link org.apache.juneau.utils.ClasspathResourceFinderRecursive}
<li>{@link org.apache.juneau.utils.ClasspathResourceManager}
- </ul>
+ </ul>
+ <li>
+ New methods on {@link org.apache.juneau.serializer.SerializerSession}:
+ <ul>
+ <li>{@link org.apache.juneau.serializer.SerializerSession#getListener() getListener()}
+ <li>{@link org.apache.juneau.serializer.SerializerSession#getListener(Class) getListener(Class)}
+ </ul>
+ <li>
+ New methods on {@link org.apache.juneau.parser.ParserSession}:
+ <ul>
+ <li>{@link org.apache.juneau.parser.ParserSession#getListener() getListener()}
+ <li>{@link org.apache.juneau.parser.ParserSession#getListener(Class) getListener(Class)}
+ </ul>
</ul>
<h6 class='topic'>juneau-rest-server</h6>
http://git-wip-us.apache.org/repos/asf/juneau/blob/0ab0b231/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestCall.java
----------------------------------------------------------------------
diff --git a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestCall.java b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestCall.java
index ba064a2..b0e91e5 100644
--- a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestCall.java
+++ b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestCall.java
@@ -124,12 +124,12 @@ public final class RestCall extends BeanSession {
*
* <p>
* Can be any of the following types:
- * <ul>
- * <li>{@link URI}
- * <li>{@link URL}
- * <li>{@link URIBuilder}
- * <li>Anything else converted to a string using {@link Object#toString()}.
- * </ul>
+ * <ul>
+ * <li>{@link URI}
+ * <li>{@link URL}
+ * <li>{@link URIBuilder}
+ * <li>Anything else converted to a string using {@link Object#toString()}.
+ * </ul>
*
* <p>
* Relative URL strings will be interpreted as relative to the root URL defined on the client.
http://git-wip-us.apache.org/repos/asf/juneau/blob/0ab0b231/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClient.java
----------------------------------------------------------------------
diff --git a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClient.java b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClient.java
index 2d62063..30ff8c6 100644
--- a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClient.java
+++ b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClient.java
@@ -73,7 +73,7 @@ public class RestClient extends BeanContext {
/**
* Configuration property: Debug.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"RestClient.debug.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -84,7 +84,7 @@ public class RestClient extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Enable debug mode.
*/
@@ -93,7 +93,7 @@ public class RestClient extends BeanContext {
/**
* Configuration property: Executor service.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"RestClient.executorService.o"</js>
* <li><b>Data type:</b> <code>Class<? <jk>implements</jk> ExecutorService></code> or {@link ExecutorService}.
@@ -104,8 +104,8 @@ public class RestClient extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
- * <p>
+ * <h5 class='section'>Description:</h5>
+ * <p>
* Defines the executor service to use when calling future methods on the {@link RestCall} class.
*
* <p>
@@ -126,7 +126,7 @@ public class RestClient extends BeanContext {
/**
* Configuration property: Shut down executor service on close.</b>
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"RestClient.executorServiceShutdownOnClose.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -137,7 +137,7 @@ public class RestClient extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Call {@link ExecutorService#shutdown()} when {@link RestClient#close()} is called.
*/
@@ -146,7 +146,7 @@ public class RestClient extends BeanContext {
/**
* Configuration property: Request headers.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"RestClient.requestHeader.sms"</js>
* <li><b>Data type:</b> <code>Map<String,String></code>
@@ -158,7 +158,7 @@ public class RestClient extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Headers to add to every request.
*/
@@ -167,7 +167,7 @@ public class RestClient extends BeanContext {
/**
* Configuration property: Call interceptors.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"RestClient.interceptors.lo"</js>
* <li><b>Data type:</b> <code>List<Class<? <jk>implements</jk> RestCallInterceptor | RestCallInterceptor</code>></code>
@@ -178,8 +178,8 @@ public class RestClient extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
- * <p>
+ * <h5 class='section'>Description:</h5>
+ * <p>
* Interceptors that get called immediately after a connection is made.
*/
public static final String RESTCLIENT_interceptors = PREFIX + "interceptors.lo";
@@ -192,7 +192,7 @@ public class RestClient extends BeanContext {
/**
* Configuration property: Keep HttpClient open.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"RestClient.keepHttpClientOpen.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -203,7 +203,7 @@ public class RestClient extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Don't close this client when the {@link RestClient#close()} method is called.
*/
@@ -212,7 +212,7 @@ public class RestClient extends BeanContext {
/**
* Configuration property: Parser.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"RestClient.parser.o"</js>
* <li><b>Data type:</b> <code>Class<? <jk>extends</jk> Parser></code> or {@link Parser}.
@@ -224,7 +224,7 @@ public class RestClient extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* The parser to use for parsing POJOs in response bodies.
*/
@@ -233,7 +233,7 @@ public class RestClient extends BeanContext {
/**
* Configuration property: Part serializer.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"RestClient.urlEncodingSerializer.o"</js>
* <li><b>Data type:</b> <code>Class<? <jk>implements</jk> HttpPartSerializer></code> or {@link HttpPartSerializer}.
@@ -245,7 +245,7 @@ public class RestClient extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* The serializer to use for serializing POJOs in form data, query parameters, headers, and path variables.
*/
@@ -254,7 +254,7 @@ public class RestClient extends BeanContext {
/**
* Configuration property: Request query parameters.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"RestClient.query.sms"</js>
* <li><b>Data type:</b> <code>Map<String,String></code>
@@ -265,7 +265,7 @@ public class RestClient extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Query parameters to add to every request.
*/
@@ -274,7 +274,7 @@ public class RestClient extends BeanContext {
/**
* Configuration property: Number of retries to attempt.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"RestClient.retries.i"</js>
* <li><b>Data type:</b> <code>Integer</code>
@@ -285,7 +285,7 @@ public class RestClient extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* The number of retries to attempt when the connection cannot be made or a <code>>400</code> response is received.
*/
@@ -294,7 +294,7 @@ public class RestClient extends BeanContext {
/**
* Configuration property: The time in milliseconds between retry attempts.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"RestClient.retryInterval.i"</js>
* <li><b>Data type:</b> <code>Integer</code>
@@ -305,7 +305,7 @@ public class RestClient extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* The time in milliseconds between retry attempts.
* <code>-1</code> means retry immediately.
@@ -315,7 +315,7 @@ public class RestClient extends BeanContext {
/**
* Configuration property: Retry-on determination object.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"RestClient.retryOn.o"</js>
* <li><b>Data type:</b> <code>Class<? extends {@link RetryOn}</code> or {@link RetryOn}
@@ -326,7 +326,7 @@ public class RestClient extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Object used for determining whether a retry should be attempted.
*/
@@ -335,7 +335,7 @@ public class RestClient extends BeanContext {
/**
* Configuration property: Root URI.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"RestClient.rootUri.s"</js>
* <li><b>Data type:</b> <code>String</code>
@@ -346,7 +346,7 @@ public class RestClient extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* When set, relative URL strings passed in through the various rest call methods (e.g. {@link RestClient#doGet(Object)}
* will be prefixed with the specified root.
@@ -358,7 +358,7 @@ public class RestClient extends BeanContext {
/**
* Configuration property: Serializer.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"RestClient.serializer.o"</js>
* <li><b>Data type:</b> <code>Class<? <jk>extends</jk> Serializer></code> or {@link Serializer}.
@@ -370,7 +370,7 @@ public class RestClient extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* The serializer to use for serializing POJOs in request bodies.
*/
http://git-wip-us.apache.org/repos/asf/juneau/blob/0ab0b231/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/ReaderResource.java
----------------------------------------------------------------------
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/ReaderResource.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/ReaderResource.java
index a085127..c187616 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/ReaderResource.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/ReaderResource.java
@@ -72,7 +72,7 @@ public class ReaderResource implements Writable {
* <li><code>Reader</code> - Converted to UTF-8 bytes.
* <li><code>File</code>
* <li><code>CharSequence</code> - Converted to UTF-8 bytes.
- * </ul>
+ * </ul>
* @throws IOException
*/
public ReaderResource(MediaType mediaType, Map<String,String> headers, VarResolverSession varSession, Object...contents) throws IOException {
@@ -149,7 +149,7 @@ public class ReaderResource implements Writable {
* <li><code>Reader</code> - Converted to UTF-8 bytes.
* <li><code>File</code>
* <li><code>CharSequence</code> - Converted to UTF-8 bytes.
- * </ul>
+ * </ul>
* @return This object (for method chaining).
*/
public Builder contents(Object...contents) {
[3/4] juneau git commit: Update javadocs.
Posted by ja...@apache.org.
http://git-wip-us.apache.org/repos/asf/juneau/blob/0ab0b231/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanSessionArgs.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanSessionArgs.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanSessionArgs.java
index 4a69e82..b6debb8 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanSessionArgs.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanSessionArgs.java
@@ -26,26 +26,31 @@ public class BeanSessionArgs extends SessionArgs {
*/
public static final BeanSessionArgs DEFAULT = new BeanSessionArgs(ObjectMap.EMPTY_MAP, null, null, null);
- final Locale locale;
- final TimeZone timeZone;
- final MediaType mediaType;
+ Locale locale;
+ TimeZone timeZone;
+ MediaType mediaType;
/**
+ * Constructor
+ */
+ public BeanSessionArgs() {}
+
+ /**
* Constructor.
*
* @param properties
* Session-level properties.
- * These override context-level properties.
- * Can be <jk>null</jk>.
+ * <br>These override context-level properties.
+ * <br>Can be <jk>null</jk>.
* @param locale
* The session locale.
- * If <jk>null</jk>, then the locale defined on the context is used.
+ * <br>If <jk>null</jk>, then the locale defined on the context is used.
* @param timeZone
* The session timezone.
- * If <jk>null</jk>, then the timezone defined on the context is used.
+ * <br>If <jk>null</jk>, then the timezone defined on the context is used.
* @param mediaType
* The session media type (e.g. <js>"application/json"</js>).
- * Can be <jk>null</jk>.
+ * <br>Can be <jk>null</jk>.
*/
public BeanSessionArgs(ObjectMap properties, Locale locale, TimeZone timeZone, MediaType mediaType) {
super(properties);
@@ -53,4 +58,49 @@ public class BeanSessionArgs extends SessionArgs {
this.timeZone = timeZone;
this.mediaType = mediaType;
}
+
+ /**
+ * The session locale.
+ *
+ * @param locale
+ * The session locale.
+ * <br>If <jk>null</jk>, then the locale defined on the context is used.
+ * @return This object (for method chaining).
+ */
+ public BeanSessionArgs locale(Locale locale) {
+ this.locale = locale;
+ return this;
+ }
+
+ /**
+ * The session timezone.
+ *
+ * @param timeZone
+ * The session timezone.
+ * <br>If <jk>null</jk>, then the timezone defined on the context is used.
+ * @return This object (for method chaining).
+ */
+ public BeanSessionArgs timeZone(TimeZone timeZone) {
+ this.timeZone = timeZone;
+ return this;
+ }
+
+ /**
+ * The session media type.
+ *
+ * @param mediaType
+ * The session media type (e.g. <js>"application/json"</js>).
+ * <br>Can be <jk>null</jk>.
+ * @return This object (for method chaining).
+ */
+ public BeanSessionArgs mediaType(MediaType mediaType) {
+ this.mediaType = mediaType;
+ return this;
+ }
+
+ @Override /* SessionArgs */
+ public BeanSessionArgs properties(ObjectMap properties) {
+ super.properties(properties);
+ return this;
+ }
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/0ab0b231/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/SessionArgs.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/SessionArgs.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/SessionArgs.java
index 17f4e8d..7c26085 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/SessionArgs.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/SessionArgs.java
@@ -22,17 +22,37 @@ public class SessionArgs {
*/
public static final SessionArgs DEFAULT = new SessionArgs(ObjectMap.EMPTY_MAP);
- final ObjectMap properties;
+ ObjectMap properties;
+
+ /**
+ * Constructor.
+ */
+ public SessionArgs() {}
/**
* Constructor.
*
* @param properties
* Session-level properties.
- * These override context-level properties.
- * Can be <jk>null</jk>.
+ * <br>These override context-level properties.
+ * <br>Can be <jk>null</jk>.
*/
public SessionArgs(ObjectMap properties) {
this.properties = properties != null ? properties : ObjectMap.EMPTY_MAP;
}
+
+ /**
+ * Session-level properties.
+ *
+ * @param properties
+ * Session-level properties.
+ * <br>These override context-level properties.
+ * <br>Can be <jk>null</jk>.
+ * @return This object (for method chaining).
+ */
+ public SessionArgs properties(ObjectMap properties) {
+ this.properties = properties != null ? properties : ObjectMap.EMPTY_MAP;
+ return this;
+ }
+
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/0ab0b231/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/BeanProperty.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/BeanProperty.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/BeanProperty.java
index ef24e47..d57bb52 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/BeanProperty.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/BeanProperty.java
@@ -57,7 +57,7 @@ public @interface BeanProperty {
* beans.
*
* <p>
- * The following examples show how to define dynamic bean properties.
+ * The following examples show how to define dynamic bean properties.
* <p class='bcode'>
* <jc>// Option #1 - A simple public Map field.
* // The field name can be anything.</jc>
http://git-wip-us.apache.org/repos/asf/juneau/blob/0ab0b231/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/Swap.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/Swap.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/Swap.java
index c118b0b..f51f2ce 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/Swap.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/Swap.java
@@ -66,10 +66,10 @@ public @interface Swap {
* }
* </p>
*
- * <h5 class='section'>Documentation:</h5>
- * <ul>
- * <li><a class="doclink" href="../../../../overview-summary.html#juneau-marshall.PerMediaTypePojoSwaps">Overview > Per-media-type PojoSwaps</a>
- * </ul>
+ * <h5 class='section'>Documentation:</h5>
+ * <ul>
+ * <li><a class="doclink" href="../../../../overview-summary.html#juneau-marshall.PerMediaTypePojoSwaps">Overview > Per-media-type PojoSwaps</a>
+ * </ul>
*/
String[] mediaTypes() default {};
@@ -103,10 +103,10 @@ public @interface Swap {
* <jk>public class</jk> MyPojo {}
* </p>
*
- * <h5 class='section'>Documentation:</h5>
- * <ul>
- * <li><a class="doclink" href="../../../../overview-summary.html#juneau-marshall.TemplatedSwaps">Overview > Templated Swaps</a>
- * </ul>
+ * <h5 class='section'>Documentation:</h5>
+ * <ul>
+ * <li><a class="doclink" href="../../../../overview-summary.html#juneau-marshall.TemplatedSwaps">Overview > Templated Swaps</a>
+ * </ul>
*/
String template() default "";
http://git-wip-us.apache.org/repos/asf/juneau/blob/0ab0b231/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlDocSerializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlDocSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlDocSerializer.java
index abd6e06..13306ad 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlDocSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlDocSerializer.java
@@ -79,7 +79,7 @@ public class HtmlDocSerializer extends HtmlStrippedDocSerializer {
/**
* Configuration property: Aside section contents.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"HtmlDocSerializer.aside.ls"</js>
* <li><b>Data type:</b> <code>List<String></code>
@@ -87,7 +87,7 @@ public class HtmlDocSerializer extends HtmlStrippedDocSerializer {
* <li><b>Session-overridable:</b> <jk>true</jk>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Allows you to specify the contents of the aside section on the HTML page.
* The aside section floats on the right of the page for providing content supporting the serialized content of
@@ -116,7 +116,7 @@ public class HtmlDocSerializer extends HtmlStrippedDocSerializer {
/**
* Configuration property: Footer section contents.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"HtmlDocSerializer.footer.ls"</js>
* <li><b>Data type:</b> <code>List<String></code>
@@ -124,7 +124,7 @@ public class HtmlDocSerializer extends HtmlStrippedDocSerializer {
* <li><b>Session-overridable:</b> <jk>true</jk>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Allows you to specify the contents of the footer section on the HTML page.
*
@@ -147,7 +147,7 @@ public class HtmlDocSerializer extends HtmlStrippedDocSerializer {
/**
* Configuration property: Additional head section content.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"HtmlDocSerializer.head.ls"</js>
* <li><b>Data type:</b> <code>List<String></code>
@@ -155,7 +155,7 @@ public class HtmlDocSerializer extends HtmlStrippedDocSerializer {
* <li><b>Session-overridable:</b> <jk>true</jk>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Adds the specified HTML content to the head section of the page.
*
@@ -186,7 +186,7 @@ public class HtmlDocSerializer extends HtmlStrippedDocSerializer {
/**
* Configuration property: Header section contents.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"HtmlDocSerializer.ls"</js>
* <li><b>Data type:</b> <code>List<String></code>
@@ -194,7 +194,7 @@ public class HtmlDocSerializer extends HtmlStrippedDocSerializer {
* <li><b>Session-overridable:</b> <jk>true</jk>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Allows you to override the contents of the header section on the HTML page.
* The header section normally contains the title and description at the top of the page.
@@ -215,7 +215,7 @@ public class HtmlDocSerializer extends HtmlStrippedDocSerializer {
/**
* Configuration property: Nav section contents.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"HtmlDocSerializer.nav.ls"</js>
* <li><b>Data type:</b> <code>List<String></code>
@@ -223,7 +223,7 @@ public class HtmlDocSerializer extends HtmlStrippedDocSerializer {
* <li><b>Session-overridable:</b> <jk>true</jk>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Allows you to override the contents of the nav section on the HTML page.
* The nav section normally contains the page links at the top of the page.
@@ -247,7 +247,7 @@ public class HtmlDocSerializer extends HtmlStrippedDocSerializer {
/**
* Configuration property: Page navigation links.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"HtmlDocSerializer.navlinks.ls"</js>
* <li><b>Data type:</b> <code>List<String></code>
@@ -255,7 +255,7 @@ public class HtmlDocSerializer extends HtmlStrippedDocSerializer {
* <li><b>Session-overridable:</b> <jk>true</jk>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Adds a list of hyperlinks immediately under the title and description but above the content of the page.
*
@@ -319,7 +319,7 @@ public class HtmlDocSerializer extends HtmlStrippedDocSerializer {
/**
* Configuration property: No-results message.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"HtmlDocSerializer.noResultsMessage.s"</js>
* <li><b>Data type:</b> <code>String</code>
@@ -327,7 +327,7 @@ public class HtmlDocSerializer extends HtmlStrippedDocSerializer {
* <li><b>Session-overridable:</b> <jk>true</jk>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Allows you to specify the string message used when trying to serialize an empty array or empty list.
*
@@ -348,7 +348,7 @@ public class HtmlDocSerializer extends HtmlStrippedDocSerializer {
/**
* Configuration property: Prevent word wrap on page.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"HtmlDocSerializer.nowrap.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -356,7 +356,7 @@ public class HtmlDocSerializer extends HtmlStrippedDocSerializer {
* <li><b>Session-overridable:</b> <jk>true</jk>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Adds <js>"* {white-space:nowrap}"</js> to the CSS instructions on the page to prevent word wrapping.
*/
@@ -365,7 +365,7 @@ public class HtmlDocSerializer extends HtmlStrippedDocSerializer {
/**
* Configuration property: Javascript code.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"HtmlDocSerializer.script.ls"</js>
* <li><b>Data type:</b> <code>List<String></code>
@@ -373,7 +373,7 @@ public class HtmlDocSerializer extends HtmlStrippedDocSerializer {
* <li><b>Session-overridable:</b> <jk>true</jk>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Adds the specified Javascript code to the HTML page.
*
@@ -409,7 +409,7 @@ public class HtmlDocSerializer extends HtmlStrippedDocSerializer {
/**
* Configuration property: CSS style code.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"HtmlDocSerializer.style.ls"</js>
* <li><b>Data type:</b> <code>List<String></code>
@@ -417,7 +417,7 @@ public class HtmlDocSerializer extends HtmlStrippedDocSerializer {
* <li><b>Session-overridable:</b> <jk>true</jk>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Adds the specified CSS instructions to the HTML page.
*
@@ -454,7 +454,7 @@ public class HtmlDocSerializer extends HtmlStrippedDocSerializer {
/**
* Configuration property: Stylesheet import URLs.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"HtmlDocSerializer.stylesheet.ls"</js>
* <li><b>Data type:</b> <code>List<String></code>
@@ -462,7 +462,7 @@ public class HtmlDocSerializer extends HtmlStrippedDocSerializer {
* <li><b>Session-overridable:</b> <jk>true</jk>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Adds a link to the specified stylesheet URL.
*
@@ -479,7 +479,7 @@ public class HtmlDocSerializer extends HtmlStrippedDocSerializer {
/**
* Configuration property: HTML document template.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"HtmlDocSerializer.template.c"</js>
* <li><b>Data type:</b> <code>Class<? <jk>extends</jk> HtmlDocTemplate></code>
@@ -487,7 +487,7 @@ public class HtmlDocSerializer extends HtmlStrippedDocSerializer {
* <li><b>Session-overridable:</b> <jk>true</jk>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Specifies the template to use for serializing the page.
*
http://git-wip-us.apache.org/repos/asf/juneau/blob/0ab0b231/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlDocSerializerSession.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlDocSerializerSession.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlDocSerializerSession.java
index 3ee1da9..2d8fcfc 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlDocSerializerSession.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlDocSerializerSession.java
@@ -157,8 +157,8 @@ public class HtmlDocSerializerSession extends HtmlStrippedDocSerializerSession {
*
* @return
* The {@link HtmlDocSerializer#HTMLDOC_navlinks} setting value in this context.
- * <jk>null</jk> if not specified.
- * Never an empty map.
+ * <jk>null</jk> if not specified.
+ * Never an empty map.
*/
public final String[] getNavLinks() {
return navlinks;
http://git-wip-us.apache.org/repos/asf/juneau/blob/0ab0b231/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSerializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSerializer.java
index 901e252..d46f053 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSerializer.java
@@ -134,7 +134,7 @@ public class HtmlSerializer extends XmlSerializer {
/**
* Configuration property: Add <js>"_type"</js> properties when needed.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"HtmlSerializer.addBeanTypeProperties.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -146,7 +146,7 @@ public class HtmlSerializer extends XmlSerializer {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* If <jk>true</jk>, then <js>"_type"</js> properties will be added to beans if their type cannot be inferred
* through reflection.
@@ -163,7 +163,7 @@ public class HtmlSerializer extends XmlSerializer {
/**
* Configuration property: Add key/value headers on bean/map tables.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"HtmlSerializer.addKeyValueTableHeaders.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -185,7 +185,7 @@ public class HtmlSerializer extends XmlSerializer {
/**
* Configuration property: Look for URLs in {@link String Strings}.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"HtmlSerializer.detectLinksInStrings.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -197,7 +197,7 @@ public class HtmlSerializer extends XmlSerializer {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* If a string looks like a URL (e.g. starts with <js>"http://"</js> or <js>"https://"</js>, then treat it like a URL
* and make it into a hyperlink based on the rules specified by {@link #HTML_uriAnchorText}.
@@ -207,7 +207,7 @@ public class HtmlSerializer extends XmlSerializer {
/**
* Configuration property: The parameter name to use when using {@link #HTML_lookForLabelParameters}.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"HtmlSerializer.labelParameter.s"</js>
* <li><b>Data type:</b> <code>String</code>
@@ -224,7 +224,7 @@ public class HtmlSerializer extends XmlSerializer {
/**
* Configuration property: Look for link labels in the <js>"label"</js> parameter of the URL.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"HtmlSerializer.lookForLabelParameters.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -236,7 +236,7 @@ public class HtmlSerializer extends XmlSerializer {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* If the URL has a label parameter (e.g. <js>"?label=foobar"</js>), then use that as the anchor text of the link.
*
@@ -248,7 +248,7 @@ public class HtmlSerializer extends XmlSerializer {
/**
* Configuration property: Anchor text source.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"HtmlSerializer.uriAnchorText.s"</js>
* <li><b>Data type:</b> <code>String</code> ({@link AnchorText})
@@ -264,7 +264,7 @@ public class HtmlSerializer extends XmlSerializer {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* When creating anchor tags (e.g. <code><xt><a</xt> <xa>href</xa>=<xs>'...'</xs>
* <xt>></xt>text<xt></a></xt></code>) in HTML, this setting defines what to set the inner text to.
http://git-wip-us.apache.org/repos/asf/juneau/blob/0ab0b231/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/internal/JuneauLogger.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/internal/JuneauLogger.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/internal/JuneauLogger.java
index 51429a4..61c4736 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/internal/JuneauLogger.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/internal/JuneauLogger.java
@@ -80,7 +80,7 @@ public class JuneauLogger extends java.util.logging.Logger {
* The name of the resource bundle.
* Can be any of the following formats:
* <ol>
- * <li>An absolute path. E.g. <js>"com/foo/nls/Messages"</js>.
+ * <li>An absolute path. E.g. <js>"com/foo/nls/Messages"</js>.
* <li>A path relative to the package of the class. E.g. <js>"nls/Messages"</js>.
* </ol>
* Both <js>'.'</js> and <js>'/'</js> can be used as path delimiters.
http://git-wip-us.apache.org/repos/asf/juneau/blob/0ab0b231/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSerializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSerializer.java
index 21c0aaf..ef188e6 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSerializer.java
@@ -97,7 +97,7 @@ public class JsonSerializer extends WriterSerializer {
/**
* Configuration property: Add <js>"_type"</js> properties when needed.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"JsonSerializer.addBeanTypeProperties.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -109,7 +109,7 @@ public class JsonSerializer extends WriterSerializer {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* If <jk>true</jk>, then <js>"_type"</js> properties will be added to beans if their type cannot be inferred
* through reflection.
@@ -126,7 +126,7 @@ public class JsonSerializer extends WriterSerializer {
/**
* Configuration property: Prefix solidus <js>'/'</js> characters with escapes.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"JsonSerializer.escapeSolidus.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -139,7 +139,7 @@ public class JsonSerializer extends WriterSerializer {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* If <jk>true</jk>, solidus (e.g. slash) characters should be escaped.
* The JSON specification allows for either format.
@@ -151,7 +151,7 @@ public class JsonSerializer extends WriterSerializer {
/**
* Configuration property: Simple JSON mode.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"JsonSerializer.simpleMode.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -164,7 +164,7 @@ public class JsonSerializer extends WriterSerializer {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* If <jk>true</jk>, JSON attribute names will only be quoted when necessary.
* Otherwise, they are always quoted.
http://git-wip-us.apache.org/repos/asf/juneau/blob/0ab0b231/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/msgpack/MsgPackSerializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/msgpack/MsgPackSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/msgpack/MsgPackSerializer.java
index f32cf22..31d3f16 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/msgpack/MsgPackSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/msgpack/MsgPackSerializer.java
@@ -36,7 +36,7 @@ public class MsgPackSerializer extends OutputStreamSerializer {
/**
* Configuration property: Add <js>"_type"</js> properties when needed.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"MsgPackSerializer.addBeanTypeProperties.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -48,7 +48,7 @@ public class MsgPackSerializer extends OutputStreamSerializer {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* If <jk>true</jk>, then <js>"_type"</js> properties will be added to beans if their type cannot be inferred
* through reflection.
http://git-wip-us.apache.org/repos/asf/juneau/blob/0ab0b231/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/package.html
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/package.html b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/package.html
index effb78f..6375f33 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/package.html
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/package.html
@@ -56,182 +56,5 @@
}
</script>
-<a id='TOC'></a><h5 class='toc'>Table of Contents</h5>
-<ol class='toc'>
- <li><p><a class='doclink' href='#BeanContext_Api'>Bean Context API</a></p>
- <ol>
- <li><p><a class='doclink' href='#BeanMap'>The BeanMap class</a></p>
- <li><p><a class='doclink' href='#BeanContext'>The BeanContext class</a></p>
- <li><p><a class='doclink' href='#Bean'>Bean annotations</a></p>
- </ol>
-</ol>
-
-<!-- ======================================================================================================== -->
-<a id="BeanContext_Api"></a>
-<h2 class='topic' onclick='toggle(this)'>1 - Bean Context API</h2>
-<div class='topic'>
- <p>
- The {@link org.apache.juneau.BeanContext} class is the core class in the Juneau architecture. It serves
- multiple functions...
- </p>
- <ul class='normal'>
- <li>It provides the ability to create instances of {@link org.apache.juneau.BeanMap BeanMaps}.
- <li>It serves as a repository for {@link org.apache.juneau.transform.BeanFilter BeanFilters} and
- {@link org.apache.juneau.transform.PojoSwap PojoSwaps}, which are used to tailor how Java objects are
- handled.
- <li>It's used by all built-in {@link org.apache.juneau.serializer.Serializer Serializers} and
- {@link org.apache.juneau.parser.Parser Parsers} for working with POJOs in a consistent way.
- </ul>
-
- <!-- ======================================================================================================== -->
- <a id="BeanMap"></a>
- <h3 class='topic' onclick='toggle(this)'>1.1 - The BeanMap class</h3>
- <div class='topic'>
- <p>
- The {@link org.apache.juneau.BeanMap} class allows you to access the properties of a bean through the
- familiar {@code Map} interface.
- So, for example, you can use the {@code Map.get(key)} method to retrieve a property value in lieu of it's
- getter method, and the {@code Map.put(key, value)} method to set a property value in lieu of it's
- setter method.
- </p>
- <p>
- The serialization and parsing of beans in Juneau is accomplished by wrapping Java beans inside instances of
- the class {@code BeanMap}.
- </p>
- <p>
- <b>Note:</b> Instances of {@link org.apache.juneau.BeanMap} objects are always retrieved through the
- {@link org.apache.juneau.BeanContext} class. You cannot instantiate {@code BeanMaps} directly since the
- rules for defining what constitutes a bean depend on various settings in the bean context.
- </p>
- <p>
- In general, the performance on using the {@link org.apache.juneau.BeanMap} class to access properties is
- equivalent to using reflection directly.
- </p>
- <p>
- See the {@link org.apache.juneau.BeanMap} javadoc for more information.
- </p>
- </div>
-
- <!-- ======================================================================================================== -->
- <a id="BeanContext"></a>
- <h3 class='topic' onclick='toggle(this)'>1.2 - The BeanContext and BeanSession classes</h3>
- <div class='topic'>
- <p>
- The {@link org.apache.juneau.BeanContext} and {@link org.apache.juneau.BeanSession} classes are the
- workhorse class used to wrap Java beans inside {@link org.apache.juneau.BeanMap BeanMaps}.
- There are several options provided on the {@link org.apache.juneau.BeanContext} class to tailor the
- definition of a bean.
- </p>
- <p>
- The following is a very simple example of how to wrap a bean inside a {@link org.apache.juneau.BeanMap}
- wrapper and use the wrapper interface to get and set property values on the bean.
- In this case, we're using the DEFAULT bean context.
- </p>
- <p class='bcode'>
- <jc>// A sample pseudo bean class.</jc>
- <jk>public class</jk> Person {
- <jk>public</jk> String getName();
- <jk>public void</jk> setName(String name);
- <jk>public int</jk> getAge();
- <jk>public void</jk> setAge(<jk>int</jk> age);
- }
-
- <jc>// Get an instance of a bean context.
- // In this case, just use the default bean context.</jc>
- BeanSession beanSession = BeanContext.<jsf>DEFAULT</jsf>.createSession();
-
- <jc>// Create an instance of our bean and wrap it in a bean map.</jc>
- Person p = <jk>new</jk> Person();
- BeanMap<Person> m = beanSession.toBeanMap(p);
-
- <jc>// Set some properties on the bean.</jc>
- m.put(<js>"name"</js>, <js>"John Smith"</js>);
- m.put(<js>"age"</js>, 21);
-
- <jc>// Print out bean properties.</jc>
- System.out.println(m.get(<js>"name"</js>)); <jc>// Prints "John Smith"</jc>
- System.out.println(p.getName()); <jc>// Prints "John Smith"</jc>
- System.out.println(m.get(<js>"age"</js>)); <jc>// Prints 21</jc>
- System.out.println(p.getAge()); <jc>// Prints 21</jc>
-
- <jc>// The bean context class can also create instances of bean maps.</jc>
- m = beanContext.newBeanMap(Person.<jk>class</jk>);
- p = m.getBean(); <jc>// Get the new wrapped bean.</jc>
-
- <jc>// The bean context class can also create instances of beans.</jc>
- p = beanContext.newBean(Person.<jk>class</jk>);
- </p>
- <p>
- There are 2 ways to get an instance of a {@link org.apache.juneau.BeanContext}:
- </p>
- <p class='bcode'>
- <jc>// Use one of the default bean contexts.</jc>
- BeanContext beanContext = BeanContext.<jsf>DEFAULT</jsf>;
-
- <jc>// Use the PropertyStore class.</jc>
- beanContext = <jk>new</jk> PropertyStore().pojoSwaps(DateSwap.ISO8601DT.<jk>class</jk>).getBeanContext();
- </p>
- <p>
- The {@link org.apache.juneau.BeanContext} class is a highly-customizable class.
- See the {@link org.apache.juneau.BeanContext} javadoc for more information.
- </p>
- </div>
-
- <!-- ======================================================================================================== -->
- <a id="Bean"></a>
- <h3 class='topic' onclick='toggle(this)'>1.3 - Bean annotations</h3>
- <div class='topic'>
- <p>
- Juneau provides the following annotations that can be used to fine-tune what properties are associated with
- beans:
- </p>
- <ul class='normal'>
- <li>{@link org.apache.juneau.annotation.Bean @Bean} - Fine-tune properties associated with beans.
- <li>{@link org.apache.juneau.annotation.BeanProperty @BeanProperty} - Fine-tune bean properties
- (fields / getters / setters).
- <li>{@link org.apache.juneau.annotation.BeanConstructor @BeanConstructor} - Define read-only bean properties that can only
- be set through constructor arguments.
- <li>{@link org.apache.juneau.annotation.BeanIgnore @BeanIgnore} - Prevent bean classes/methods/fields from being
- interpreted as bean constructs.
- </ul>
- <p>
- These annotations always override the settings defined in the {@link org.apache.juneau.BeanContext} class.
- </p>
- <p>
- For example, the following bean class will only have one property associated with it, <js>"name"</js>,
- since it's the only one listed in the list of properties.
- </p>
- <p class='bcode'>
- <jc>// Bean with only one 'name' property</jc>
- <ja>@Bean</ja>(properties=<js>"name"</js>)
- <jk>public class</jk> Person {
- <jk>public</jk> String getName();
- <jk>public void</jk> setName(String name);
- <jk>public int</jk> getAge();
- <jk>public void</jk> setAge(<jk>int</jk> age);
- }
- </p>
- <p>
- When this bean is serialized using one of the {@link org.apache.juneau.serializer.Serializer Serializers},
- the age property will be ignored.
- </p>
- <p>
- Using the <ja>@Bean</ja> and <ja>@BeanProperty</ja> annotations, it's also possible to include non-standard
- properties (for example, getters or setters with non-standard names), or override the names of properties
- (for example, {@code "Name"} or {@code "fullName"} instead of {@code "name"}).
- </p>
- <p>
- It should be noted that the {@link org.apache.juneau.transform.BeanFilter} class can also be used to
- exclude properties from beans.
- However, only the annotations can be used to include non-standard properties or override property names.
- </p>
- <p>
- See the {@link org.apache.juneau.annotation.Bean @Bean}, {@link org.apache.juneau.annotation.BeanProperty @BeanProperty},
- {@link org.apache.juneau.annotation.BeanConstructor @BeanConstructor}, and {@link org.apache.juneau.annotation.BeanIgnore @BeanIgnore}
- javadocs for more information.
- </p>
- </div>
-</div>
-
</body>
</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/juneau/blob/0ab0b231/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/Parser.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/Parser.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/Parser.java
index a19d7fd..de8900a 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/Parser.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/Parser.java
@@ -14,6 +14,7 @@ package org.apache.juneau.parser;
import java.io.*;
import java.lang.reflect.*;
+import java.nio.charset.*;
import java.util.*;
import org.apache.juneau.*;
@@ -97,7 +98,8 @@ import org.apache.juneau.utils.*;
* following syntax...
* <p class='bcode'>
* Calendar c = parser.parse(<js>"'Sun Mar 03 04:05:06 EST 2001'"</js>, GregorianCalendar.<jk>class</jk>);
- *
+ * </p>
+ *
* <p>
* If <code>Object.<jk>class</jk></code> is specified as the target type, then the parser automatically determines the
* data types and generates the following object types...
@@ -110,26 +112,6 @@ import org.apache.juneau.utils.*;
* <tr><td>boolean</td><td>{@link Boolean}</td></tr>
* <tr><td>string</td><td>{@link String}</td></tr>
* </table>
- *
- * <a id='SupportedTypes'></a>
- * <h6 class='topic'>Supported types</h6>
- *
- * Several of the methods below take {@link Type} parameters to identify the type of object to create.
- * Any of the following types can be passed in to these methods...
- * <ul>
- * <li>{@link ClassMeta}
- * <li>{@link Class}
- * <li>{@link ParameterizedType}
- * <li>{@link GenericArrayType}
- * </ul>
- *
- * <p>
- * However, {@code ParameterizedTypes} and {@code GenericArrayTypes} should not contain
- * {@link WildcardType WildcardTypes} or {@link TypeVariable TypeVariables}.
- *
- * <p>
- * Passing in <jk>null</jk> or <code>Object.<jk>class</jk></code> typically signifies that it's up to the parser
- * to determine what object type is being parsed parsed based on the rules above.
*/
public abstract class Parser extends BeanContext {
@@ -142,7 +124,7 @@ public abstract class Parser extends BeanContext {
/**
* Configuration property: File charset.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"Parser.fileCharset.s"</js>
* <li><b>Data type:</b> <code>String</code>
@@ -151,10 +133,11 @@ public abstract class Parser extends BeanContext {
* <li><b>Methods:</b>
* <ul>
* <li class='jm'>{@link ParserBuilder#fileCharset(String)}
+ * <li class='jm'>{@link ParserBuilder#fileCharset(Charset)}
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* The character set to use for reading <code>Files</code> from the file system.
*
@@ -162,14 +145,32 @@ public abstract class Parser extends BeanContext {
* Used when passing in files to {@link Parser#parse(Object, Class)}.
*
* <p>
- * <js>"default"</js> can be used to indicate the JVM default file system charset.
+ * <js>"DEFAULT"</js> can be used to indicate the JVM default file system charset.
+ *
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode'>
+ * <jc>// Create a parser that reads UTF-8 files.</jc>
+ * ReaderParser p = JsonParser.
+ * .<jsm>create</jsm>()
+ * .fileCharset(<js>"UTF-8"</js>)
+ * .build();
+ *
+ * <jc>// Same, but use property.</jc>
+ * ReaderParser p = JsonParser.
+ * .<jsm>create</jsm>()
+ * .set(<jsf>PARSER_fileCharset</jsf>, <js>"UTF-8"</js>)
+ * .build();
+ *
+ * <jc>// Use it to read a UTF-8 encoded file.</jc>
+ * MyBean myBean = p.parse(<jk>new</jk> File(<js>"MyBean.txt"</js>), MyBean.<jk>class</jk>);
+ * </p>
*/
public static final String PARSER_fileCharset = PREFIX + "fileCharset.s";
/**
* Configuration property: Input stream charset.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"Parser.inputStreamCharset.s"</js>
* <li><b>Data type:</b> <code>String</code>
@@ -178,22 +179,41 @@ public abstract class Parser extends BeanContext {
* <li><b>Methods:</b>
* <ul>
* <li class='jm'>{@link ParserBuilder#inputStreamCharset(String)}
+ * <li class='jm'>{@link ParserBuilder#inputStreamCharset(Charset)}
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* The character set to use for converting <code>InputStreams</code> and byte arrays to readers.
*
* <p>
* Used when passing in input streams and byte arrays to {@link Parser#parse(Object, Class)}.
+ *
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode'>
+ * <jc>// Create a parser that reads UTF-8 files.</jc>
+ * ReaderParser p = JsonParser.
+ * .<jsm>create</jsm>()
+ * .inputStreamCharset(<js>"UTF-8"</js>)
+ * .build();
+ *
+ * <jc>// Same, but use property.</jc>
+ * ReaderParser p = JsonParser.
+ * .<jsm>create</jsm>()
+ * .set(<jsf>PARSER_inputStreamCharset</jsf>, <js>"UTF-8"</js>)
+ * .build();
+ *
+ * <jc>// Use it to read a UTF-8 encoded input stream.</jc>
+ * MyBean myBean = p.parse(<jk>new</jk> FileInputStream(<js>"MyBean.txt"</js>), MyBean.<jk>class</jk>);
+ * </p>
*/
public static final String PARSER_inputStreamCharset = PREFIX + "inputStreamCharset.s";
/**
* Configuration property: Parser listener.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"Parser.listener.c"</js>
* <li><b>Data type:</b> <code>Class<? extends ParserListener></code>
@@ -205,16 +225,58 @@ public abstract class Parser extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Class used to listen for errors and warnings that occur during parsing.
+ *
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode'>
+ * <jc>// Define our parser listener.</jc>
+ * <jc>// Simply captures all unknown bean property events.</jc>
+ * <jk>public class</jk> MyParserListener <jk>extends</jk> ParserListener {
+ *
+ * <jc>// A simple property to store our events.</jc>
+ * <jk>public</jk> List<String> <jf>events</jf> = <jk>new</jk> LinkedList<>();
+ *
+ * <ja>@Override</ja>
+ * <jk>public</jk> <T> <jk>void</jk> onUnknownBeanProperty(ParserSession session, ParserPipe pipe, String propertyName, Class<T> beanClass, T bean, <jk>int</jk> line, <jk>int</jk> col) {
+ * <jf>events</jf>.add(propertyName + <js>","</js> + line + <js>","</js> + col);
+ * }
+ * }
+ *
+ * <jc>// Create a parser using our listener.</jc>
+ * ReaderParser p = JsonParser.
+ * .<jsm>create</jsm>()
+ * .listener(MyParserListener.<jk>class</jk>)
+ * .build();
+ *
+ * <jc>// Same, but use property.</jc>
+ * ReaderParser p = JsonParser.
+ * .<jsm>create</jsm>()
+ * .set(<jsf>PARSER_listener</jsf>, MyParserListener.<jk>class</jk>)
+ * .build();
+ *
+ * <jc>// Create a session object.</jc>
+ * <jc>// Needed because listeners are created per-session.</jc>
+ * <jk>try</jk> (ReaderParserSession s = p.createSession()) {
+ *
+ * <jc>// Parse some JSON object.</jc>
+ * MyBean myBean = s.parse(<js>"{...}"</js>, MyBean.<jk>class</jk>);
+ *
+ * <jc>// Get the listener.</jc>
+ * MyParserListener l = s.getListener(MyParserListener.<jk>class</jk>);
+ *
+ * <jc>// Dump the results to the console.</jc>
+ * JsonSerializer.<jsf>DEFAULT_LAX</jsf>.println(l.<jf>events</jf>);
+ * }
+ * </p>
*/
public static final String PARSER_listener = PREFIX + "listener.c";
/**
* Configuration property: Strict mode.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"Parser.strict.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -227,7 +289,7 @@ public abstract class Parser extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* If <jk>true</jk>, strict mode for the parser is enabled.
*
@@ -258,13 +320,36 @@ public abstract class Parser extends BeanContext {
* </td>
* </tr>
* </table>
+ *
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode'>
+ * <jc>// Create a parser using strict mode.</jc>
+ * ReaderParser p = JsonParser.
+ * .<jsm>create</jsm>()
+ * .strict()
+ * .build();
+ *
+ * <jc>// Same, but use property.</jc>
+ * ReaderParser p = JsonParser.
+ * .<jsm>create</jsm>()
+ * .set(<jsf>PARSER_strict</jsf>, <jk>true</jk>)
+ * .build();
+ *
+ * <jc>// Use it.</jc>
+ * <jk>try</jk> {
+ * String json = <js>"{unquotedAttr:'value'}"</js>;
+ * MyBean myBean = p.parse(json, MyBean.<jk>class</jk>);
+ * } <jk>catch</jk> (ParseException e) {
+ * <jsm>assertTrue</jsm>(e.getMessage().contains(<js>"Unquoted attribute detected."</js>);
+ * }
+ * </p>
*/
public static final String PARSER_strict = PREFIX + "strict.b";
/**
* Configuration property: Trim parsed strings.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"Parser.trimStrings.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -277,10 +362,30 @@ public abstract class Parser extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* If <jk>true</jk>, string values will be trimmed of whitespace using {@link String#trim()} before being added to
* the POJO.
+ *
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode'>
+ * <jc>// Create a parser with trim-strings enabled.</jc>
+ * ReaderParser p = JsonParser.
+ * .<jsm>create</jsm>()
+ * .trimStrings()
+ * .build();
+ *
+ * <jc>// Same, but use property.</jc>
+ * ReaderParser p = JsonParser.
+ * .<jsm>create</jsm>()
+ * .set(<jsf>PARSER_trimStrings</jsf>, <jk>true</jk>)
+ * .build();
+ *
+ * <jc>// Use it.</jc>
+ * String json = <js>"{foo:' bar '}"</js>;
+ * Map<String,String> m = p.parse(json, HashMap.<jk>class</jk>, String.<jk>class</jk>, String.<jk>class</jk>);
+ * <jsm>assertEquals</jsm>(<js>"bar"</js>, m.get(<js>"foo"</js>));
+ * </p>
*/
public static final String PARSER_trimStrings = PREFIX + "trimStrings.b";
http://git-wip-us.apache.org/repos/asf/juneau/blob/0ab0b231/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/ParserBuilder.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/ParserBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/ParserBuilder.java
index 0c5d083..290270d 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/ParserBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/ParserBuilder.java
@@ -14,6 +14,7 @@ package org.apache.juneau.parser;
import static org.apache.juneau.parser.Parser.*;
+import java.nio.charset.*;
import java.util.*;
import org.apache.juneau.*;
@@ -65,6 +66,26 @@ public class ParserBuilder extends BeanContextBuilder {
}
/**
+ * Configuration property: File charset.
+ *
+ * <p>
+ * The character set to use for reading <code>Files</code> from the file system.
+ *
+ * <h5 class='section'>See Also:</h5>
+ * <ul>
+ * <li class='jf'>{@link Parser#PARSER_fileCharset}
+ * </ul>
+ *
+ * @param value
+ * The new value for this property.
+ * <br>The default value is <js>"DEFAULT"</js> which causes the system default to be used.
+ * @return This object (for method chaining).
+ */
+ public ParserBuilder fileCharset(Charset value) {
+ return set(PARSER_fileCharset, value);
+ }
+
+ /**
* Configuration property: Input stream charset.
*
* <p>
@@ -85,6 +106,26 @@ public class ParserBuilder extends BeanContextBuilder {
}
/**
+ * Configuration property: Input stream charset.
+ *
+ * <p>
+ * The character set to use for converting <code>InputStreams</code> and byte arrays to readers.
+ *
+ * <h5 class='section'>See Also:</h5>
+ * <ul>
+ * <li class='jf'>{@link Parser#PARSER_inputStreamCharset}
+ * </ul>
+ *
+ * @param value
+ * The new value for this property.
+ * <br>The default value is <js>"UTF-8"</js>.
+ * @return This object (for method chaining).
+ */
+ public ParserBuilder inputStreamCharset(Charset value) {
+ return set(PARSER_inputStreamCharset, value);
+ }
+
+ /**
* Configuration property: Parser listener.
*
* <p>
http://git-wip-us.apache.org/repos/asf/juneau/blob/0ab0b231/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/ParserSession.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/ParserSession.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/ParserSession.java
index 853cce2..2fa3b2b 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/ParserSession.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/ParserSession.java
@@ -747,4 +747,24 @@ public abstract class ParserSession extends BeanSession {
m.set(o, name);
}
}
+
+ /**
+ * Returns the listener associated with this session.
+ *
+ * @return The listener associated with this session, or <jk>null</jk> if there is no listener.
+ */
+ public ParserListener getListener() {
+ return listener;
+ }
+
+ /**
+ * Returns the listener associated with this session.
+ *
+ * @param c The listener class to cast to.
+ * @return The listener associated with this session, or <jk>null</jk> if there is no listener.
+ */
+ @SuppressWarnings("unchecked")
+ public <T extends ParserListener> T getListener(Class<T> c) {
+ return (T)listener;
+ }
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/0ab0b231/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/ParserSessionArgs.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/ParserSessionArgs.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/ParserSessionArgs.java
index 8e43052..caa16b7 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/ParserSessionArgs.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/ParserSessionArgs.java
@@ -23,28 +23,33 @@ import org.apache.juneau.http.*;
*/
public final class ParserSessionArgs extends BeanSessionArgs {
- final Method javaMethod;
- final Object outer;
+ Method javaMethod;
+ Object outer;
+
+ /**
+ * Constructor
+ */
+ public ParserSessionArgs() {}
/**
* Constructor.
*
* @param properties
* Session-level properties.
- * These override context-level properties.
- * Can be <jk>null</jk>.
+ * <br>These override context-level properties.
+ * <br>Can be <jk>null</jk>.
* @param javaMethod
* The java method that called this serializer, usually the method in a REST servlet.
- * Can be <jk>null</jk>.
+ * <br>Can be <jk>null</jk>.
* @param locale
* The session locale.
- * If <jk>null</jk>, then the locale defined on the context is used.
+ * <br>If <jk>null</jk>, then the locale defined on the context is used.
* @param timeZone
* The session timezone.
- * If <jk>null</jk>, then the timezone defined on the context is used.
+ * <br>If <jk>null</jk>, then the timezone defined on the context is used.
* @param mediaType
* The session media type (e.g. <js>"application/json"</js>).
- * Can be <jk>null</jk>.
+ * <br>Can be <jk>null</jk>.
* @param outer
* The outer object for instantiating top-level non-static inner classes.
*/
@@ -53,4 +58,54 @@ public final class ParserSessionArgs extends BeanSessionArgs {
this.javaMethod = javaMethod;
this.outer = outer;
}
+
+
+ /**
+ * The java method that called this serializer, usually the method in a REST servlet.
+ *
+ * @param javaMethod
+ * The java method that called this serializer, usually the method in a REST servlet.
+ * <br>Can be <jk>null</jk>.
+ * @return This object (for method chaining).
+ */
+ public ParserSessionArgs javaMethod(Method javaMethod) {
+ this.javaMethod = javaMethod;
+ return this;
+ }
+
+ /**
+ * The outer object for instantiating top-level non-static inner classes.
+ *
+ * @param outer
+ * The outer object for instantiating top-level non-static inner classes.
+ * @return This object (for method chaining).
+ */
+ public ParserSessionArgs outer(Object outer) {
+ this.outer = outer;
+ return this;
+ }
+
+ @Override /* BeanSessionArgs */
+ public ParserSessionArgs locale(Locale locale) {
+ super.locale(locale);
+ return this;
+ }
+
+ @Override /* BeanSessionArgs */
+ public ParserSessionArgs timeZone(TimeZone timeZone) {
+ super.timeZone(timeZone);
+ return this;
+ }
+
+ @Override /* BeanSessionArgs */
+ public ParserSessionArgs mediaType(MediaType mediaType) {
+ super.mediaType(mediaType);
+ return this;
+ }
+
+ @Override /* SessionArgs */
+ public ParserSessionArgs properties(ObjectMap properties) {
+ super.properties(properties);
+ return this;
+ }
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/juneau/blob/0ab0b231/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/Serializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/Serializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/Serializer.java
index a283aa8..a092a88 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/Serializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/Serializer.java
@@ -17,6 +17,7 @@ import java.io.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
import org.apache.juneau.http.*;
+import org.apache.juneau.parser.*;
/**
* Parent class for all Juneau serializers.
@@ -48,7 +49,7 @@ public abstract class Serializer extends BeanContext {
/**
* Configuration property: Abridged output.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"Serializer.abridged.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -61,21 +62,53 @@ public abstract class Serializer extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* When enabled, it is assumed that the parser knows the exact Java POJO type being parsed, and therefore top-level
* type information that might normally be included to determine the data type will not be serialized.
*
* <p>
- * For example, when serializing a POJO with a {@link Bean#typeName() @Bean.typeName()} value, a <js>"_type"</js> will be added when
- * this setting is disabled, but not added when it is enabled.
+ * For example, when serializing a top-level POJO with a {@link Bean#typeName() @Bean.typeName()} value, a
+ * <js>'_type'</js> attribute will only be added when this setting is enabled.
+ *
+ * <p>
+ * Note the differences between the following settings:
+ * <ul>
+ * <li class='jf'>{@link #SERIALIZER_abridged} - Affects whether <js>'_type'</js> is added to root node.
+ * <li class='jf'>{@link #SERIALIZER_addBeanTypeProperties} - Affects whether <js>'_type'</js> is added to any nodes.
+ * </ul>
+ *
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode'>
+ * <jc>// Create a serializer that doesn't add _type to root node.</jc>
+ * WriterSerializer s = JsonSerializer
+ * .<jsm>create</jsm>()
+ * .abridged()
+ * .build();
+ *
+ * <jc>// Same, but use property.</jc>
+ * WriterSerializer s = JsonSerializer
+ * .<jsm>create</jsm>()
+ * .set(<jsf>SERIALIZER_abridged</jsf>, <jk>true</jk>)
+ * .build();
+ *
+ * <jc>// The bean we want to serialize.</jc>
+ * <ja>@Bean</ja>(typeName=<js>"mybean"</js>)
+ * <jk>public class</jk> MyBean {...}
+ *
+ * <jc>// Will not contain '_type' attribute even though there's a type name on the bean.</jc>
+ * String json = s.serialize(<jk>new</jk> MyBean());
+ *
+ * <jc>// '_type' wasn't needed on the parse side because we know the type being parsed.</jc>
+ * MyBean myBean = JsonParser.<jsf>DEFAULT</jsf>.parse(json, MyBean.<jk>class</jk>);
+ * </p>
*/
public static final String SERIALIZER_abridged = PREFIX + "abridged.b";
/**
* Configuration property: Add <js>"_type"</js> properties when needed.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"Serializer.addBeanTypeProperties.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -87,22 +120,55 @@ public abstract class Serializer extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* If <jk>true</jk>, then <js>"_type"</js> properties will be added to beans if their type cannot be inferred
* through reflection.
*
* <p>
* This is used to recreate the correct objects during parsing if the object types cannot be inferred.
- * For example, when serializing a {@code Map<String,Object>} field, where the bean class cannot be determined from
- * the value type.
+ * <br>For example, when serializing a {@code Map<String,Object>} field where the bean class cannot be determined from
+ * the type of the values.
+ *
+ * <p>
+ * Note the differences between the following settings:
+ * <ul>
+ * <li class='jf'>{@link #SERIALIZER_abridged} - Affects whether <js>'_type'</js> is added to root node.
+ * <li class='jf'>{@link #SERIALIZER_addBeanTypeProperties} - Affects whether <js>'_type'</js> is added to any nodes.
+ * </ul>
+ *
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode'>
+ * <jc>// Create a serializer that never adds _type to nodes.</jc>
+ * WriterSerializer s = JsonSerializer
+ * .<jsm>create</jsm>()
+ * .addBeanTypeProperties(<jk>false</jk>)
+ * .build();
+ *
+ * <jc>// Same, but use property.</jc>
+ * WriterSerializer s = JsonSerializer
+ * .<jsm>create</jsm>()
+ * .set(<jsf>SERIALIZER_addBeanTypeProperties</jsf>, <jk>false</jk>)
+ * .build();
+ *
+ * <jc>// A map of objects we want to serialize.</jc>
+ * <ja>@Bean</ja>(typeName=<js>"mybean"</js>)
+ * <jk>public class</jk> MyBean {...}
+ *
+ * Map<String,Object> m = new HashMap<>();
+ * m.put(<js>"foo"</js>, <jk>new</jk> MyBean());
+ *
+ * <jc>// Will not contain '_type' attribute even though type name is on bean and we're serializing</jc>
+ * <jc>// a map of generic objects.</jc>
+ * String json = s.serialize(m);
+ * </p>
*/
public static final String SERIALIZER_addBeanTypeProperties = PREFIX + "addBeanTypeProperties.b";
/**
* Configuration property: Automatically detect POJO recursions.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"Serializer.detectRecursions.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -115,12 +181,14 @@ public abstract class Serializer extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Specifies that recursions should be checked for during serialization.
*
* <p>
- * Recursions can occur when serializing models that aren't true trees, but rather contain loops.
+ * Recursions can occur when serializing models that aren't true trees but rather contain loops.
+ * <br>In general, unchecked recursions cause stack-overflow-errors.
+ * <br>These show up as {@link ParseException ParseExceptions} with the message <js>"Depth too deep. Stack overflow occurred."</js>.
*
* <p>
* The behavior when recursions are detected depends on the value for {@link #SERIALIZER_ignoreRecursions}.
@@ -128,19 +196,49 @@ public abstract class Serializer extends BeanContext {
* <p>
* For example, if a model contains the links A->B->C->A, then the JSON generated will look like
* the following when <jsf>SERIALIZER_ignoreRecursions</jsf> is <jk>true</jk>...
- * <code>{A:{B:{C:null}}}</code>
+ *
+ * <p class='bcode'>
+ * {A:{B:{C:<jk>null</jk>}}}
+ * </p>
*
* <h5 class='section'>Notes:</h5>
* <ul>
* <li>Checking for recursion can cause a small performance penalty.
* </ul>
+ *
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode'>
+ * <jc>// Create a serializer that never adds _type to nodes.</jc>
+ * WriterSerializer s = JsonSerializer
+ * .<jsm>create</jsm>()
+ * .detectRecursions()
+ * .ignoreRecursions()
+ * .build();
+ *
+ * <jc>// Same, but use property.</jc>
+ * WriterSerializer s = JsonSerializer
+ * .<jsm>create</jsm>()
+ * .set(<jsf>SERIALIZER_detectRecursions</jsf>, <jk>true</jk>)
+ * .set(<jsf>SERIALIZER_ignoreRecursions</jsf>, <jk>true</jk>)
+ * .build();
+ *
+ * <jc>// Create a POJO model with a recursive loop.</jc>
+ * <jk>public class</jk> A {
+ * <jk>public</jk> Object <jf>f</jf>;
+ * }
+ * A a = <jk>new</jk> A();
+ * a.<jf>f</jf> = a;
+ *
+ * <jc>// Produces "{f:null}"</jc>
+ * String json = s.serialize(a);
+ * </p>
*/
public static final String SERIALIZER_detectRecursions = PREFIX + "detectRecursions.b";
/**
* Configuration property: Ignore recursion errors.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"Serializer.ignoreRecursions.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -153,21 +251,21 @@ public abstract class Serializer extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Used in conjunction with {@link #SERIALIZER_detectRecursions}.
* <br>Setting is ignored if <jsf>SERIALIZER_detectRecursions</jsf> is <jk>false</jk>.
*
* <p>
* If <jk>true</jk>, when we encounter the same object when serializing a tree, we set the value to <jk>null</jk>.
- * Otherwise, an exception is thrown.
+ * <br>Otherwise, a {@link SerializeException} is thrown with the message <js>"Recursion occurred, stack=..."</js>.
*/
public static final String SERIALIZER_ignoreRecursions = PREFIX + "ignoreRecursions.b";
/**
* Configuration property: Initial depth.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"Serializer.initialDepth.i"</js>
* <li><b>Data type:</b> <code>Integer</code>
@@ -179,17 +277,37 @@ public abstract class Serializer extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* The initial indentation level at the root.
- * Useful when constructing document fragments that need to be indented at a certain level.
+ * <br>Useful when constructing document fragments that need to be indented at a certain level.
+ *
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode'>
+ * <jc>// Create a serializer with whitespace enabled and an initial depth of 2.</jc>
+ * WriterSerializer s = JsonSerializer
+ * .<jsm>create</jsm>()
+ * .ws()
+ * .initialDepth(2)
+ * .build();
+ *
+ * <jc>// Same, but use property.</jc>
+ * WriterSerializer s = JsonSerializer
+ * .<jsm>create</jsm>()
+ * .set(<jsf>SERIALIZER_useWhitespace</jsf>, <jk>true</jk>)
+ * .set(<jsf>SERIALIZER_initialDepth</jsf>, 2)
+ * .build();
+ *
+ * <jc>// Produces "\t\t{\n\t\t\t'foo':'bar'\n\t\t}\n"</jc>
+ * String json = s.serialize(<jk>new</jk> MyBean());
+ * </p>
*/
public static final String SERIALIZER_initialDepth = PREFIX + "initialDepth.i";
/**
* Configuration property: Serializer listener.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"Serializer.listener.c"</js>
* <li><b>Data type:</b> <code>Class<? extends SerializerListener></code>
@@ -201,16 +319,58 @@ public abstract class Serializer extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Class used to listen for errors and warnings that occur during serialization.
+ *
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode'>
+ * <jc>// Define our serializer listener.</jc>
+ * <jc>// Simply captures all errors.</jc>
+ * <jk>public class</jk> MySerializerListener <jk>extends</jk> SerializerListener {
+ *
+ * <jc>// A simple property to store our events.</jc>
+ * <jk>public</jk> List<String> <jf>events</jf> = <jk>new</jk> LinkedList<>();
+ *
+ * <ja>@Override</ja>
+ * <jk>public</jk> <T> <jk>void</jk> onError(SerializerSession session, Throwable t, String msg) {
+ * <jf>events</jf>.add(session.getLastLocation() + <js>","</js> + msg + <js>","</js> + t);
+ * }
+ * }
+ *
+ * <jc>// Create a serializer using our listener.</jc>
+ * WriterSerializer s = JsonSerializer.
+ * .<jsm>create</jsm>()
+ * .listener(MySerializerListener.<jk>class</jk>)
+ * .build();
+ *
+ * <jc>// Same, but use property.</jc>
+ * WriterSerializer s = JsonSerializer.
+ * .<jsm>create</jsm>()
+ * .set(<jsf>SERIALIZER_listener</jsf>, MySerializerListener.<jk>class</jk>)
+ * .build();
+ *
+ * <jc>// Create a session object.</jc>
+ * <jc>// Needed because listeners are created per-session.</jc>
+ * <jk>try</jk> (WriterSerializerSession ss = s.createSession()) {
+ *
+ * <jc>// Serialize a bean.</jc>
+ * String json = ss.serialize(<jk>new</jk> MyBean());
+ *
+ * <jc>// Get the listener.</jc>
+ * MySerializerListener l = ss.getListener(MySerializerListener.<jk>class</jk>);
+ *
+ * <jc>// Dump the results to the console.</jc>
+ * JsonSerializer.<jsf>DEFAULT_LAX</jsf>.println(l.<jf>events</jf>);
+ * }
+ * </p>
*/
public static final String SERIALIZER_listener = PREFIX + "listener.c";
/**
* Configuration property: Max serialization depth.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"Serializer.maxDepth.i"</js>
* <li><b>Data type:</b> <code>Integer</code>
@@ -222,18 +382,32 @@ public abstract class Serializer extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Abort serialization if specified depth is reached in the POJO tree.
- * If this depth is exceeded, an exception is thrown.
- * This prevents stack overflows from occurring when trying to serialize models with recursive references.
+ * <br>If this depth is exceeded, an exception is thrown.
+ *
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode'>
+ * <jc>// Create a serializer that throws an exception if the depth is greater than 20.</jc>
+ * WriterSerializer s = JsonSerializer
+ * .<jsm>create</jsm>()
+ * .maxDepth(20)
+ * .build();
+ *
+ * <jc>// Same, but use property.</jc>
+ * WriterSerializer s = JsonSerializer
+ * .<jsm>create</jsm>()
+ * .set(<jsf>SERIALIZER_maxDepth</jsf>, 20)
+ * .build();
+ * </p>
*/
public static final String SERIALIZER_maxDepth = PREFIX + "maxDepth.i";
/**
* Configuration property: Maximum indentation.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"Serializer.maxIndent.i"</js>
* <li><b>Data type:</b> <code>Integer</code>
@@ -245,19 +419,34 @@ public abstract class Serializer extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Specifies the maximum indentation level in the serialized document.
*
* <p>
* This setting does not apply to the MessagePack or RDF serializers.
+ *
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode'>
+ * <jc>// Create a serializer that indents a maximum of 20 tabs.</jc>
+ * WriterSerializer s = JsonSerializer
+ * .<jsm>create</jsm>()
+ * .maxIndent(20)
+ * .build();
+ *
+ * <jc>// Same, but use property.</jc>
+ * WriterSerializer s = JsonSerializer
+ * .<jsm>create</jsm>()
+ * .set(<jsf>SERIALIZER_maxIndent</jsf>, 20)
+ * .build();
+ * </p>
*/
public static final String SERIALIZER_maxIndent = PREFIX + "maxIndent.i";
/**
* Configuration property: Quote character.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"Serializer.quoteChar.s"</js>
* <li><b>Data type:</b> <code>String</code>
@@ -270,19 +459,34 @@ public abstract class Serializer extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* This is the character used for quoting attributes and values.
*
* <p>
* This setting does not apply to the MessagePack or RDF serializers.
+ *
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode'>
+ * <jc>// Create a serializer that uses single quotes.</jc>
+ * WriterSerializer s = JsonSerializer
+ * .<jsm>create</jsm>()
+ * .sq()
+ * .build();
+ *
+ * <jc>// Same, but use property.</jc>
+ * WriterSerializer s = JsonSerializer
+ * .<jsm>create</jsm>()
+ * .set(<jsf>SERIALIZER_quoteChar</jsf>, <js>'\''</js>)
+ * .build();
+ * </p>
*/
public static final String SERIALIZER_quoteChar = PREFIX + "quoteChar.s";
/**
* Configuration property: Sort arrays and collections alphabetically.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"Serializer.sortCollections.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -295,20 +499,35 @@ public abstract class Serializer extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
*
* <p>
* Copies and sorts the contents of arrays and collections before serializing them.
*
* <p>
* Note that this introduces a performance penalty.
+ *
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode'>
+ * <jc>// Create a serializer that sorts arrays and collections before serialization.</jc>
+ * WriterSerializer s = JsonSerializer
+ * .<jsm>create</jsm>()
+ * .sortCollections()
+ * .build();
+ *
+ * <jc>// Same, but use property.</jc>
+ * WriterSerializer s = JsonSerializer
+ * .<jsm>create</jsm>()
+ * .set(<jsf>SERIALIZER_sortCollections</jsf>, <jk>true</jk>)
+ * .build();
+ * </p>
*/
public static final String SERIALIZER_sortCollections = PREFIX + "sortCollections.b";
/**
* Configuration property: Sort maps alphabetically.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"Serializer.sortMaps.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -321,20 +540,35 @@ public abstract class Serializer extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
*
* <p>
- * Copies and sorts the contents of maps before serializing them.
+ * Copies and sorts the contents of maps by their keys before serializing them.
*
* <p>
* Note that this introduces a performance penalty.
+ *
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode'>
+ * <jc>// Create a serializer that sorts maps before serialization.</jc>
+ * WriterSerializer s = JsonSerializer
+ * .<jsm>create</jsm>()
+ * .sortMaps()
+ * .build();
+ *
+ * <jc>// Same, but use property.</jc>
+ * WriterSerializer s = JsonSerializer
+ * .<jsm>create</jsm>()
+ * .set(<jsf>SERIALIZER_sortMaps</jsf>, <jk>true</jk>)
+ * .build();
+ * </p>
*/
public static final String SERIALIZER_sortMaps = PREFIX + "sortMaps.b";
/**
* Configuration property: Trim empty lists and arrays.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"Serializer.trimEmptyCollections.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -347,10 +581,10 @@ public abstract class Serializer extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
*
* <p>
- * If <jk>true</jk>, empty list values will not be serialized to the output.
+ * If <jk>true</jk>, empty lists and arrays will not be serialized.
*
* <p>
* Note that enabling this setting has the following effects on parsing:
@@ -360,13 +594,28 @@ public abstract class Serializer extends BeanContext {
* <li>
* Bean properties with empty list values will not be set.
* </ul>
+ *
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode'>
+ * <jc>// Create a serializer that skips empty arrays and collections.</jc>
+ * WriterSerializer s = JsonSerializer
+ * .<jsm>create</jsm>()
+ * .trimEmptyCollections()
+ * .build();
+ *
+ * <jc>// Same, but use property.</jc>
+ * WriterSerializer s = JsonSerializer
+ * .<jsm>create</jsm>()
+ * .set(<jsf>SERIALIZER_trimEmptyCollections</jsf>, <jk>true</jk>)
+ * .build();
+ * </p>
*/
public static final String SERIALIZER_trimEmptyCollections = PREFIX + "trimEmptyCollections.b";
/**
* Configuration property: Trim empty maps.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"Serializer.trimEmptyMaps.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -379,7 +628,7 @@ public abstract class Serializer extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* If <jk>true</jk>, empty map values will not be serialized to the output.
*
@@ -389,13 +638,28 @@ public abstract class Serializer extends BeanContext {
* <li>
* Bean properties with empty map values will not be set.
* </ul>
+ *
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode'>
+ * <jc>// Create a serializer that skips empty maps.</jc>
+ * WriterSerializer s = JsonSerializer
+ * .<jsm>create</jsm>()
+ * .trimEmptyMaps()
+ * .build();
+ *
+ * <jc>// Same, but use property.</jc>
+ * WriterSerializer s = JsonSerializer
+ * .<jsm>create</jsm>()
+ * .set(<jsf>SERIALIZER_trimEmptyMaps</jsf>, <jk>true</jk>)
+ * .build();
+ * </p>
*/
public static final String SERIALIZER_trimEmptyMaps = PREFIX + "trimEmptyMaps.b";
/**
* Configuration property: Trim null bean property values.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"Serializer.trimNullProperties.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -407,7 +671,7 @@ public abstract class Serializer extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* If <jk>true</jk>, null bean values will not be serialized to the output.
*
@@ -417,13 +681,28 @@ public abstract class Serializer extends BeanContext {
* <li>
* Map entries with <jk>null</jk> values will be lost.
* </ul>
+ *
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode'>
+ * <jc>// Create a serializer that serializes null properties.</jc>
+ * WriterSerializer s = JsonSerializer
+ * .<jsm>create</jsm>()
+ * .trimNullProperties(<jk>false</jk>)
+ * .build();
+ *
+ * <jc>// Same, but use property.</jc>
+ * WriterSerializer s = JsonSerializer
+ * .<jsm>create</jsm>()
+ * .set(<jsf>SERIALIZER_trimNullProperties</jsf>, <jk>false</jk>)
+ * .build();
+ * </p>
*/
public static final String SERIALIZER_trimNullProperties = PREFIX + "trimNullProperties.b";
/**
* Configuration property: Trim strings.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"Serializer.trimStrings.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -436,16 +715,37 @@ public abstract class Serializer extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* If <jk>true</jk>, string values will be trimmed of whitespace using {@link String#trim()} before being serialized.
+ *
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode'>
+ * <jc>// Create a serializer that trims strings before serialization.</jc>
+ * WriterSerializer s = JsonSerializer
+ * .<jsm>create</jsm>()
+ * .trimStrings()
+ * .build();
+ *
+ * <jc>// Same, but use property.</jc>
+ * WriterSerializer s = JsonSerializer
+ * .<jsm>create</jsm>()
+ * .set(<jsf>SERIALIZER_trimStrings</jsf>, <jk>true</jk>)
+ * .build();
+ *
+ * Map<String,String> m = <jk>new</jk> HashMap<>();
+ * m.put(<js>" foo "</js>, <js>" bar "</js>);
+ *
+ * <jc>// Produces "{foo:'bar'}"</jc>
+ * String json = JsonSerializer.<jsf>DEFAULT_LAX</jsf>.toString(m);
+ * </p>
*/
public static final String SERIALIZER_trimStrings = PREFIX + "trimStrings.b";
/**
* Configuration property: URI context bean.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"Serializer.uriContext.s"</js>
* <li><b>Data type:</b> <code>String</code> (JSON object representing a {@link UriContext})
@@ -454,24 +754,61 @@ public abstract class Serializer extends BeanContext {
* <li><b>Methods:</b>
* <ul>
* <li class='jm'>{@link SerializerBuilder#uriContext(UriContext)}
+ * <li class='jm'>{@link SerializerBuilder#uriContext(String)}
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Bean used for resolution of URIs to absolute or root-relative form.
*
- * <h6 class='figure'>Example:</h6>
+ * <h5 class='section'>Example:</h5>
* <p class='bcode'>
- * <js>"{authority:'http://localhost:10000',contextRoot:'/myContext',servletPath:'/myServlet',pathInfo:'/foo'}"</js>
+ * <jc>// Our URI contextual information.</jc>
+ * String authority = <js>"http://localhost:10000"</js>;
+ * String contextRoot = <js>"/myContext"</js>;
+ * String servletPath = <js>"/myServlet"</js>;
+ * String pathInfo = <js>"/foo"</js>;
+ *
+ * <jc>// Create a UriContext object.</jc>
+ * UriContext uriContext = <jk>new</jk> UriContext(authority, contextRoot, servletPath, pathInfo);
+ *
+ * <jc>// Associate it with our serializer.</jc>
+ * WriterSerializer s = JsonSerializer
+ * .<jsm>create</jsm>()
+ * .uriContext(uriContext)
+ * .build();
+ *
+ * <jc>// Same, but specify as a JSON string.</jc>
+ * WriterSerializer s = JsonSerializer
+ * .<jsm>create</jsm>()
+ * .uriContext(<js>"{authority:'http://localhost:10000',contextRoot:'/myContext',servletPath:'/myServlet',pathInfo:'/foo'}"</js>)
+ * .build();
+ *
+ * <jc>// Same, but use property.</jc>
+ * WriterSerializer s = JsonSerializer
+ * .<jsm>create</jsm>()
+ * .set(<jsf>SERIALIZER_uriContext</jsf>, uriContext)
+ * .build();
+ *
+ * <jc>// Same, but define it on the session args instead.</jc>
+ * SerializerSessionArgs sessionArgs = <jk>new</jk> SerializerSessionArgs().uriContext(uriContext);
+ * <jk>try</jk> (WriterSerializerSession session = s.createSession(sessionArgs)) {
+ * ...
+ * }
* </p>
+ *
+ * <h5 class='section'>Documentation:</h5>
+ * <ul>
+ * <li><a class="doclink" href="../../../../overview-summary.html#juneau-marshall.URIs">Overview > URIs</a>
+ * </ul>
*/
public static final String SERIALIZER_uriContext = PREFIX + "uriContext.s";
/**
* Configuration property: URI relativity.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"Serializer.uriRelativity.s"</js>
* <li><b>Data type:</b> <code>String</code> ({@link UriRelativity})
@@ -480,33 +817,50 @@ public abstract class Serializer extends BeanContext {
* <li><b>Methods:</b>
* <ul>
* <li class='jm'>{@link SerializerBuilder#uriRelativity(UriRelativity)}
+ * <li class='jm'>{@link SerializerBuilder#uriRelativity(String)}
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Defines what relative URIs are relative to when serializing any of the following:
* <ul>
* <li>{@link java.net.URI}
* <li>{@link java.net.URL}
- * <li>Properties annotated with {@link org.apache.juneau.annotation.URI @URI}
+ * <li>Properties and classes annotated with {@link org.apache.juneau.annotation.URI @URI}
* </ul>
*
* <p>
* Possible values are:
* <ul>
- * <li>{@link UriRelativity#RESOURCE}
+ * <li class='jf'>{@link UriRelativity#RESOURCE}
* - Relative URIs should be considered relative to the servlet URI.
- * <li>{@link UriRelativity#PATH_INFO}
+ * <li class='jf'>{@link UriRelativity#PATH_INFO}
* - Relative URIs should be considered relative to the request URI.
* </ul>
+ *
+ * <h6 class='figure'>Example:</h6>
+ * <p class='bcode'>
+ * <jc>// Define a serializer that converts resource-relative URIs to absolute form.</jc>
+ * WriterSerializer s = JsonSerializer
+ * .<jsm>create</jsm>()
+ * .uriContext(<js>"{authority:'http://localhost:10000',contextRoot:'/myContext',servletPath:'/myServlet',pathInfo:'/foo'}"</js>)
+ * .uriResolution(<jsf>ABSOLUTE</jsf>)
+ * .uriRelativity(<jsf>RESOURCE</jsf>)
+ * .build();
+ * </p>
+ *
+ * <h5 class='section'>Documentation:</h5>
+ * <ul>
+ * <li><a class="doclink" href="../../../../overview-summary.html#juneau-marshall.URIs">Overview > URIs</a>
+ * </ul>
*/
public static final String SERIALIZER_uriRelativity = PREFIX + "uriRelativity.s";
/**
* Configuration property: URI resolution.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"Serializer.uriResolution.s"</js>
* <li><b>Data type:</b> <code>String</code> ({@link UriResolution})
@@ -515,35 +869,52 @@ public abstract class Serializer extends BeanContext {
* <li><b>Methods:</b>
* <ul>
* <li class='jm'>{@link SerializerBuilder#uriResolution(UriResolution)}
+ * <li class='jm'>{@link SerializerBuilder#uriResolution(String)}
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* Defines the resolution level for URIs when serializing any of the following:
* <ul>
* <li>{@link java.net.URI}
* <li>{@link java.net.URL}
- * <li>Properties annotated with {@link org.apache.juneau.annotation.URI @URI}
+ * <li>Properties and classes annotated with {@link org.apache.juneau.annotation.URI @URI}
* </ul>
*
* <p>
* Possible values are:
* <ul>
- * <li>{@link UriResolution#ABSOLUTE}
+ * <li class='jf'>{@link UriResolution#ABSOLUTE}
* - Resolve to an absolute URL (e.g. <js>"http://host:port/context-root/servlet-path/path-info"</js>).
- * <li>{@link UriResolution#ROOT_RELATIVE}
+ * <li class='jf'>{@link UriResolution#ROOT_RELATIVE}
* - Resolve to a root-relative URL (e.g. <js>"/context-root/servlet-path/path-info"</js>).
- * <li>{@link UriResolution#NONE}
+ * <li class='jf'>{@link UriResolution#NONE}
* - Don't do any URL resolution.
* </ul>
+ *
+ * <h6 class='figure'>Example:</h6>
+ * <p class='bcode'>
+ * <jc>// Define a serializer that converts resource-relative URIs to absolute form.</jc>
+ * WriterSerializer s = JsonSerializer
+ * .<jsm>create</jsm>()
+ * .uriContext(<js>"{authority:'http://localhost:10000',contextRoot:'/myContext',servletPath:'/myServlet',pathInfo:'/foo'}"</js>)
+ * .uriResolution(<jsf>ABSOLUTE</jsf>)
+ * .uriRelativity(<jsf>RESOURCE</jsf>)
+ * .build();
+ * </p>
+ *
+ * <h5 class='section'>Documentation:</h5>
+ * <ul>
+ * <li><a class="doclink" href="../../../../overview-summary.html#juneau-marshall.URIs">Overview > URIs</a>
+ * </ul>
*/
public static final String SERIALIZER_uriResolution = PREFIX + "uriResolution.s";
/**
* Configuration property: Use whitespace.
*
- * <h5 class='section'>Property:</h5>
+ * <h5 class='section'>Property:</h5>
* <ul>
* <li><b>Name:</b> <js>"Serializer.useWhitespace.b"</js>
* <li><b>Data type:</b> <code>Boolean</code>
@@ -557,12 +928,30 @@ public abstract class Serializer extends BeanContext {
* </ul>
* </ul>
*
- * <h5 class='section'>Description:</h5>
+ * <h5 class='section'>Description:</h5>
* <p>
* If <jk>true</jk>, whitespace is added to the output to improve readability.
*
* <p>
* This setting does not apply to the MessagePack serializer.
+ *
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode'>
+ * <jc>// Create a serializer with whitespace enabled.</jc>
+ * WriterSerializer s = JsonSerializer
+ * .<jsm>create</jsm>()
+ * .ws()
+ * .build();
+ *
+ * <jc>// Same, but use property.</jc>
+ * WriterSerializer s = JsonSerializer
+ * .<jsm>create</jsm>()
+ * .set(<jsf>SERIALIZER_useWhitespace</jsf>, <jk>true</jk>)
+ * .build();
+ *
+ * <jc>// Produces "\{\n\t'foo': 'bar'\n\}\n"</jc>
+ * String json = s.serialize(<jk>new</jk> MyBean());
+ * </p>
*/
public static final String SERIALIZER_useWhitespace = PREFIX + "useWhitespace.b";