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 2017/02/09 17:31:23 UTC
[01/14] incubator-juneau git commit: Add convenience property setters
to serializers and parsers.
Repository: incubator-juneau
Updated Branches:
refs/heads/master 30dd3b936 -> 68dffad1d
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-rest/src/main/java/org/apache/juneau/rest/RestRequest.java
----------------------------------------------------------------------
diff --git a/juneau-rest/src/main/java/org/apache/juneau/rest/RestRequest.java b/juneau-rest/src/main/java/org/apache/juneau/rest/RestRequest.java
index 29a2dfd..7269178 100644
--- a/juneau-rest/src/main/java/org/apache/juneau/rest/RestRequest.java
+++ b/juneau-rest/src/main/java/org/apache/juneau/rest/RestRequest.java
@@ -153,6 +153,7 @@ public final class RestRequest extends HttpServletRequestWrapper {
return "HTTP " + getMethod() + " " + getRequestURI() + (qs == null ? "" : "?" + qs);
}
+
//--------------------------------------------------------------------------------
// Properties
//--------------------------------------------------------------------------------
@@ -176,6 +177,7 @@ public final class RestRequest extends HttpServletRequestWrapper {
return this.properties;
}
+
//--------------------------------------------------------------------------------
// Headers
//--------------------------------------------------------------------------------
@@ -425,6 +427,7 @@ public final class RestRequest extends HttpServletRequestWrapper {
return super.getLocales();
}
+
//--------------------------------------------------------------------------------
// Query parameters
//--------------------------------------------------------------------------------
@@ -542,7 +545,7 @@ public final class RestRequest extends HttpServletRequestWrapper {
* Listt<String> myparam = req.getQueryParameter(<js>"myparam"</js>, LinkedList.<jk>class</jk>, String.<jk>class</jk>);
*
* <jc>// Parse into a linked-list of linked-lists of strings.</jc>
- * Listt<List<String>> myparam = req.getQueryParameter(<js>"myparam"</js>, LinkedList.<jk>class</jk>, LinkedList.<jk>class</jk>, String.<jk>class</jk>);
+ * Listt<List<String>> myparam = req.getQueryParameter(<js>"myparam"</js>, LinkedList.<jk>class</jk>, LinkedList.<jk>class</jk>, String.<jk>class</jk>);
*
* <jc>// Parse into a map of string keys/values.</jc>
* Map<String,String> myparam = req.getQueryParameter(<js>"myparam"</js>, TreeMap.<jk>class</jk>, String.<jk>class</jk>, String.<jk>class</jk>);
@@ -730,6 +733,7 @@ public final class RestRequest extends HttpServletRequestWrapper {
throw new ParseException("Invalid call to getQueryParameters(String, ClassMeta). Class type must be a Collection or array.");
}
+
//--------------------------------------------------------------------------------
// Form data parameters
//--------------------------------------------------------------------------------
@@ -872,7 +876,7 @@ public final class RestRequest extends HttpServletRequestWrapper {
* Listt<String> myparam = req.getFormDataParameter(<js>"myparam"</js>, LinkedList.<jk>class</jk>, String.<jk>class</jk>);
*
* <jc>// Parse into a linked-list of linked-lists of strings.</jc>
- * Listt<List<String>> myparam = req.getFormDataParameter(<js>"myparam"</js>, LinkedList.<jk>class</jk>, LinkedList.<jk>class</jk>, String.<jk>class</jk>);
+ * Listt<List<String>> myparam = req.getFormDataParameter(<js>"myparam"</js>, LinkedList.<jk>class</jk>, LinkedList.<jk>class</jk>, String.<jk>class</jk>);
*
* <jc>// Parse into a map of string keys/values.</jc>
* Map<String,String> myparam = req.getFormDataParameter(<js>"myparam"</js>, TreeMap.<jk>class</jk>, String.<jk>class</jk>, String.<jk>class</jk>);
@@ -968,6 +972,7 @@ public final class RestRequest extends HttpServletRequestWrapper {
throw new ParseException("Invalid call to getParameters(String, ClassMeta). Class type must be a Collection or array.");
}
+
//--------------------------------------------------------------------------------
// Path parameters
//--------------------------------------------------------------------------------
@@ -1044,7 +1049,7 @@ public final class RestRequest extends HttpServletRequestWrapper {
* Listt<String> myparam = req.getPathParameter(<js>"myparam"</js>, LinkedList.<jk>class</jk>, String.<jk>class</jk>);
*
* <jc>// Parse into a linked-list of linked-lists of strings.</jc>
- * Listt<List<String>> myparam = req.getPathParameter(<js>"myparam"</js>, LinkedList.<jk>class</jk>, LinkedList.<jk>class</jk>, String.<jk>class</jk>);
+ * Listt<List<String>> myparam = req.getPathParameter(<js>"myparam"</js>, LinkedList.<jk>class</jk>, LinkedList.<jk>class</jk>, String.<jk>class</jk>);
*
* <jc>// Parse into a map of string keys/values.</jc>
* Map<String,String> myparam = req.getPathParameter(<js>"myparam"</js>, TreeMap.<jk>class</jk>, String.<jk>class</jk>, String.<jk>class</jk>);
@@ -1078,6 +1083,7 @@ public final class RestRequest extends HttpServletRequestWrapper {
return t;
}
+
//--------------------------------------------------------------------------------
// Body methods
//--------------------------------------------------------------------------------
@@ -1311,6 +1317,7 @@ public final class RestRequest extends HttpServletRequestWrapper {
}
}
+
//--------------------------------------------------------------------------------
// URI-related methods
//--------------------------------------------------------------------------------
@@ -1552,6 +1559,7 @@ public final class RestRequest extends HttpServletRequestWrapper {
return RestUtils.trimPathInfo(getRequestURL(), getContextPath(), getServletPath());
}
+
//--------------------------------------------------------------------------------
// Labels
//--------------------------------------------------------------------------------
@@ -1600,6 +1608,7 @@ public final class RestRequest extends HttpServletRequestWrapper {
return servlet.getMethodDescription(javaMethod.getName(), this);
}
+
//--------------------------------------------------------------------------------
// Other methods
//--------------------------------------------------------------------------------
@@ -1883,6 +1892,7 @@ public final class RestRequest extends HttpServletRequestWrapper {
return sb.toString();
}
+
//--------------------------------------------------------------------------------
// Utility methods
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-rest/src/main/java/org/apache/juneau/rest/RestServlet.java
----------------------------------------------------------------------
diff --git a/juneau-rest/src/main/java/org/apache/juneau/rest/RestServlet.java b/juneau-rest/src/main/java/org/apache/juneau/rest/RestServlet.java
index b7b9321..d09c79d 100644
--- a/juneau-rest/src/main/java/org/apache/juneau/rest/RestServlet.java
+++ b/juneau-rest/src/main/java/org/apache/juneau/rest/RestServlet.java
@@ -286,6 +286,7 @@ public abstract class RestServlet extends HttpServlet {
}
}
+
//--------------------------------------------------------------------------------
// Initialization methods
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-rest/src/main/java/org/apache/juneau/rest/RestServletContext.java
----------------------------------------------------------------------
diff --git a/juneau-rest/src/main/java/org/apache/juneau/rest/RestServletContext.java b/juneau-rest/src/main/java/org/apache/juneau/rest/RestServletContext.java
index 83eac97..b8a3797 100644
--- a/juneau-rest/src/main/java/org/apache/juneau/rest/RestServletContext.java
+++ b/juneau-rest/src/main/java/org/apache/juneau/rest/RestServletContext.java
@@ -31,53 +31,6 @@ import org.apache.juneau.serializer.*;
* These distinctions are noted below.
* <p>
* See {@link ContextFactory} for more information about context properties.
- *
- * <h6 class='topic' id='ConfigProperties'>Configurable properties on the REST servlet</h6>
- * <table class='styled' style='border-collapse: collapse;'>
- * <tr><th>Setting name</th><th>Description</th><th>Data type</th><th>Default value</th></tr>
- * <tr>
- * <td>{@link #REST_allowHeaderParams}</td>
- * <td>Enable header URL parameters.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>true</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #REST_allowMethodParam}</td>
- * <td>Enable <js>"method"</js> URL parameter for specific HTTP methods.</td>
- * <td><code>String</code></td>
- * <td><js>""</js></td>
- * </tr>
- * <tr>
- * <td>{@link #REST_allowBodyParam}</td>
- * <td>Enable <js>"body"</js> URL parameter.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>true</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #REST_renderResponseStackTraces}</td>
- * <td>Render stack traces in HTTP response bodies when errors occur.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>false</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #REST_useStackTraceHashes}</td>
- * <td>Use stack trace hashes.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>false</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #REST_defaultCharset}</td>
- * <td>Default character encoding.</td>
- * <td><code>String</code></td>
- * <td><js>"utf-8"</js></td>
- * </tr>
- * <tr>
- * <td>{@link #REST_paramFormat}</td>
- * <td>Expected format of request parameters.</td>
- * <td><code>String</code></td>
- * <td><js>"UON"</js></td>
- * </tr>
- * </table>
*/
public final class RestServletContext extends Context {
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-rest/src/main/java/org/apache/juneau/rest/remoteable/RemoteableServlet.java
----------------------------------------------------------------------
diff --git a/juneau-rest/src/main/java/org/apache/juneau/rest/remoteable/RemoteableServlet.java b/juneau-rest/src/main/java/org/apache/juneau/rest/remoteable/RemoteableServlet.java
index bdd9409..611cc65 100644
--- a/juneau-rest/src/main/java/org/apache/juneau/rest/remoteable/RemoteableServlet.java
+++ b/juneau-rest/src/main/java/org/apache/juneau/rest/remoteable/RemoteableServlet.java
@@ -120,6 +120,7 @@ public abstract class RemoteableServlet extends RestServletDefault {
return m.invoke(service, params);
}
+
//--------------------------------------------------------------------------------
// Other methods
//--------------------------------------------------------------------------------
[10/14] incubator-juneau git commit: Add convenience property setters
to serializers and parsers.
Posted by ja...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/CoreApi.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/CoreApi.java b/juneau-core/src/main/java/org/apache/juneau/CoreApi.java
index 1094632..1bb1979 100644
--- a/juneau-core/src/main/java/org/apache/juneau/CoreApi.java
+++ b/juneau-core/src/main/java/org/apache/juneau/CoreApi.java
@@ -12,6 +12,19 @@
// ***************************************************************************************************************************
package org.apache.juneau;
+import static org.apache.juneau.BeanContext.*;
+
+import java.beans.*;
+import java.io.*;
+import java.lang.reflect.*;
+import java.util.*;
+
+import org.apache.juneau.Visibility;
+import org.apache.juneau.annotation.*;
+import org.apache.juneau.json.*;
+import org.apache.juneau.serializer.*;
+import org.apache.juneau.transform.*;
+
/**
* Common super class for all core-API serializers, parsers, and serializer/parser groups.
*
@@ -35,11 +48,12 @@ public abstract class CoreApi extends Lockable {
* The context factory stores all configuration properties for this class.
* Adding/modifying properties on this factory will alter the behavior of this object.
* <p>
- * Calling the {@link ContextFactory#lock()} method on the returned object will prevent
- * any further modifications to the configuration for this object
- * ANY ANY OTHERS THAT SHARE THE SAME FACTORY!.
- * Note that calling the {@link #lock()} method on this class will only
- * lock the configuration for this particular instance of the class.
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>Calling the {@link ContextFactory#lock()} method on the returned object will prevent any further modifications to the configuration for this object
+ * ANY ANY OTHERS THAT SHARE THE SAME FACTORY!.
+ * <li>Calling the {@link #lock()} method on this class will only lock the configuration for this particular instance of the class.
+ * </ul>
*
* @return The context factory associated with this object.
*/
@@ -60,6 +74,12 @@ public abstract class CoreApi extends Lockable {
/**
* Creates a {@link Context} class instance of the specified type.
+ * <p>
+ * For example, to create an <code>HtmlSerializerContext</code> object that contains a read-only snapshot
+ * of all the current settings in this object...
+ * <p class='bcode'>
+ * HtmlSerializerContext ctx = htmlParser.getContext(HtmlDocSerializerContext.<jk>class</jk>);
+ * </p>
*
* @param contextClass The class instance to create.
* @return A context class instance of the specified type.
@@ -69,22 +89,32 @@ public abstract class CoreApi extends Lockable {
}
/**
- * Shortcut for calling <code>getContextFactory().setProperty(<jf>property</jf>, <jf>value</jf>);</code>.
+ * Sets a configuration property on this object.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>getContextFactory().setProperty(name, value);</code>.
+ * </ul>
*
- * @param property The property name.
+ * @param name The property name.
* @param value The property value.
* @return This class (for method chaining).
* @throws LockedException If {@link #lock()} has been called on this object or {@link ContextFactory} object.
* @see ContextFactory#setProperty(String, Object)
*/
- public CoreApi setProperty(String property, Object value) throws LockedException {
+ public CoreApi setProperty(String name, Object value) throws LockedException {
checkLock();
- contextFactory.setProperty(property, value);
+ contextFactory.setProperty(name, value);
return this;
}
/**
- * Shortcut for calling <code>getContextFactory().setProperties(<jf>properties</jf>);</code>.
+ * Sets multiple configuration properties on this object.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>getContextFactory().setProperties(properties);</code>.
+ * </ul>
*
* @param properties The properties to set on this class.
* @return This class (for method chaining).
@@ -98,113 +128,1394 @@ public abstract class CoreApi extends Lockable {
}
/**
- * Shortcut for calling <code>getContextFactory().addNotBeanClasses(<jf>classes</jf>)</code>.
+ * Adds a value to a SET property.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>getContextFactory().addToProperty(name, value);</code>.
+ * </ul>
*
- * @see ContextFactory#addToProperty(String,Object)
- * @param classes The new setting value for the bean context.
- * @throws LockedException If {@link ContextFactory#lock()} was called on this class or the bean context.
+ * @param name The property name.
+ * @param value The new value to add to the SET property.
* @return This object (for method chaining).
- * @see ContextFactory#addToProperty(String, Object)
- * @see BeanContext#BEAN_notBeanClasses
+ * @throws ConfigException If property is not a SET property.
+ * @throws LockedException If {@link #lock()} has been called on this object.
*/
- public CoreApi addNotBeanClasses(Class<?>...classes) throws LockedException {
+ public CoreApi addToProperty(String name, Object value) throws LockedException {
checkLock();
- contextFactory.addNotBeanClasses(classes);
+ contextFactory.addToProperty(name, value);
return this;
}
/**
- * Shortcut for calling <code>getContextFactory().addBeanFilters(<jf>classes</jf>)</code>.
+ * Adds or overwrites a value to a MAP property.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>getContextFactory().putToProperty(name, key, value);</code>.
+ * </ul>
*
- * @param classes The new setting value for the bean context.
- * @throws LockedException If {@link ContextFactory#lock()} was called on this class or the bean context.
+ * @param name The property name.
+ * @param key The property value map key.
+ * @param value The property value map value.
* @return This object (for method chaining).
- * @see ContextFactory#addToProperty(String, Object)
- * @see BeanContext#BEAN_beanFilters
+ * @throws ConfigException If property is not a MAP property.
+ * @throws LockedException If {@link #lock()} has been called on this object.
*/
- public CoreApi addBeanFilters(Class<?>...classes) throws LockedException {
+ public CoreApi putToProperty(String name, Object key, Object value) throws LockedException {
checkLock();
- contextFactory.addBeanFilters(classes);
+ contextFactory.putToProperty(name, key, value);
return this;
}
/**
- * Shortcut for calling <code>getContextFactory().addPojoSwaps(<jf>classes</jf>)</code>.
+ * Adds or overwrites a value to a MAP property.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>getContextFactory().putToProperty(name, value);</code>.
+ * </ul>
*
- * @param classes The new setting value for the bean context.
- * @throws LockedException If {@link ContextFactory#lock()} was called on this class or the bean context.
+ * @param name The property value.
+ * @param value The property value map value.
* @return This object (for method chaining).
- * @see ContextFactory#addToProperty(String, Object)
- * @see BeanContext#BEAN_pojoSwaps
+ * @throws ConfigException If property is not a MAP property.
+ * @throws LockedException If {@link #lock()} has been called on this object.
*/
- public CoreApi addPojoSwaps(Class<?>...classes) throws LockedException {
+ public CoreApi putToProperty(String name, Object value) throws LockedException {
checkLock();
- contextFactory.addPojoSwaps(classes);
+ contextFactory.putToProperty(name, value);
return this;
}
/**
- * Shortcut for calling <code>getContextFactory().addToDictionary(<jf>classes</jf>)</code>.
+ * Removes a value from a SET property.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>getContextFactory().removeFromProperty(name, value);</code>.
+ * </ul>
*
- * @param classes The bean classes (or BeanDictionaryBuilder) classes to add to the bean dictionary.
- * @throws LockedException If {@link ContextFactory#lock()} was called on this class or the bean context.
+ * @param name The property name.
+ * @param value The property value in the SET property.
* @return This object (for method chaining).
- * @see ContextFactory#addToProperty(String, Object)
- * @see BeanContext#BEAN_beanDictionary
+ * @throws ConfigException If property is not a SET property.
+ * @throws LockedException If {@link #lock()} has been called on this object.
*/
- public CoreApi addToDictionary(Class<?>...classes) throws LockedException {
+ public CoreApi removeFromProperty(String name, Object value) throws LockedException {
checkLock();
- contextFactory.addToDictionary(classes);
+ contextFactory.removeFromProperty(name, value);
return this;
}
/**
- * Shortcut for calling <code>getContextFactory().addImplClass(<jf>interfaceClass</jf>, <jf>implClass</jf>)</code>.
+ * Returns the universal <code>Object</code> metadata object.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>getBeanContext().object();</code>.
+ * </ul>
*
- * @param interfaceClass The interface class.
- * @param implClass The implementation class.
- * @throws LockedException If {@link ContextFactory#lock()} was called on this class or the bean context.
- * @param <T> The class type of the interface.
+ * @return The reusable {@link ClassMeta} for representing the {@link Object} class.
+ */
+ public ClassMeta<Object> object() {
+ return getBeanContext().object();
+ }
+
+ /**
+ * Returns the universal <code>String</code> metadata object.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>getBeanContext().string();</code>.
+ * </ul>
+ *
+ * @return The reusable {@link ClassMeta} for representing the {@link String} class.
+ */
+ public ClassMeta<String> string() {
+ return getBeanContext().string();
+ }
+
+
+ //--------------------------------------------------------------------------------
+ // Properties
+ //--------------------------------------------------------------------------------
+
+ /**
+ * <b>Configuration property:</b> Beans require no-arg constructors.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"BeanContext.beansRequireDefaultConstructor"</js>
+ * <li><b>Data type:</b> <code>Boolean</code>
+ * <li><b>Default:</b> <jk>false</jk>
+ * <li><b>Session-overridable:</b> <jk>false</jk>
+ * </ul>
+ * <p>
+ * If <jk>true</jk>, a Java class must implement a default no-arg constructor to be considered a bean.
+ * Otherwise, the bean will be serialized as a string using the {@link #toString()} method.
+ * <p>
+ * The {@link Bean @Bean} annotation can be used on a class to override this setting when <jk>true</jk>.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>BEAN_beansRequireDefaultConstructor</jsf>, value)</code>.
+ * </ul>
+ *
+ * @param value The new value for this property.
* @return This object (for method chaining).
- * @see ContextFactory#putToProperty(String, Object, Object)
- * @see BeanContext#BEAN_implClasses
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beansRequireDefaultConstructor
*/
- public <T> CoreApi addImplClass(Class<T> interfaceClass, Class<? extends T> implClass) throws LockedException {
- checkLock();
- contextFactory.addImplClass(interfaceClass, implClass);
- return this;
+ public CoreApi setBeansRequireDefaultConstructor(boolean value) throws LockedException {
+ return setProperty(BEAN_beansRequireDefaultConstructor, value);
}
/**
- * Shortcut for calling <code>getContextFactory().setClassLoader(<jf>classLoader</jf>)</code>.
+ * <b>Configuration property:</b> Beans require {@link Serializable} interface.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"BeanContext.beansRequireSerializable"</js>
+ * <li><b>Data type:</b> <code>Boolean</code>
+ * <li><b>Default:</b> <jk>false</jk>
+ * <li><b>Session-overridable:</b> <jk>false</jk>
+ * </ul>
+ * <p>
+ * If <jk>true</jk>, a Java class must implement the {@link Serializable} interface to be considered a bean.
+ * Otherwise, the bean will be serialized as a string using the {@link #toString()} method.
+ * <p>
+ * The {@link Bean @Bean} annotation can be used on a class to override this setting when <jk>true</jk>.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>BEAN_beansRequireSerializable</jsf>, value)</code>.
+ * </ul>
*
- * @param classLoader The new classloader.
- * @throws LockedException If {@link ContextFactory#lock()} was called on this class or the bean context.
+ * @param value The new value for this property.
* @return This object (for method chaining).
- * @see ContextFactory#setClassLoader(ClassLoader)
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beansRequireSerializable
*/
- public CoreApi setClassLoader(ClassLoader classLoader) throws LockedException {
- checkLock();
- contextFactory.setClassLoader(classLoader);
- return this;
+ public CoreApi setBeansRequireSerializable(boolean value) throws LockedException {
+ return setProperty(BEAN_beansRequireSerializable, value);
}
/**
- * Shortcut for calling {@link BeanContext#object()}.
+ * <b>Configuration property:</b> Beans require setters for getters.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"BeanContext.beansRequireSettersForGetters"</js>
+ * <li><b>Data type:</b> <code>Boolean</code>
+ * <li><b>Default:</b> <jk>false</jk>
+ * <li><b>Session-overridable:</b> <jk>false</jk>
+ * </ul>
+ * <p>
+ * If <jk>true</jk>, only getters that have equivalent setters will be considered as properties on a bean.
+ * Otherwise, they will be ignored.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>BEAN_beansRequireSettersForGetters</jsf>, value)</code>.
+ * </ul>
*
- * @return The reusable {@link ClassMeta} for representing the {@link Object} class.
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beansRequireSettersForGetters
*/
- public ClassMeta<Object> object() {
- return getBeanContext().object();
+ public CoreApi setBeansRequireSettersForGetters(boolean value) throws LockedException {
+ return setProperty(BEAN_beansRequireSettersForGetters, value);
}
/**
- * Shortcut for calling {@link BeanContext#string()}.
+ * <b>Configuration property:</b> Beans require at least one property.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"BeanContext.beansRequireSomeProperties"</js>
+ * <li><b>Data type:</b> <code>Boolean</code>
+ * <li><b>Default:</b> <jk>true</jk>
+ * <li><b>Session-overridable:</b> <jk>false</jk>
+ * </ul>
+ * <p>
+ * If <jk>true</jk>, then a Java class must contain at least 1 property to be considered a bean.
+ * Otherwise, the bean will be serialized as a string using the {@link #toString()} method.
+ * <p>
+ * The {@link Bean @Bean} annotation can be used on a class to override this setting when <jk>true</jk>.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>BEAN_beansRequireSomeProperties</jsf>, value)</code>.
+ * </ul>
*
- * @return The reusable {@link ClassMeta} for representing the {@link String} class.
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beansRequireSomeProperties
*/
- public ClassMeta<String> string() {
- return getBeanContext().string();
+ public CoreApi setBeansRequireSomeProperties(boolean value) throws LockedException {
+ return setProperty(BEAN_beansRequireSomeProperties, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> {@link BeanMap#put(String,Object) BeanMap.put()} method will return old property value.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"BeanContext.beanMapPutReturnsOldValue"</js>
+ * <li><b>Data type:</b> <code>Boolean</code>
+ * <li><b>Default:</b> <jk>false</jk>
+ * <li><b>Session-overridable:</b> <jk>false</jk>
+ * </ul>
+ * <p>
+ * If <jk>true</jk>, then the {@link BeanMap#put(String,Object) BeanMap.put()} method will return old property values.
+ * Otherwise, it returns <jk>null</jk>.
+ * <p>
+ * Disabled by default because it introduces a slight performance penalty.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>BEAN_beanMapPutReturnsOldValue</jsf>, value)</code>.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beanMapPutReturnsOldValue
+ */
+ public CoreApi setBeanMapPutReturnsOldValue(boolean value) throws LockedException {
+ return setProperty(BEAN_beanMapPutReturnsOldValue, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> Look for bean constructors with the specified minimum visibility.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"BeanContext.beanConstructorVisibility"</js>
+ * <li><b>Data type:</b> {@link Visibility}
+ * <li><b>Default:</b> {@link Visibility#PUBLIC}
+ * <li><b>Session-overridable:</b> <jk>false</jk>
+ * </ul>
+ * <p>
+ * Constructors not meeting this minimum visibility will be ignored.
+ * For example, if the visibility is <code>PUBLIC</code> and the constructor is <jk>protected</jk>, then
+ * the constructor will be ignored.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>BEAN_beanConstructorVisibility</jsf>, value)</code>.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beanConstructorVisibility
+ */
+ public CoreApi setBeanConstructorVisibility(Visibility value) throws LockedException {
+ return setProperty(BEAN_beanConstructorVisibility, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> Look for bean classes with the specified minimum visibility.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"BeanContext.beanClassVisibility"</js>
+ * <li><b>Data type:</b> {@link Visibility}
+ * <li><b>Default:</b> {@link Visibility#PUBLIC}
+ * <li><b>Session-overridable:</b> <jk>false</jk>
+ * </ul>
+ * <p>
+ * Classes are not considered beans unless they meet the minimum visibility requirements.
+ * For example, if the visibility is <code>PUBLIC</code> and the bean class is <jk>protected</jk>, then
+ * the class will not be interpreted as a bean class.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>BEAN_beanClassVisibility</jsf>, value)</code>.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beanClassVisibility
+ */
+ public CoreApi setBeanClassVisibility(Visibility value) throws LockedException {
+ return setProperty(BEAN_beanClassVisibility, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> Look for bean fields with the specified minimum visibility.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"BeanContext.beanFieldVisibility"</js>
+ * <li><b>Data type:</b> {@link Visibility}
+ * <li><b>Default:</b> {@link Visibility#PUBLIC}
+ * <li><b>Session-overridable:</b> <jk>false</jk>
+ * </ul>
+ * <p>
+ * Fields are not considered bean properties unless they meet the minimum visibility requirements.
+ * For example, if the visibility is <code>PUBLIC</code> and the bean field is <jk>protected</jk>, then
+ * the field will not be interpreted as a bean property.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>BEAN_beanFieldVisibility</jsf>, value)</code>.
+ * <li>Use {@link Visibility#NONE} to prevent bean fields from being interpreted as bean properties altogether.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beanFieldVisibility
+ */
+ public CoreApi setBeanFieldVisibility(Visibility value) throws LockedException {
+ return setProperty(BEAN_beanFieldVisibility, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> Look for bean methods with the specified minimum visibility.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"BeanContext.methodVisibility"</js>
+ * <li><b>Data type:</b> {@link Visibility}
+ * <li><b>Default:</b> {@link Visibility#PUBLIC}
+ * <li><b>Session-overridable:</b> <jk>false</jk>
+ * </ul>
+ * <p>
+ * Methods are not considered bean getters/setters unless they meet the minimum visibility requirements.
+ * For example, if the visibility is <code>PUBLIC</code> and the bean method is <jk>protected</jk>, then
+ * the method will not be interpreted as a bean getter or setter.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>BEAN_methodVisibility</jsf>, value)</code>.
+ * <li>Use {@link Visibility#NONE} to prevent bean methods from being interpreted as bean properties altogether.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_methodVisibility
+ */
+ public CoreApi setMethodVisibility(Visibility value) throws LockedException {
+ return setProperty(BEAN_methodVisibility, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> Use Java {@link Introspector} for determining bean properties.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"BeanContext.useJavaBeanIntrospector"</js>
+ * <li><b>Data type:</b> <code>Boolean</code>
+ * <li><b>Default:</b> <jk>false</jk>
+ * <li><b>Session-overridable:</b> <jk>false</jk>
+ * </ul>
+ * <p>
+ * Using the built-in Java bean introspector will not pick up fields or non-standard getters/setters.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>BEAN_useJavaBeanIntrospector</jsf>, value)</code>.
+ * <li>Most {@link Bean @Bean} annotations will be ignored if you enable this setting.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_useJavaBeanIntrospector
+ */
+ public CoreApi setUseJavaBeanIntrospector(boolean value) throws LockedException {
+ return setProperty(BEAN_useJavaBeanIntrospector, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> Use interface proxies.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"BeanContext.useInterfaceProxies"</js>
+ * <li><b>Data type:</b> <code>Boolean</code>
+ * <li><b>Default:</b> <jk>true</jk>
+ * <li><b>Session-overridable:</b> <jk>false</jk>
+ * </ul>
+ * <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.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>BEAN_useInterfaceProxies</jsf>, value)</code>.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_useInterfaceProxies
+ */
+ public CoreApi setUseInterfaceProxies(boolean value) throws LockedException {
+ return setProperty(BEAN_useInterfaceProxies, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> Ignore unknown properties.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"BeanContext.ignoreUnknownBeanProperties"</js>
+ * <li><b>Data type:</b> <code>Boolean</code>
+ * <li><b>Default:</b> <jk>false</jk>
+ * <li><b>Session-overridable:</b> <jk>false</jk>
+ * </ul>
+ * <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.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>BEAN_ignoreUnknownBeanProperties</jsf>, value)</code>.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_ignoreUnknownBeanProperties
+ */
+ public CoreApi setIgnoreUnknownBeanProperties(boolean value) throws LockedException {
+ return setProperty(BEAN_ignoreUnknownBeanProperties, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> Ignore unknown properties with null values.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"BeanContext.ignoreUnknownNullBeanProperties"</js>
+ * <li><b>Data type:</b> <code>Boolean</code>
+ * <li><b>Default:</b> <jk>true</jk>
+ * <li><b>Session-overridable:</b> <jk>false</jk>
+ * </ul>
+ * <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.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>BEAN_ignoreUnknownNullBeanProperties</jsf>, value)</code>.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_ignoreUnknownNullBeanProperties
+ */
+ public CoreApi setIgnoreUnknownNullBeanProperties(boolean value) throws LockedException {
+ return setProperty(BEAN_ignoreUnknownNullBeanProperties, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> Ignore properties without setters.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"BeanContext.ignorePropertiesWithoutSetters"</js>
+ * <li><b>Data type:</b> <code>Boolean</code>
+ * <li><b>Default:</b> <jk>true</jk>
+ * <li><b>Session-overridable:</b> <jk>false</jk>
+ * </ul>
+ * <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.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>BEAN_ignorePropertiesWithoutSetters</jsf>, value)</code>.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_ignorePropertiesWithoutSetters
+ */
+ public CoreApi setIgnorePropertiesWithoutSetters(boolean value) throws LockedException {
+ return setProperty(BEAN_ignorePropertiesWithoutSetters, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> Ignore invocation errors on getters.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"BeanContext.ignoreInvocationExceptionsOnGetters"</js>
+ * <li><b>Data type:</b> <code>Boolean</code>
+ * <li><b>Default:</b> <jk>false</jk>
+ * <li><b>Session-overridable:</b> <jk>false</jk>
+ * </ul>
+ * <p>
+ * If <jk>true</jk>, errors thrown when calling bean getter methods will silently be ignored.
+ * Otherwise, a {@code BeanRuntimeException} is thrown.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>BEAN_ignoreInvocationExceptionsOnGetters</jsf>, value)</code>.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_ignoreInvocationExceptionsOnGetters
+ */
+ public CoreApi setIgnoreInvocationExceptionsOnGetters(boolean value) throws LockedException {
+ return setProperty(BEAN_ignoreInvocationExceptionsOnGetters, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> Ignore invocation errors on setters.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"BeanContext.ignoreInvocationExceptionsOnSetters"</js>
+ * <li><b>Data type:</b> <code>Boolean</code>
+ * <li><b>Default:</b> <jk>false</jk>
+ * <li><b>Session-overridable:</b> <jk>false</jk>
+ * </ul>
+ * <p>
+ * If <jk>true</jk>, errors thrown when calling bean setter methods will silently be ignored.
+ * Otherwise, a {@code BeanRuntimeException} is thrown.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>BEAN_ignoreInvocationExceptionsOnSetters</jsf>, value)</code>.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_ignoreInvocationExceptionsOnSetters
+ */
+ public CoreApi setIgnoreInvocationExceptionsOnSetters(boolean value) throws LockedException {
+ return setProperty(BEAN_ignoreInvocationExceptionsOnSetters, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> Sort bean properties in alphabetical order.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"BeanContext.sortProperties"</js>
+ * <li><b>Data type:</b> <code>Boolean</code>
+ * <li><b>Default:</b> <jk>false</jk>
+ * <li><b>Session-overridable:</b> <jk>false</jk>
+ * </ul>
+ * <p>
+ * When <jk>true</jk>, all bean properties will be serialized and access in alphabetical order.
+ * Otherwise, the natural order of the bean properties is used which is dependent on the
+ * JVM vendor.
+ * On IBM JVMs, the bean properties are ordered based on their ordering in the Java file.
+ * On Oracle JVMs, the bean properties are not ordered (which follows the offical JVM specs).
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>BEAN_sortProperties</jsf>, value)</code>.
+ * <li>This property is disabled by default so that IBM JVM users don't have to use {@link Bean @Bean} annotations
+ * to force bean properties to be in a particular order and can just alter the order of the fields/methods
+ * in the Java file.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_sortProperties
+ */
+ public CoreApi setSortProperties(boolean value) throws LockedException {
+ return setProperty(BEAN_sortProperties, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> Packages whose classes should not be considered beans.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"BeanContext.notBeanPackages.set"</js>
+ * <li><b>Data type:</b> <code>Set<String></code>
+ * <li><b>Default:</b>
+ * <ul>
+ * <li><code>java.lang</code>
+ * <li><code>java.lang.annotation</code>
+ * <li><code>java.lang.ref</code>
+ * <li><code>java.lang.reflect</code>
+ * <li><code>java.io</code>
+ * <li><code>java.net</code>
+ * <li><code>java.nio.*</code>
+ * <li><code>java.util.*</code>
+ * </ul>
+ * <li><b>Session-overridable:</b> <jk>false</jk>
+ * </ul>
+ * <p>
+ * When specified, the current list of ignore packages are appended to.
+ * <p>
+ * Any classes within these packages will be serialized to strings using {@link Object#toString()}.
+ * <p>
+ * Note that you can specify prefix patterns to include all subpackages.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>BEAN_notBeanPackages</jsf>, values)</code>.
+ * </ul>
+ *
+ * @param values The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_notBeanPackages
+ */
+ public CoreApi setNotBeanPackages(String...values) throws LockedException {
+ return setProperty(BEAN_notBeanPackages, values);
+ }
+
+ /**
+ * <b>Configuration property:</b> Packages whose classes should not be considered beans.
+ * <p>
+ * Same as {@link #setNotBeanPackages(String...)} but using a <code>Collection</code>.
+ *
+ * @param values The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_notBeanPackages
+ */
+ public CoreApi setNotBeanPackages(Collection<String> values) throws LockedException {
+ return setProperty(BEAN_notBeanPackages, values);
+ }
+
+ /**
+ * <b>Configuration property:</b> Add to packages whose classes should not be considered beans.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>addToProperty(<jsf>BEAN_notBeanPackages</jsf>, values)</code>
+ * or <code>setProperty(<jsf>BEAN_notBeanPackages_add</jsf>, s)</code>.
+ * </ul>
+ *
+ * @param values The values to add to this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_notBeanPackages_add
+ */
+ public CoreApi addNotBeanPackages(String...values) throws LockedException {
+ return addToProperty(BEAN_notBeanPackages, values);
+ }
+
+ /**
+ * <b>Configuration property:</b> Add to packages whose classes should not be considered beans.
+ * <p>
+ * Same as {@link #addNotBeanPackages(String...)} but using a <code>Collection</code>.
+ *
+ * @param values The values to add to this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_notBeanPackages
+ */
+ public CoreApi addNotBeanPackages(Collection<String> values) throws LockedException {
+ return addToProperty(BEAN_notBeanPackages, values);
+ }
+
+ /**
+ * <b>Configuration property:</b> Remove from packages whose classes should not be considered beans.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>removeFromProperty(<jsf>BEAN_notBeanPackages</jsf>, values)</code>
+ * or <code>setProperty(<jsf>BEAN_notBeanPackages_remove</jsf>, s)</code>.
+ * </ul>
+ *
+ * @param values The values to remove from this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_notBeanPackages
+ * @see BeanContext#BEAN_notBeanPackages_remove
+ */
+ public CoreApi removeNotBeanPackages(String...values) throws LockedException {
+ return removeFromProperty(BEAN_notBeanPackages, values);
+ }
+
+ /**
+ * <b>Configuration property:</b> Remove from packages whose classes should not be considered beans.
+ * <p>
+ * Same as {@link #removeNotBeanPackages(String...)} but using a <code>Collection</code>.
+ *
+ * @param values The values to remove from this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_notBeanPackages
+ * @see BeanContext#BEAN_notBeanPackages_remove
+ */
+ public CoreApi removeNotBeanPackages(Collection<String> values) throws LockedException {
+ return removeFromProperty(BEAN_notBeanPackages, values);
+ }
+
+ /**
+ * <b>Configuration property:</b> Classes to be excluded from consideration as being beans.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"BeanContext.notBeanClasses.set"</js>
+ * <li><b>Data type:</b> <code>Set<Class></code>
+ * <li><b>Default:</b> empty set
+ * <li><b>Session-overridable:</b> <jk>false</jk>
+ * </ul>
+ * <p>
+ * Not-bean classes are typically converted to <code>Strings</code> during serialization even if they
+ * appear to be bean-like.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>BEAN_notBeanClasses</jsf>, values)</code>.
+ * </ul>
+ *
+ * @param values The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_notBeanClasses
+ */
+ public CoreApi setNotBeanClasses(Class<?>...values) throws LockedException {
+ return setProperty(BEAN_notBeanClasses, values);
+ }
+
+ /**
+ * <b>Configuration property:</b> Classes to be excluded from consideration as being beans.
+ * <p>
+ * Same as {@link #setNotBeanClasses(Class...)} but using a <code>Collection</code>.
+ *
+ * @param values The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_notBeanPackages
+ */
+ public CoreApi setNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ return setProperty(BEAN_notBeanClasses, values);
+ }
+
+ /**
+ * <b>Configuration property:</b> Add to classes that should not be considered beans.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>addToProperty(<jsf>BEAN_notBeanClasses</jsf>, values)</code>
+ * or <code>setProperty(<jsf>BEAN_notBeanClasses_add</jsf>, c)</code>.
+ * </ul>
+ *
+ * @param values The values to add to this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_notBeanClasses
+ * @see BeanContext#BEAN_notBeanClasses_add
+ */
+ public CoreApi addNotBeanClasses(Class<?>...values) throws LockedException {
+ return addToProperty(BEAN_notBeanClasses, values);
+ }
+
+ /**
+ * <b>Configuration property:</b> Add to classes that should not be considered beans.
+ * <p>
+ * Same as {@link #addNotBeanClasses(Class...)} but using a <code>Collection</code>.
+ *
+ * @param values The values to add to this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_notBeanClasses
+ * @see BeanContext#BEAN_notBeanClasses_add
+ */
+ public CoreApi addNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ return addToProperty(BEAN_notBeanClasses, values);
+ }
+
+ /**
+ * <b>Configuration property:</b> Remove from classes that should not be considered beans.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>removeFromProperty(<jsf>BEAN_notBeanClasses</jsf>, values)</code>
+ * or <code>setProperty(<jsf>BEAN_notBeanClasses_remove</jsf>, c)</code>.
+ * </ul>
+ *
+ * @param values The values to remove from this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_notBeanClasses
+ * @see BeanContext#BEAN_notBeanClasses_remove
+ */
+ public CoreApi removeNotBeanClasses(Class<?>...values) throws LockedException {
+ return removeFromProperty(BEAN_notBeanClasses, values);
+ }
+
+ /**
+ * <b>Configuration property:</b> Remove from classes that should not be considered beans.
+ * <p>
+ * Same as {@link #removeNotBeanClasses(Class...)} but using a <code>Collection</code>.
+ *
+ * @param values The values to remove from this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_notBeanClasses
+ * @see BeanContext#BEAN_notBeanClasses_remove
+ */
+ public CoreApi removeNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ return removeFromProperty(BEAN_notBeanClasses, values);
+ }
+
+ /**
+ * <b>Configuration property:</b> Bean filters to apply to beans.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"BeanContext.beanFilters.list"</js>
+ * <li><b>Data type:</b> <code>List<Class></code>
+ * <li><b>Default:</b> empty list
+ * <li><b>Session-overridable:</b> <jk>false</jk>
+ * </ul>
+ * <p>
+ * This is a programmatic equivalent to the {@link Bean @Bean} annotation.
+ * It's useful when you want to use the Bean annotation functionality, but you don't have the ability
+ * to alter the bean classes.
+ * <p>
+ * There are two category of classes that can be passed in through this method:
+ * <ul class='spaced-list'>
+ * <li>Subclasses of {@link BeanFilterBuilder}.
+ * These must have a public no-arg constructor.
+ * <li>Bean interface classes.
+ * A shortcut for defining a {@link InterfaceBeanFilterBuilder}.
+ * Any subclasses of an interface class will only have properties defined on the interface.
+ * All other bean properties will be ignored.
+ * </ul>
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>BEAN_beanFilters</jsf>, values)</code>.
+ * </ul>
+ *
+ * @param values The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beanFilters
+ */
+ public CoreApi setBeanFilters(Class<?>...values) throws LockedException {
+ return setProperty(BEAN_beanFilters, values);
+ }
+
+ /**
+ * <b>Configuration property:</b> Bean filters to apply to beans.
+ * <p>
+ * Same as {@link #setBeanFilters(Class...)} but using a <code>Collection</code>.
+ *
+ * @param values The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beanFilters
+ */
+ public CoreApi setBeanFilters(Collection<Class<?>> values) throws LockedException {
+ return setProperty(BEAN_beanFilters, values);
+ }
+
+ /**
+ * <b>Configuration property:</b> Add to bean filters.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>addToProperty(<jsf>BEAN_beanFilters</jsf>, values)</code>
+ * or <code>setProperty(<jsf>BEAN_beanFilters_add</jsf>, c)</code>.
+ * </ul>
+ *
+ * @param values The values to add to this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beanFilters
+ * @see BeanContext#BEAN_beanFilters_add
+ */
+ public CoreApi addBeanFilters(Class<?>...values) throws LockedException {
+ return addToProperty(BEAN_beanFilters, values);
+ }
+
+ /**
+ * <b>Configuration property:</b> Add to bean filters.
+ * <p>
+ * Same as {@link #addBeanFilters(Class...)} but using a <code>Collection</code>.
+ *
+ * @param values The values to add to this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beanFilters
+ * @see BeanContext#BEAN_beanFilters_add
+ */
+ public CoreApi addBeanFilters(Collection<Class<?>> values) throws LockedException {
+ return addToProperty(BEAN_beanFilters, values);
+ }
+
+ /**
+ * <b>Configuration property:</b> Remove from bean filters.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>removeFromProperty(<jsf>BEAN_beanFilters</jsf>, values)</code>
+ * or <code>setProperty(<jsf>BEAN_beanFilters_remove</jsf>, c)</code>.
+ * </ul>
+ *
+ * @param values The values to remove from this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beanFilters
+ * @see BeanContext#BEAN_beanFilters_remove
+ */
+ public CoreApi removeBeanFilters(Class<?>...values) throws LockedException {
+ return removeFromProperty(BEAN_beanFilters, values);
+ }
+
+ /**
+ * <b>Configuration property:</b> Remove from bean filters.
+ * <p>
+ * Same as {@link #removeBeanFilters(Class...)} but using a <code>Collection</code>.
+ *
+ * @param values The values to remove from this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beanFilters
+ * @see BeanContext#BEAN_beanFilters_remove
+ */
+ public CoreApi removeBeanFilters(Collection<Class<?>> values) throws LockedException {
+ return removeFromProperty(BEAN_beanFilters, values);
+ }
+
+ /**
+ * <b>Configuration property:</b> POJO swaps to apply to Java objects.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"BeanContext.pojoSwaps.list"</js>
+ * <li><b>Data type:</b> <code>List<Class></code>
+ * <li><b>Default:</b> empty list
+ * <li><b>Session-overridable:</b> <jk>false</jk>
+ * </ul>
+ * <p>
+ * There are two category of classes that can be passed in through this method:
+ * <ul>
+ * <li>Subclasses of {@link PojoSwap}.
+ * <li>Surrogate classes. A shortcut for defining a {@link SurrogateSwap}.
+ * </ul>
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>BEAN_pojoSwaps</jsf>, values)</code>.
+ * </ul>
+ *
+ * @param values The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_pojoSwaps
+ */
+ public CoreApi setPojoSwaps(Class<?>...values) throws LockedException {
+ return setProperty(BEAN_pojoSwaps, values);
+ }
+
+ /**
+ * <b>Configuration property:</b> POJO swaps to apply to Java objects.
+ * <p>
+ * Same as {@link #setPojoSwaps(Class...)} but using a <code>Collection</code>.
+ *
+ * @param values The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_pojoSwaps
+ */
+ public CoreApi setPojoSwaps(Collection<Class<?>> values) throws LockedException {
+ return setProperty(BEAN_pojoSwaps, values);
+ }
+
+ /**
+ * <b>Configuration property:</b> Add to POJO swaps.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>addToProperty(<jsf>BEAN_pojoSwaps</jsf>, values)</code>
+ * or <code>setProperty(<jsf>BEAN_pojoSwaps_add</jsf>, c)</code>.
+ * </ul>
+ *
+ * @param values The values to add to this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_pojoSwaps
+ * @see BeanContext#BEAN_pojoSwaps_add
+ */
+ public CoreApi addPojoSwaps(Class<?>...values) throws LockedException {
+ return addToProperty(BEAN_pojoSwaps, values);
+ }
+
+ /**
+ * <b>Configuration property:</b> Add to POJO swaps.
+ * <p>
+ * Same as {@link #addPojoSwaps(Class...)} but using a <code>Collection</code>.
+ *
+ * @param values The values to add to this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_pojoSwaps
+ * @see BeanContext#BEAN_pojoSwaps_add
+ */
+ public CoreApi addPojoSwaps(Collection<Class<?>> values) throws LockedException {
+ return addToProperty(BEAN_pojoSwaps, values);
+ }
+
+ /**
+ * <b>Configuration property:</b> Remove from POJO swaps.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>removeFromProperty(<jsf>BEAN_pojoSwaps</jsf>, values)</code>
+ * or <code>setProperty(<jsf>BEAN_pojoSwaps_remove</jsf>, c)</code>.
+ * </ul>
+ *
+ * @param values The values to remove from this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_pojoSwaps
+ * @see BeanContext#BEAN_pojoSwaps_remove
+ */
+ public CoreApi removePojoSwaps(Class<?>...values) throws LockedException {
+ return removeFromProperty(BEAN_pojoSwaps, values);
+ }
+
+ /**
+ * <b>Configuration property:</b> Remove from POJO swaps.
+ * <p>
+ * Same as {@link #removePojoSwaps(Class...)} but using a <code>Collection</code>.
+ *
+ * @param values The values to remove from this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_pojoSwaps
+ * @see BeanContext#BEAN_pojoSwaps_remove
+ */
+ public CoreApi removePojoSwaps(Collection<Class<?>> values) throws LockedException {
+ return removeFromProperty(BEAN_pojoSwaps, values);
+ }
+
+ /**
+ * <b>Configuration property:</b> Implementation classes for interfaces and abstract classes.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"BeanContext.implClasses.map"</js>
+ * <li><b>Data type:</b> <code>Map<Class,Class></code>
+ * <li><b>Default:</b> empty map
+ * <li><b>Session-overridable:</b> <jk>false</jk>
+ * </ul>
+ * <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).
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>BEAN_implClasses</jsf>, values)</code>.
+ * </ul>
+ *
+ * @param values The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_implClasses
+ */
+ public CoreApi setImplClasses(Map<Class<?>,Class<?>> values) throws LockedException {
+ return setProperty(BEAN_implClasses, values);
+ }
+
+ /**
+ * <b>Configuration property:</b> Implementation classes for interfaces and abstract classes.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>putToProperty(<jsf>BEAN_implClasses</jsf>, interfaceClass, implClass)</code>
+ * or <code>setProperty(<jsf>BEAN_implClasses_put</jsf>, interfaceClass, implClass)</code>.
+ * </ul>
+ *
+ * @param interfaceClass The interface class.
+ * @param implClass The implementation class.
+ * @param <T> The class type of the interface.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_implClasses
+ * @see BeanContext#BEAN_implClasses_put
+ */
+ public <T> CoreApi addImplClass(Class<T> interfaceClass, Class<? extends T> implClass) throws LockedException {
+ return putToProperty(BEAN_implClasses, interfaceClass, implClass);
+ }
+
+ /**
+ * <b>Configuration property:</b> Bean lookup dictionary.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"BeanContext.beanDictionary.list"</js>
+ * <li><b>Data type:</b> <code>List<Class></code>
+ * <li><b>Default:</b> empty list
+ * <li><b>Session-overridable:</b> <jk>false</jk>
+ * </ul>
+ * <p>
+ * This list can consist of the following class 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.
+ * </ul>
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>BEAN_beanDictionary</jsf>, values)</code>.
+ * </ul>
+ *
+ * @param values The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beanDictionary
+ */
+ public CoreApi setBeanDictionary(Class<?>...values) throws LockedException {
+ return setProperty(BEAN_beanDictionary, values);
+ }
+
+ /**
+ * <b>Configuration property:</b> Bean lookup dictionary.
+ * <p>
+ * Same as {@link #setBeanDictionary(Class...)} but using a <code>Collection</code>.
+ *
+ * @param values The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beanDictionary
+ */
+ public CoreApi setBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ return setProperty(BEAN_beanDictionary, values);
+ }
+
+ /**
+ * <b>Configuration property:</b> Add to bean dictionary.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>addToProperty(<jsf>BEAN_beanDictionary</jsf>, values)</code>
+ * or <code>setProperty(<jsf>BEAN_beanDictionary_add</jsf>, c)</code>.
+ * </ul>
+ *
+ * @param values The values to add to this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beanDictionary
+ * @see BeanContext#BEAN_beanDictionary_add
+ */
+ public CoreApi addToBeanDictionary(Class<?>...values) throws LockedException {
+ return addToProperty(BEAN_beanDictionary, values);
+ }
+
+ /**
+ * <b>Configuration property:</b> Add to bean dictionary.
+ * <p>
+ * Same as {@link #addToBeanDictionary(Class...)} but using a <code>Collection</code>.
+ *
+ * @param values The values to add to this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beanDictionary
+ * @see BeanContext#BEAN_beanDictionary_add
+ */
+ public CoreApi addToBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ return addToProperty(BEAN_beanDictionary, values);
+ }
+
+ /**
+ * <b>Configuration property:</b> Remove from bean dictionary.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>removeFromProperty(<jsf>BEAN_beanDictionary</jsf>, values)</code>
+ * or <code>setProperty(<jsf>BEAN_beanDictionary_remove</jsf>, c)</code>.
+ * </ul>
+ *
+ * @param values The values to remove from this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beanDictionary
+ * @see BeanContext#BEAN_beanDictionary_remove
+ */
+ public CoreApi removeFromBeanDictionary(Class<?>...values) throws LockedException {
+ return removeFromProperty(BEAN_beanDictionary, values);
+ }
+
+ /**
+ * <b>Configuration property:</b> Remove from bean dictionary.
+ * <p>
+ * Same as {@link #removeFromBeanDictionary(Class...)} but using a <code>Collection</code>.
+ *
+ * @param values The values to remove from this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beanDictionary
+ * @see BeanContext#BEAN_beanDictionary_remove
+ */
+ public CoreApi removeFromBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ return removeFromProperty(BEAN_beanDictionary, values);
+ }
+
+ /**
+ * <b>Configuration property:</b> Name to use for the bean type properties used to represent a bean type.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"BeanContext.beanTypePropertyName"</js>
+ * <li><b>Data type:</b> <code>String</code>
+ * <li><b>Default:</b> <js>"_type"</js>
+ * <li><b>Session-overridable:</b> <jk>false</jk>
+ * </ul>
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>BEAN_beanTypePropertyName</jsf>, value)</code>.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beanTypePropertyName
+ */
+ public CoreApi setBeanTypePropertyName(String value) throws LockedException {
+ return addToProperty(BEAN_beanTypePropertyName, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> Default parser to use when converting <code>Strings</code> to POJOs.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"BeanContext.defaultParser"</js>
+ * <li><b>Data type:</b> <code>Class</code>
+ * <li><b>Default:</b> {@link JsonSerializer}
+ * <li><b>Session-overridable:</b> <jk>false</jk>
+ * </ul>
+ * <p>
+ * Used in the in the {@link BeanSession#convertToType(Object, Class)} method.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>BEAN_defaultParser</jsf>, value)</code>.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_defaultParser
+ */
+ public CoreApi setDefaultParser(Class<?> value) throws LockedException {
+ return addToProperty(BEAN_defaultParser, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> Locale.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"BeanContext.locale"</js>
+ * <li><b>Data type:</b> <code>Locale</code>
+ * <li><b>Default:</b> <code>Locale.getDefault()</code>
+ * <li><b>Session-overridable:</b> <jk>true</jk>
+ * </ul>
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>BEAN_locale</jsf>, value)</code>.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_locale
+ */
+ public CoreApi setLocale(Locale value) throws LockedException {
+ return addToProperty(BEAN_locale, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> TimeZone.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"BeanContext.timeZone"</js>
+ * <li><b>Data type:</b> <code>TimeZone</code>
+ * <li><b>Default:</b> <jk>null</jk>
+ * <li><b>Session-overridable:</b> <jk>true</jk>
+ * </ul>
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>BEAN_timeZone</jsf>, value)</code>.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_timeZone
+ */
+ public CoreApi setTimeZone(TimeZone value) throws LockedException {
+ return setProperty(BEAN_timeZone, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> Media type.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"BeanContext.mediaType"</js>
+ * <li><b>Data type:</b> <code>MediaType</code>
+ * <li><b>Default:</b> <jk>null</jk>
+ * <li><b>Session-overridable:</b> <jk>true</jk>
+ * </ul>
+ * <p>
+ * Specifies a default media type value for serializer and parser sessions.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>BEAN_mediaType</jsf>, value)</code>.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_mediaType
+ */
+ public CoreApi setMediaType(MediaType value) throws LockedException {
+ return addToProperty(BEAN_mediaType, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> Debug mode.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"BeanContext.debug"</js>
+ * <li><b>Data type:</b> <code>Boolean</code>
+ * <li><b>Default:</b> <jk>false</jk>
+ * <li><b>Session-overridable:</b> <jk>true</jk>
+ * </ul>
+ * <p>
+ * Enables the following additional information during serialization:
+ * <ul class='spaced-list'>
+ * <li>When bean getters throws exceptions, the exception includes the object stack information
+ * in order to determine how that method was invoked.
+ * <li>Enables {@link SerializerContext#SERIALIZER_detectRecursions}.
+ * </ul>
+ * <p>
+ * Enables the following additional information during parsing:
+ * <ul class='spaced-list'>
+ * <li>When bean setters throws exceptions, the exception includes the object stack information
+ * in order to determine how that method was invoked.
+ * </ul>
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>BEAN_debug</jsf>, value)</code>.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_debug
+ */
+ public CoreApi setDebug(boolean value) throws LockedException {
+ return addToProperty(BEAN_debug, value);
+ }
+
+ /**
+ * Sets the classloader used for created classes from class strings.
+ *
+ * @param classLoader The new classloader.
+ * @throws LockedException If {@link ContextFactory#lock()} was called on this class or the bean context.
+ * @return This object (for method chaining).
+ * @see ContextFactory#setClassLoader(ClassLoader)
+ */
+ public CoreApi setClassLoader(ClassLoader classLoader) throws LockedException {
+ checkLock();
+ contextFactory.setClassLoader(classLoader);
+ return this;
}
@@ -213,7 +1524,7 @@ public abstract class CoreApi extends Lockable {
//--------------------------------------------------------------------------------
@Override /* Lockable */
- public void checkLock() {
+ protected void checkLock() {
super.checkLock();
beanContext = null;
}
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/Lockable.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/Lockable.java b/juneau-core/src/main/java/org/apache/juneau/Lockable.java
index 32fb0d8..4dc1b21 100644
--- a/juneau-core/src/main/java/org/apache/juneau/Lockable.java
+++ b/juneau-core/src/main/java/org/apache/juneau/Lockable.java
@@ -53,11 +53,11 @@ public abstract class Lockable implements Cloneable {
/**
* Causes a {@link LockedException} to be thrown if this object has been locked.
* <p>
- * Also calls {@link #onUnclone()} if this is the first time this method has been called since cloning.
+ * Also calls {@link #onUnclone()} if this is the first time this method has been called since cloning.
*
* @throws LockedException If {@link #lock()} has been called on this object.
*/
- public void checkLock() throws LockedException {
+ protected void checkLock() throws LockedException {
if (isLocked)
throw new LockedException();
if (isCloned)
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/MediaType.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/MediaType.java b/juneau-core/src/main/java/org/apache/juneau/MediaType.java
index 4b54884..966f445 100644
--- a/juneau-core/src/main/java/org/apache/juneau/MediaType.java
+++ b/juneau-core/src/main/java/org/apache/juneau/MediaType.java
@@ -65,7 +65,7 @@ public final class MediaType {
* <li>Anything including and following the <js>';'</js> character is ignored (e.g. <js>";charset=X"</js>).
* </ul>
*
- * @param s - The media type string. Will be lowercased.
+ * @param s The media type string. Will be lowercased.
* <br>Returns <jk>null</jk> if input is null.
* @return A cached media type object.
*/
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/annotation/BeanParam.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/annotation/BeanParam.java b/juneau-core/src/main/java/org/apache/juneau/annotation/BeanParam.java
new file mode 100644
index 0000000..65609bd
--- /dev/null
+++ b/juneau-core/src/main/java/org/apache/juneau/annotation/BeanParam.java
@@ -0,0 +1,26 @@
+// ***************************************************************************************************************************
+// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
+// * with the License. You may obtain a copy of the License at *
+// * *
+// * http://www.apache.org/licenses/LICENSE-2.0 *
+// * *
+// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *
+// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
+// * specific language governing permissions and limitations under the License. *
+// ***************************************************************************************************************************
+package org.apache.juneau.annotation;
+
+
+/**
+ * TODO
+ */
+public @interface BeanParam {
+
+ /**
+ * TODO
+ */
+ String value() default "";
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/csv/CsvSerializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/csv/CsvSerializer.java b/juneau-core/src/main/java/org/apache/juneau/csv/CsvSerializer.java
index 1fa1a07..db04ea0 100644
--- a/juneau-core/src/main/java/org/apache/juneau/csv/CsvSerializer.java
+++ b/juneau-core/src/main/java/org/apache/juneau/csv/CsvSerializer.java
@@ -27,7 +27,7 @@ import org.apache.juneau.serializer.*;
public final class CsvSerializer extends WriterSerializer {
//--------------------------------------------------------------------------------
- // Overridden methods
+ // Entry point methods
//--------------------------------------------------------------------------------
@Override /* Serializer */
@@ -83,6 +83,11 @@ public final class CsvSerializer extends WriterSerializer {
}
}
+
+ //--------------------------------------------------------------------------------
+ // Overridden methods
+ //--------------------------------------------------------------------------------
+
@Override /* Serializer */
public CsvSerializer clone() {
try {
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/dto/Link.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/Link.java b/juneau-core/src/main/java/org/apache/juneau/dto/Link.java
index 064bedc..8c747ae 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/Link.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/Link.java
@@ -47,6 +47,7 @@ public class Link implements Comparable<Link> {
setHref(href, hrefArgs);
}
+
//--------------------------------------------------------------------------------
// Bean properties
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/dto/atom/Content.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/atom/Content.java b/juneau-core/src/main/java/org/apache/juneau/dto/atom/Content.java
index 5adf5dd..7a790d5 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/atom/Content.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/atom/Content.java
@@ -84,6 +84,7 @@ public class Content extends Text {
super();
}
+
//--------------------------------------------------------------------------------
// Bean properties
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/dto/atom/Entry.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/atom/Entry.java b/juneau-core/src/main/java/org/apache/juneau/dto/atom/Entry.java
index 15a0029..f0f40a3 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/atom/Entry.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/atom/Entry.java
@@ -193,6 +193,7 @@ public class Entry extends CommonEntry {
return this;
}
+
//--------------------------------------------------------------------------------
// Overridden setters (to simplify method chaining)
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/dto/atom/Icon.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/atom/Icon.java b/juneau-core/src/main/java/org/apache/juneau/dto/atom/Icon.java
index 9f767ef..49e0611 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/atom/Icon.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/atom/Icon.java
@@ -100,6 +100,7 @@ public class Icon extends Common {
return this;
}
+
//--------------------------------------------------------------------------------
// Overridden setters (to simplify method chaining)
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/dto/atom/Source.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/atom/Source.java b/juneau-core/src/main/java/org/apache/juneau/dto/atom/Source.java
index 0e16785..697a42a 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/atom/Source.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/atom/Source.java
@@ -152,6 +152,7 @@ public class Source extends CommonEntry {
return this;
}
+
//--------------------------------------------------------------------------------
// Overridden setters (to simplify method chaining)
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/dto/atom/package.html
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/atom/package.html b/juneau-core/src/main/java/org/apache/juneau/dto/atom/package.html
index 249b04b..88caad0 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/atom/package.html
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/atom/package.html
@@ -257,7 +257,7 @@
<h6 class='figure'>Example with namespaces with ATOM as the default namespace</h6>
<p class='bcode'>
<jc>// Create a serializer with readable output with namespaces.</jc>
- XmlSerializer s = <jk>new</jk> XmlSerializer.SqReadable().setProperty(XmlSerializerContext.<jsf>XML_defaultNamespaceUri</jsf>, <js>"atom"</js>);
+ XmlSerializer s = <jk>new</jk> XmlSerializer.SqReadable().setDefaultNamespaceUri(<js>"atom"</js>);
<jc>// Serialize to ATOM/XML</jc>
String atomXml = s.serialize(feed);
@@ -427,8 +427,8 @@
<p class='bcode'>
<jc>// Get RDF/XML serializer with readable output.</jc>
RdfSerializer s = <jk>new</jk> RdfSerializer.XmlAbbrev()
- .setProperty(SerializerContext.<jsf>SERIALIZER_useIndentation</jsf>, <jk>true</jk>)
- .setProperty(SerializerContext.<jsf>SERIALIZER_quoteChar</jsf>, <js>'\''</js>)
+ .setUseIndentation(<jk>true</jk>)
+ .setQuoteChar(<js>'\''</js>)
.setProperty(RdfProperties.<jsf>RDF_rdfxml_tab</jsf>, 3);
<jc>// Serialize to ATOM/RDF/XML</jc>
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/dto/cognos/Column.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/cognos/Column.java b/juneau-core/src/main/java/org/apache/juneau/dto/cognos/Column.java
index e1780f7..a494cb9 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/cognos/Column.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/cognos/Column.java
@@ -86,6 +86,7 @@ public class Column {
return this;
}
+
//--------------------------------------------------------------------------------
// Bean properties
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/dto/html5/A.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/html5/A.java b/juneau-core/src/main/java/org/apache/juneau/dto/html5/A.java
index f279e4e..3357497 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/html5/A.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/html5/A.java
@@ -26,7 +26,7 @@ public class A extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/links.html#attr-hyperlink-download">download</a> attribute.
* Whether to download the resource instead of navigating to it, and its file name if so.
- * @param download - The new value for this attribute.
+ * @param download The new value for this attribute.
* Typically a {@link Boolean} or {@link String}.
* @return This object (for method chaining).
*/
@@ -38,7 +38,7 @@ public class A extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/links.html#attr-hyperlink-href">href</a> attribute.
* Address of the hyperlink.
- * @param href - The new value for this attribute.
+ * @param href The new value for this attribute.
* Typically a {@link URL} or {@link String}.
* @return This object (for method chaining).
*/
@@ -50,7 +50,7 @@ public class A extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/links.html#attr-hyperlink-hreflang">hreflang</a> attribute.
* Language of the linked resource.
- * @param hreflang - The new value for this attribute.
+ * @param hreflang The new value for this attribute.
* @return This object (for method chaining).
*/
public final A hreflang(String hreflang) {
@@ -61,7 +61,7 @@ public class A extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/links.html#attr-hyperlink-rel">rel</a> attribute.
* Relationship between the document containing the hyperlink and the destination resource.
- * @param rel - The new value for this attribute.
+ * @param rel The new value for this attribute.
* @return This object (for method chaining).
*/
public final A rel(String rel) {
@@ -72,7 +72,7 @@ public class A extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/links.html#attr-hyperlink-target">target</a> attribute.
* Default browsing context for hyperlink navigation and form submission.
- * @param target - The new value for this attribute.
+ * @param target The new value for this attribute.
* @return This object (for method chaining).
*/
public final A target(String target) {
@@ -83,7 +83,7 @@ public class A extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/links.html#attr-hyperlink-type">type</a> attribute.
* Hint for the type of the referenced resource.
- * @param type - The new value for this attribute.
+ * @param type The new value for this attribute.
* @return This object (for method chaining).
*/
public final A type(String type) {
@@ -91,6 +91,7 @@ public class A extends HtmlElementMixed {
return this;
}
+
//--------------------------------------------------------------------------------
// Overridden methods
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/dto/html5/Area.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Area.java b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Area.java
index 11cd901..a096ff5 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Area.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Area.java
@@ -26,7 +26,7 @@ public class Area extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-area-alt">alt</a> attribute.
* Replacement text for use when images are not available.
- * @param alt - The new value for this attribute.
+ * @param alt The new value for this attribute.
* @return This object (for method chaining).
*/
public final Area alt(String alt) {
@@ -37,7 +37,7 @@ public class Area extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-area-coords">coords</a> attribute.
* Coordinates for the shape to be created in an image map.
- * @param coords - The new value for this attribute.
+ * @param coords The new value for this attribute.
* @return This object (for method chaining).
*/
public final Area coords(String coords) {
@@ -48,7 +48,7 @@ public class Area extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/links.html#attr-hyperlink-download">download</a> attribute.
* Whether to download the resource instead of navigating to it, and its file name if so.
- * @param download - The new value for this attribute.
+ * @param download The new value for this attribute.
* Typically a {@link Boolean} or {@link String}.
* @return This object (for method chaining).
*/
@@ -60,7 +60,7 @@ public class Area extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/links.html#attr-hyperlink-href">href</a> attribute.
* Address of the hyperlink.
- * @param href - The new value for this attribute.
+ * @param href The new value for this attribute.
* Typically a {@link URL} or {@link String}.
* @return This object (for method chaining).
*/
@@ -72,7 +72,7 @@ public class Area extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/links.html#attr-hyperlink-hreflang">hreflang</a> attribute.
* Language of the linked resource.
- * @param hreflang - The new value for this attribute.
+ * @param hreflang The new value for this attribute.
* @return This object (for method chaining).
*/
public final Area hreflang(String hreflang) {
@@ -83,7 +83,7 @@ public class Area extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/links.html#attr-hyperlink-rel">rel</a> attribute.
* Relationship between the document containing the hyperlink and the destination resource.
- * @param rel - The new value for this attribute.
+ * @param rel The new value for this attribute.
* @return This object (for method chaining).
*/
public final Area rel(String rel) {
@@ -94,7 +94,7 @@ public class Area extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-area-shape">shape</a> attribute.
* The kind of shape to be created in an image map.
- * @param shape - The new value for this attribute.
+ * @param shape The new value for this attribute.
* @return This object (for method chaining).
*/
public final Area shape(String shape) {
@@ -105,7 +105,7 @@ public class Area extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/links.html#attr-hyperlink-target">target</a> attribute.
* Browsing context for hyperlink navigation.
- * @param target - The new value for this attribute.
+ * @param target The new value for this attribute.
* @return This object (for method chaining).
*/
public final Area target(String target) {
@@ -116,7 +116,7 @@ public class Area extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/links.html#attr-hyperlink-type">type</a> attribute.
* Hint for the type of the referenced resource.
- * @param type - The new value for this attribute.
+ * @param type The new value for this attribute.
* @return This object (for method chaining).
*/
public final Area type(String type) {
@@ -124,6 +124,7 @@ public class Area extends HtmlElementEmpty {
return this;
}
+
//--------------------------------------------------------------------------------
// Overridden methods
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/dto/html5/Article.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Article.java b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Article.java
index 6276944..38dd81a 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Article.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Article.java
@@ -65,6 +65,7 @@ public class Article extends HtmlElementMixed {
return this;
}
+
//--------------------------------------------------------------------------------
// Overridden methods
//--------------------------------------------------------------------------------
[03/14] incubator-juneau git commit: Add convenience property setters
to serializers and parsers.
Posted by ja...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/urlencoding/UonSerializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/urlencoding/UonSerializer.java b/juneau-core/src/main/java/org/apache/juneau/urlencoding/UonSerializer.java
index 4a227ed..8c7848f 100644
--- a/juneau-core/src/main/java/org/apache/juneau/urlencoding/UonSerializer.java
+++ b/juneau-core/src/main/java/org/apache/juneau/urlencoding/UonSerializer.java
@@ -12,7 +12,6 @@
// ***************************************************************************************************************************
package org.apache.juneau.urlencoding;
-import static org.apache.juneau.serializer.SerializerContext.*;
import static org.apache.juneau.urlencoding.UonSerializerContext.*;
import java.lang.reflect.*;
@@ -179,46 +178,46 @@ public class UonSerializer extends WriterSerializer {
public static final UonSerializer DEFAULT_SIMPLE_ENCODING = new SimpleEncoding().lock();
/**
- * Equivalent to <code><jk>new</jk> UonSerializer().setProperty(UonSerializerContext.<jsf>UON_simpleMode</jsf>,<jk>true</jk>);</code>.
+ * Equivalent to <code><jk>new</jk> UonSerializer().setSimpleMode(<jk>true</jk>);</code>.
*/
@Produces(value="text/uon-simple",contentType="text/uon")
public static class Simple extends UonSerializer {
/** Constructor */
public Simple() {
- setProperty(UON_simpleMode, true);
+ setSimpleMode(true);
}
}
/**
- * Equivalent to <code><jk>new</jk> UonSerializer().setProperty(UonSerializerContext.<jsf>UON_useWhitespace</jsf>,<jk>true</jk>);</code>.
+ * Equivalent to <code><jk>new</jk> UonSerializer().setUseWhitespace(<jk>true</jk>).setUseIndentation(<jk>true</jk>);</code>.
*/
public static class Readable extends UonSerializer {
/** Constructor */
public Readable() {
- setProperty(UON_useWhitespace, true);
- setProperty(SERIALIZER_useIndentation, true);
+ setUseWhitespace(true);
+ setUseIndentation(true);
}
}
/**
- * Equivalent to <code><jk>new</jk> UonSerializer().setProperty(UonSerializerContext.<jsf>UON_encodeChars</jsf>,<jk>true</jk>);</code>.
+ * Equivalent to <code><jk>new</jk> UonSerializer().setEncodeChars(<jk>true</jk>);</code>.
*/
public static class Encoding extends UonSerializer {
/** Constructor */
public Encoding() {
- setProperty(UON_encodeChars, true);
+ setEncodeChars(true);
}
}
/**
- * Equivalent to <code><jk>new</jk> UonSerializer().setProperty(UonSerializerContext.<jsf>UON_simpleMode</jsf>,<jk>true</jk>).setProperty(UonSerializerContext.<jsf>UON_encodeChars</jsf>,<jk>true</jk>);</code>.
+ * Equivalent to <code><jk>new</jk> UonSerializer().setSimpleMode(<jk>true</jk>).setEncodeChars(<jk>true</jk>);</code>.
*/
@Produces(value="text/uon-simple",contentType="text/uon")
public static class SimpleEncoding extends UonSerializer {
/** Constructor */
public SimpleEncoding() {
- setProperty(UON_simpleMode, true);
- setProperty(UON_encodeChars, true);
+ setSimpleMode(true);
+ setEncodeChars(true);
}
}
@@ -397,8 +396,9 @@ public class UonSerializer extends WriterSerializer {
return out;
}
+
//--------------------------------------------------------------------------------
- // Overridden methods
+ // Entry point methods
//--------------------------------------------------------------------------------
@Override /* Serializer */
@@ -412,49 +412,604 @@ public class UonSerializer extends WriterSerializer {
serializeAnything(s, s.getWriter(), o, null, "root", null, false, true);
}
+
+ //--------------------------------------------------------------------------------
+ // Properties
+ //--------------------------------------------------------------------------------
+
+ /**
+ * <b>Configuration property:</b> Use simplified output.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"UonSerializer.simpleMode"</js>
+ * <li><b>Data type:</b> <code>Boolean</code>
+ * <li><b>Default:</b> <jk>false</jk>
+ * <li><b>Session-overridable:</b> <jk>true</jk>
+ * </ul>
+ * <p>
+ * If <jk>true</jk>, type flags will not be prepended to values in most cases.
+ * <p>
+ * Use this setting if the data types of the values (e.g. object/array/boolean/number/string)
+ * is known on the receiving end.
+ * <p>
+ * It should be noted that the default behavior produces a data structure that can
+ * be losslessly converted into JSON, and any JSON can be losslessly represented
+ * in a URL-encoded value. However, this strict equivalency does not exist
+ * when simple mode is used.
+ * <p>
+ * <table class='styled'>
+ * <tr>
+ * <th>Input (in JSON)</th>
+ * <th>Normal mode output</th>
+ * <th>Simple mode output</th>
+ * </tr>
+ * <tr>
+ * <td class='code'>{foo:'bar',baz:'bing'}</td>
+ * <td class='code'>$o(foo=bar,baz=bing)</td>
+ * <td class='code'>(foo=bar,baz=bing)</td>
+ * </tr>
+ * <tr>
+ * <td class='code'>{foo:{bar:'baz'}}</td>
+ * <td class='code'>$o(foo=$o(bar=baz))</td>
+ * <td class='code'>(foo=(bar=baz))</td>
+ * </tr>
+ * <tr>
+ * <td class='code'>['foo','bar']</td>
+ * <td class='code'>$a(foo,bar)</td>
+ * <td class='code'>(foo,bar)</td>
+ * </tr>
+ * <tr>
+ * <td class='code'>['foo',['bar','baz']]</td>
+ * <td class='code'>$a(foo,$a(bar,baz))</td>
+ * <td class='code'>(foo,(bar,baz))</td>
+ * </tr>
+ * <tr>
+ * <td class='code'>true</td>
+ * <td class='code'>$b(true)</td>
+ * <td class='code'>true</td>
+ * </tr>
+ * <tr>
+ * <td class='code'>123</td>
+ * <td class='code'>$n(123)</td>
+ * <td class='code'>123</td>
+ * </tr>
+ * </table>
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>UON_simpleMode</jsf>, value)</code>.
+ * <li>This introduces a slight performance penalty.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see UonSerializerContext#UON_simpleMode
+ */
+ public UonSerializer setSimpleMode(boolean value) throws LockedException {
+ return setProperty(UON_simpleMode, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> Use whitespace.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"UonSerializer.useWhitespace"</js>
+ * <li><b>Data type:</b> <code>Boolean</code>
+ * <li><b>Default:</b> <jk>false</jk>
+ * <li><b>Session-overridable:</b> <jk>true</jk>
+ * </ul>
+ * <p>
+ * If <jk>true</jk>, whitespace is added to the output to improve readability.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>UON_useWhitespace</jsf>, value)</code>.
+ * <li>This introduces a slight performance penalty.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see UonSerializerContext#UON_useWhitespace
+ */
+ public UonSerializer setUseWhitespace(boolean value) throws LockedException {
+ return setProperty(UON_useWhitespace, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> Encode non-valid URI characters.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"UonSerializer.encodeChars"</js>
+ * <li><b>Data type:</b> <code>Boolean</code>
+ * <li><b>Default:</b> <jk>false</jk> for {@link UonSerializer}, <jk>true</jk> for {@link UrlEncodingSerializer}
+ * <li><b>Session-overridable:</b> <jk>true</jk>
+ * </ul>
+ * <p>
+ * Encode non-valid URI characters with <js>"%xx"</js> constructs.
+ * <p>
+ * If <jk>true</jk>, non-valid URI characters will be converted to <js>"%xx"</js> sequences.
+ * Set to <jk>false</jk> if parameter value is being passed to some other code that will already
+ * perform URL-encoding of non-valid URI characters.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>UON_encodeChars</jsf>, value)</code>.
+ * <li>This introduces a slight performance penalty.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see UonSerializerContext#UON_encodeChars
+ */
+ public UonSerializer setEncodeChars(boolean value) throws LockedException {
+ return setProperty(UON_encodeChars, value);
+ }
+
+ @Override /* Serializer */
+ public UonSerializer setMaxDepth(int value) throws LockedException {
+ super.setMaxDepth(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public UonSerializer setInitialDepth(int value) throws LockedException {
+ super.setInitialDepth(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public UonSerializer setDetectRecursions(boolean value) throws LockedException {
+ super.setDetectRecursions(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public UonSerializer setIgnoreRecursions(boolean value) throws LockedException {
+ super.setIgnoreRecursions(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public UonSerializer setUseIndentation(boolean value) throws LockedException {
+ super.setUseIndentation(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public UonSerializer setAddBeanTypeProperties(boolean value) throws LockedException {
+ super.setAddBeanTypeProperties(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public UonSerializer setQuoteChar(char value) throws LockedException {
+ super.setQuoteChar(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public UonSerializer setTrimNullProperties(boolean value) throws LockedException {
+ super.setTrimNullProperties(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public UonSerializer setTrimEmptyCollections(boolean value) throws LockedException {
+ super.setTrimEmptyCollections(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public UonSerializer setTrimEmptyMaps(boolean value) throws LockedException {
+ super.setTrimEmptyMaps(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public UonSerializer setTrimStrings(boolean value) throws LockedException {
+ super.setTrimStrings(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public UonSerializer setRelativeUriBase(String value) throws LockedException {
+ super.setRelativeUriBase(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public UonSerializer setAbsolutePathUriBase(String value) throws LockedException {
+ super.setAbsolutePathUriBase(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public UonSerializer setSortCollections(boolean value) throws LockedException {
+ super.setSortCollections(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public UonSerializer setSortMaps(boolean value) throws LockedException {
+ super.setSortMaps(value);
+ return this;
+ }
+
@Override /* CoreApi */
- public UonSerializer setProperty(String property, Object value) throws LockedException {
- super.setProperty(property, value);
+ public UonSerializer setBeansRequireDefaultConstructor(boolean value) throws LockedException {
+ super.setBeansRequireDefaultConstructor(value);
return this;
}
@Override /* CoreApi */
- public UonSerializer setProperties(ObjectMap properties) throws LockedException {
- super.setProperties(properties);
+ public UonSerializer setBeansRequireSerializable(boolean value) throws LockedException {
+ super.setBeansRequireSerializable(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonSerializer setBeansRequireSettersForGetters(boolean value) throws LockedException {
+ super.setBeansRequireSettersForGetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonSerializer setBeansRequireSomeProperties(boolean value) throws LockedException {
+ super.setBeansRequireSomeProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonSerializer setBeanMapPutReturnsOldValue(boolean value) throws LockedException {
+ super.setBeanMapPutReturnsOldValue(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonSerializer setBeanConstructorVisibility(Visibility value) throws LockedException {
+ super.setBeanConstructorVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonSerializer setBeanClassVisibility(Visibility value) throws LockedException {
+ super.setBeanClassVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonSerializer setBeanFieldVisibility(Visibility value) throws LockedException {
+ super.setBeanFieldVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonSerializer setMethodVisibility(Visibility value) throws LockedException {
+ super.setMethodVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonSerializer setUseJavaBeanIntrospector(boolean value) throws LockedException {
+ super.setUseJavaBeanIntrospector(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonSerializer setUseInterfaceProxies(boolean value) throws LockedException {
+ super.setUseInterfaceProxies(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonSerializer setIgnoreUnknownBeanProperties(boolean value) throws LockedException {
+ super.setIgnoreUnknownBeanProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonSerializer setIgnoreUnknownNullBeanProperties(boolean value) throws LockedException {
+ super.setIgnoreUnknownNullBeanProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonSerializer setIgnorePropertiesWithoutSetters(boolean value) throws LockedException {
+ super.setIgnorePropertiesWithoutSetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonSerializer setIgnoreInvocationExceptionsOnGetters(boolean value) throws LockedException {
+ super.setIgnoreInvocationExceptionsOnGetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonSerializer setIgnoreInvocationExceptionsOnSetters(boolean value) throws LockedException {
+ super.setIgnoreInvocationExceptionsOnSetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonSerializer setSortProperties(boolean value) throws LockedException {
+ super.setSortProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonSerializer setNotBeanPackages(String...values) throws LockedException {
+ super.setNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonSerializer setNotBeanPackages(Collection<String> values) throws LockedException {
+ super.setNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonSerializer addNotBeanPackages(String...values) throws LockedException {
+ super.addNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonSerializer addNotBeanPackages(Collection<String> values) throws LockedException {
+ super.addNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonSerializer removeNotBeanPackages(String...values) throws LockedException {
+ super.removeNotBeanPackages(values);
return this;
}
@Override /* CoreApi */
- public UonSerializer addNotBeanClasses(Class<?>...classes) throws LockedException {
- super.addNotBeanClasses(classes);
+ public UonSerializer removeNotBeanPackages(Collection<String> values) throws LockedException {
+ super.removeNotBeanPackages(values);
return this;
}
@Override /* CoreApi */
- public UonSerializer addBeanFilters(Class<?>...classes) throws LockedException {
- super.addBeanFilters(classes);
+ public UonSerializer setNotBeanClasses(Class<?>...values) throws LockedException {
+ super.setNotBeanClasses(values);
return this;
}
@Override /* CoreApi */
- public UonSerializer addPojoSwaps(Class<?>...classes) throws LockedException {
- super.addPojoSwaps(classes);
+ public UonSerializer setNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ super.setNotBeanClasses(values);
return this;
}
@Override /* CoreApi */
- public UonSerializer addToDictionary(Class<?>...classes) throws LockedException {
- super.addToDictionary(classes);
+ public UonSerializer addNotBeanClasses(Class<?>...values) throws LockedException {
+ super.addNotBeanClasses(values);
return this;
}
@Override /* CoreApi */
- public <T> UonSerializer addImplClass(Class<T> interfaceClass, Class<? extends T> implClass) throws LockedException {
+ public UonSerializer addNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ super.addNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonSerializer removeNotBeanClasses(Class<?>...values) throws LockedException {
+ super.removeNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonSerializer removeNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ super.removeNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonSerializer setBeanFilters(Class<?>...values) throws LockedException {
+ super.setBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonSerializer setBeanFilters(Collection<Class<?>> values) throws LockedException {
+ super.setBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonSerializer addBeanFilters(Class<?>...values) throws LockedException {
+ super.addBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonSerializer addBeanFilters(Collection<Class<?>> values) throws LockedException {
+ super.addBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonSerializer removeBeanFilters(Class<?>...values) throws LockedException {
+ super.removeBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonSerializer removeBeanFilters(Collection<Class<?>> values) throws LockedException {
+ super.removeBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonSerializer setPojoSwaps(Class<?>...values) throws LockedException {
+ super.setPojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonSerializer setPojoSwaps(Collection<Class<?>> values) throws LockedException {
+ super.setPojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonSerializer addPojoSwaps(Class<?>...values) throws LockedException {
+ super.addPojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonSerializer addPojoSwaps(Collection<Class<?>> values) throws LockedException {
+ super.addPojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonSerializer removePojoSwaps(Class<?>...values) throws LockedException {
+ super.removePojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonSerializer removePojoSwaps(Collection<Class<?>> values) throws LockedException {
+ super.removePojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonSerializer setImplClasses(Map<Class<?>,Class<?>> values) throws LockedException {
+ super.setImplClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public <T> CoreApi addImplClass(Class<T> interfaceClass, Class<? extends T> implClass) throws LockedException {
super.addImplClass(interfaceClass, implClass);
return this;
}
@Override /* CoreApi */
+ public UonSerializer setBeanDictionary(Class<?>...values) throws LockedException {
+ super.setBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonSerializer setBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ super.setBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonSerializer addToBeanDictionary(Class<?>...values) throws LockedException {
+ super.addToBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonSerializer addToBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ super.addToBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonSerializer removeFromBeanDictionary(Class<?>...values) throws LockedException {
+ super.removeFromBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonSerializer removeFromBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ super.removeFromBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonSerializer setBeanTypePropertyName(String value) throws LockedException {
+ super.setBeanTypePropertyName(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonSerializer setDefaultParser(Class<?> value) throws LockedException {
+ super.setDefaultParser(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonSerializer setLocale(Locale value) throws LockedException {
+ super.setLocale(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonSerializer setTimeZone(TimeZone value) throws LockedException {
+ super.setTimeZone(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonSerializer setMediaType(MediaType value) throws LockedException {
+ super.setMediaType(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonSerializer setDebug(boolean value) throws LockedException {
+ super.setDebug(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonSerializer setProperty(String name, Object value) throws LockedException {
+ super.setProperty(name, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonSerializer setProperties(ObjectMap properties) throws LockedException {
+ super.setProperties(properties);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonSerializer addToProperty(String name, Object value) throws LockedException {
+ super.addToProperty(name, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonSerializer putToProperty(String name, Object key, Object value) throws LockedException {
+ super.putToProperty(name, key, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonSerializer putToProperty(String name, Object value) throws LockedException {
+ super.putToProperty(name, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonSerializer removeFromProperty(String name, Object value) throws LockedException {
+ super.removeFromProperty(name, value);
+ return this;
+ }
+
+
+ //--------------------------------------------------------------------------------
+ // Overridden methods
+ //--------------------------------------------------------------------------------
+
+ @Override /* CoreApi */
public UonSerializer setClassLoader(ClassLoader classLoader) throws LockedException {
super.setClassLoader(classLoader);
return this;
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/urlencoding/UonSerializerContext.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/urlencoding/UonSerializerContext.java b/juneau-core/src/main/java/org/apache/juneau/urlencoding/UonSerializerContext.java
index 5c7e30e..db0cb2f 100644
--- a/juneau-core/src/main/java/org/apache/juneau/urlencoding/UonSerializerContext.java
+++ b/juneau-core/src/main/java/org/apache/juneau/urlencoding/UonSerializerContext.java
@@ -21,45 +21,8 @@ import org.apache.juneau.serializer.*;
* Context properties are set by calling {@link ContextFactory#setProperty(String, Object)} on the context factory
* returned {@link CoreApi#getContextFactory()}.
* <p>
- * The following convenience methods are also provided for setting context properties:
- * <ul>
- * <li>{@link UonSerializer#setProperty(String,Object)}
- * <li>{@link UonSerializer#setProperties(ObjectMap)}
- * <li>{@link UonSerializer#addNotBeanClasses(Class[])}
- * <li>{@link UonSerializer#addBeanFilters(Class[])}
- * <li>{@link UonSerializer#addPojoSwaps(Class[])}
- * <li>{@link UonSerializer#addToDictionary(Class[])}
- * <li>{@link UonSerializer#addImplClass(Class,Class)}
- * </ul>
- * <p>
* See {@link ContextFactory} for more information about context properties.
*
- * <h6 class='topic' id='ConfigProperties'>Configurable properties on the URL-Encoding and UON serializers</h6>
- * <table class='styled' style='border-collapse: collapse;'>
- * <tr><th>Setting name</th><th>Description</th><th>Data type</th><th>Default value</th><th>Session overridable</th></tr>
- * <tr>
- * <td>{@link #UON_simpleMode}</td>
- * <td>Use simplified output.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>false</jk></td>
- * <td><jk>true</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #UON_useWhitespace}</td>
- * <td>Use whitespace.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>false</jk></td>
- * <td><jk>true</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #UON_encodeChars}</td>
- * <td>Encode non-valid URI characters.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>false</jk> for {@link UonSerializer}<br><jk>true</jk> for {@link UrlEncodingSerializer}</td>
- * <td><jk>true</jk></td>
- * </tr>
- * </table>
- *
* <h5 class='section'>Inherited configurable properties:</h5>
* <ul class='javahierarchy'>
* <li class='c'><a class="doclink" href="../BeanContext.html#ConfigProperties">BeanContext</a> - Properties associated with handling beans on serializers and parsers.
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/urlencoding/UonWriter.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/urlencoding/UonWriter.java b/juneau-core/src/main/java/org/apache/juneau/urlencoding/UonWriter.java
index 118b5e8..7025620 100644
--- a/juneau-core/src/main/java/org/apache/juneau/urlencoding/UonWriter.java
+++ b/juneau-core/src/main/java/org/apache/juneau/urlencoding/UonWriter.java
@@ -192,6 +192,7 @@ public final class UonWriter extends SerializerWriter {
return appendObject(s, false, false, isTop);
}
+
//--------------------------------------------------------------------------------
// Overridden methods
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingContext.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingContext.java b/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingContext.java
index 95fe474..0a0fd5d 100644
--- a/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingContext.java
+++ b/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingContext.java
@@ -34,7 +34,7 @@ public final class UrlEncodingContext implements Cloneable {
* }
*
* UrlEncodingSerializer s1 = <jk>new</jk> UrlEncodingParser();
- * UrlEncodingSerializer s2 = <jk>new</jk> UrlEncodingParser().setProperty(UrlEncodingContext.<jsf>URLENC_expandedParams</jsf>, <jk>true</jk>);
+ * UrlEncodingSerializer s2 = <jk>new</jk> UrlEncodingParser().setExpandedParams(<jk>true</jk>);
*
* String s1 = p1.serialize(<jk>new</jk> A()); <jc>// Produces "f1=(a,b)&f2=(c,d)"</jc>
* String s2 = p2.serialize(<jk>new</jk> A()); <jc>// Produces "f1=a&f1=b&f2=c&f2=d"</jc>
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParser.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParser.java b/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParser.java
index 2c68e09..460e919 100644
--- a/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParser.java
+++ b/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParser.java
@@ -12,7 +12,7 @@
// ***************************************************************************************************************************
package org.apache.juneau.urlencoding;
-import static org.apache.juneau.urlencoding.UonParserContext.*;
+import static org.apache.juneau.urlencoding.UrlEncodingParserContext.*;
import java.lang.reflect.*;
import java.util.*;
@@ -54,13 +54,13 @@ public class UrlEncodingParser extends UonParser {
public static final UrlEncodingParser DEFAULT = new UrlEncodingParser().lock();
/** Reusable instance of {@link UrlEncodingParser}. */
- public static final UrlEncodingParser DEFAULT_WS_AWARE = new UrlEncodingParser().setProperty(UON_whitespaceAware, true).lock();
+ public static final UrlEncodingParser DEFAULT_WS_AWARE = new UrlEncodingParser().setWhitespaceAware(true).lock();
/**
* Constructor.
*/
public UrlEncodingParser() {
- setProperty(UON_decodeChars, true);
+ setDecodeChars(true);
}
private <T> T parseAnything(UrlEncodingParserSession session, ClassMeta<T> eType, ParserReader r, Object outer) throws Exception {
@@ -501,8 +501,9 @@ public class UrlEncodingParser extends UonParser {
}
}
+
//--------------------------------------------------------------------------------
- // Overridden methods
+ // Entry point methods
//--------------------------------------------------------------------------------
@Override /* Parser */
@@ -536,49 +537,469 @@ public class UrlEncodingParser extends UonParser {
return m;
}
+
+ //--------------------------------------------------------------------------------
+ // Properties
+ //--------------------------------------------------------------------------------
+
+ /**
+ * <b>Configuration property:</b> Serialize bean property collections/arrays as separate key/value pairs.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"UrlEncoding.expandedParams"</js>
+ * <li><b>Data type:</b> <code>Boolean</code>
+ * <li><b>Default:</b> <jk>false</jk>
+ * <li><b>Session-overridable:</b> <jk>true</jk>
+ * </ul>
+ * <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>.
+ *
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode'>
+ * <jk>public class</jk> A {
+ * <jk>public</jk> String[] f1 = {<js>"a"</js>,<js>"b"</js>};
+ * <jk>public</jk> List<String> f2 = <jk>new</jk> LinkedList<String>(Arrays.<jsm>asList</jsm>(<jk>new</jk> String[]{<js>"c"</js>,<js>"d"</js>}));
+ * }
+ *
+ * UrlEncodingSerializer s1 = <jk>new</jk> UrlEncodingParser();
+ * UrlEncodingSerializer s2 = <jk>new</jk> UrlEncodingParser().setExpandedParams(<jk>true</jk>);
+ *
+ * String s1 = p1.serialize(<jk>new</jk> A()); <jc>// Produces "f1=(a,b)&f2=(c,d)"</jc>
+ * String s2 = p2.serialize(<jk>new</jk> A()); <jc>// Produces "f1=a&f1=b&f2=c&f2=d"</jc>
+ * </p>
+ * <p>
+ * This option only applies to beans.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>If parsing multi-part parameters, it's highly recommended to use Collections or Lists
+ * as bean property types instead of arrays since arrays have to be recreated from scratch every time a value
+ * is added to it.
+ * </ul>
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>URLENC_expandedParams</jsf>, value)</code>.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see UrlEncodingParserContext#URLENC_expandedParams
+ */
+ public UrlEncodingParser setExpandedParams(boolean value) throws LockedException {
+ return setProperty(URLENC_expandedParams, value);
+ }
+
+ @Override /* UonParser */
+ public UrlEncodingParser setDecodeChars(boolean value) throws LockedException {
+ super.setDecodeChars(value);
+ return this;
+ }
+
+ @Override /* UonParser */
+ public UrlEncodingParser setWhitespaceAware(boolean value) throws LockedException {
+ super.setWhitespaceAware(value);
+ return this;
+ }
+
+ @Override /* Parser */
+ public UrlEncodingParser setTrimStrings(boolean value) throws LockedException {
+ super.setTrimStrings(value);
+ return this;
+ }
+
+ @Override /* Parser */
+ public UrlEncodingParser setStrict(boolean value) throws LockedException {
+ super.setStrict(value);
+ return this;
+ }
+
+ @Override /* Parser */
+ public UrlEncodingParser setInputStreamCharset(String value) throws LockedException {
+ super.setInputStreamCharset(value);
+ return this;
+ }
+
@Override /* Parser */
- public UrlEncodingParser setProperty(String property, Object value) throws LockedException {
- super.setProperty(property, value);
+ public UrlEncodingParser setFileCharset(String value) throws LockedException {
+ super.setFileCharset(value);
return this;
}
@Override /* CoreApi */
- public UrlEncodingParser setProperties(ObjectMap properties) throws LockedException {
- super.setProperties(properties);
+ public UrlEncodingParser setBeansRequireDefaultConstructor(boolean value) throws LockedException {
+ super.setBeansRequireDefaultConstructor(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingParser setBeansRequireSerializable(boolean value) throws LockedException {
+ super.setBeansRequireSerializable(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingParser setBeansRequireSettersForGetters(boolean value) throws LockedException {
+ super.setBeansRequireSettersForGetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingParser setBeansRequireSomeProperties(boolean value) throws LockedException {
+ super.setBeansRequireSomeProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingParser setBeanMapPutReturnsOldValue(boolean value) throws LockedException {
+ super.setBeanMapPutReturnsOldValue(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingParser setBeanConstructorVisibility(Visibility value) throws LockedException {
+ super.setBeanConstructorVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingParser setBeanClassVisibility(Visibility value) throws LockedException {
+ super.setBeanClassVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingParser setBeanFieldVisibility(Visibility value) throws LockedException {
+ super.setBeanFieldVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingParser setMethodVisibility(Visibility value) throws LockedException {
+ super.setMethodVisibility(value);
return this;
}
@Override /* CoreApi */
- public UrlEncodingParser addNotBeanClasses(Class<?>...classes) throws LockedException {
- super.addNotBeanClasses(classes);
+ public UrlEncodingParser setUseJavaBeanIntrospector(boolean value) throws LockedException {
+ super.setUseJavaBeanIntrospector(value);
return this;
}
@Override /* CoreApi */
- public UrlEncodingParser addBeanFilters(Class<?>...classes) throws LockedException {
- super.addBeanFilters(classes);
+ public UrlEncodingParser setUseInterfaceProxies(boolean value) throws LockedException {
+ super.setUseInterfaceProxies(value);
return this;
}
@Override /* CoreApi */
- public UrlEncodingParser addPojoSwaps(Class<?>...classes) throws LockedException {
- super.addPojoSwaps(classes);
+ public UrlEncodingParser setIgnoreUnknownBeanProperties(boolean value) throws LockedException {
+ super.setIgnoreUnknownBeanProperties(value);
return this;
}
@Override /* CoreApi */
- public UrlEncodingParser addToDictionary(Class<?>...classes) throws LockedException {
- super.addToDictionary(classes);
+ public UrlEncodingParser setIgnoreUnknownNullBeanProperties(boolean value) throws LockedException {
+ super.setIgnoreUnknownNullBeanProperties(value);
return this;
}
@Override /* CoreApi */
- public <T> UrlEncodingParser addImplClass(Class<T> interfaceClass, Class<? extends T> implClass) throws LockedException {
+ public UrlEncodingParser setIgnorePropertiesWithoutSetters(boolean value) throws LockedException {
+ super.setIgnorePropertiesWithoutSetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingParser setIgnoreInvocationExceptionsOnGetters(boolean value) throws LockedException {
+ super.setIgnoreInvocationExceptionsOnGetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingParser setIgnoreInvocationExceptionsOnSetters(boolean value) throws LockedException {
+ super.setIgnoreInvocationExceptionsOnSetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingParser setSortProperties(boolean value) throws LockedException {
+ super.setSortProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingParser setNotBeanPackages(String...values) throws LockedException {
+ super.setNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingParser setNotBeanPackages(Collection<String> values) throws LockedException {
+ super.setNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingParser addNotBeanPackages(String...values) throws LockedException {
+ super.addNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingParser addNotBeanPackages(Collection<String> values) throws LockedException {
+ super.addNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingParser removeNotBeanPackages(String...values) throws LockedException {
+ super.removeNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingParser removeNotBeanPackages(Collection<String> values) throws LockedException {
+ super.removeNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingParser setNotBeanClasses(Class<?>...values) throws LockedException {
+ super.setNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingParser setNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ super.setNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingParser addNotBeanClasses(Class<?>...values) throws LockedException {
+ super.addNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingParser addNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ super.addNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingParser removeNotBeanClasses(Class<?>...values) throws LockedException {
+ super.removeNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingParser removeNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ super.removeNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingParser setBeanFilters(Class<?>...values) throws LockedException {
+ super.setBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingParser setBeanFilters(Collection<Class<?>> values) throws LockedException {
+ super.setBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingParser addBeanFilters(Class<?>...values) throws LockedException {
+ super.addBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingParser addBeanFilters(Collection<Class<?>> values) throws LockedException {
+ super.addBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingParser removeBeanFilters(Class<?>...values) throws LockedException {
+ super.removeBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingParser removeBeanFilters(Collection<Class<?>> values) throws LockedException {
+ super.removeBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingParser setPojoSwaps(Class<?>...values) throws LockedException {
+ super.setPojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingParser setPojoSwaps(Collection<Class<?>> values) throws LockedException {
+ super.setPojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingParser addPojoSwaps(Class<?>...values) throws LockedException {
+ super.addPojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingParser addPojoSwaps(Collection<Class<?>> values) throws LockedException {
+ super.addPojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingParser removePojoSwaps(Class<?>...values) throws LockedException {
+ super.removePojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingParser removePojoSwaps(Collection<Class<?>> values) throws LockedException {
+ super.removePojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingParser setImplClasses(Map<Class<?>,Class<?>> values) throws LockedException {
+ super.setImplClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public <T> CoreApi addImplClass(Class<T> interfaceClass, Class<? extends T> implClass) throws LockedException {
super.addImplClass(interfaceClass, implClass);
return this;
}
@Override /* CoreApi */
+ public UrlEncodingParser setBeanDictionary(Class<?>...values) throws LockedException {
+ super.setBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingParser setBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ super.setBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingParser addToBeanDictionary(Class<?>...values) throws LockedException {
+ super.addToBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingParser addToBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ super.addToBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingParser removeFromBeanDictionary(Class<?>...values) throws LockedException {
+ super.removeFromBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingParser removeFromBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ super.removeFromBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingParser setBeanTypePropertyName(String value) throws LockedException {
+ super.setBeanTypePropertyName(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingParser setDefaultParser(Class<?> value) throws LockedException {
+ super.setDefaultParser(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingParser setLocale(Locale value) throws LockedException {
+ super.setLocale(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingParser setTimeZone(TimeZone value) throws LockedException {
+ super.setTimeZone(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingParser setMediaType(MediaType value) throws LockedException {
+ super.setMediaType(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingParser setDebug(boolean value) throws LockedException {
+ super.setDebug(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingParser setProperty(String name, Object value) throws LockedException {
+ super.setProperty(name, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingParser setProperties(ObjectMap properties) throws LockedException {
+ super.setProperties(properties);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingParser addToProperty(String name, Object value) throws LockedException {
+ super.addToProperty(name, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingParser putToProperty(String name, Object key, Object value) throws LockedException {
+ super.putToProperty(name, key, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingParser putToProperty(String name, Object value) throws LockedException {
+ super.putToProperty(name, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingParser removeFromProperty(String name, Object value) throws LockedException {
+ super.removeFromProperty(name, value);
+ return this;
+ }
+
+
+ //--------------------------------------------------------------------------------
+ // Overridden methods
+ //--------------------------------------------------------------------------------
+
+ @Override /* CoreApi */
public UrlEncodingParser setClassLoader(ClassLoader classLoader) throws LockedException {
super.setClassLoader(classLoader);
return this;
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParserContext.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParserContext.java b/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParserContext.java
index fa13729..20b33e3 100644
--- a/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParserContext.java
+++ b/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParserContext.java
@@ -20,30 +20,7 @@ import org.apache.juneau.*;
* Context properties are set by calling {@link ContextFactory#setProperty(String, Object)} on the context factory
* returned {@link CoreApi#getContextFactory()}.
* <p>
- * The following convenience methods are also provided for setting context properties:
- * <ul>
- * <li>{@link UrlEncodingParser#setProperty(String,Object)}
- * <li>{@link UrlEncodingParser#setProperties(ObjectMap)}
- * <li>{@link UrlEncodingParser#addNotBeanClasses(Class[])}
- * <li>{@link UrlEncodingParser#addBeanFilters(Class[])}
- * <li>{@link UrlEncodingParser#addPojoSwaps(Class[])}
- * <li>{@link UrlEncodingParser#addToDictionary(Class[])}
- * <li>{@link UrlEncodingParser#addImplClass(Class,Class)}
- * </ul>
- * <p>
* See {@link ContextFactory} for more information about context properties.
- *
- * <h6 class='topic' id='ConfigProperties'>Configurable properties on the URL-Encoding parser</h6>
- * <table class='styled' style='border-collapse: collapse;'>
- * <tr><th>Setting name</th><th>Description</th><th>Data type</th><th>Default value</th><th>Session overridable</th></tr>
- * <tr>
- * <td>{@link #URLENC_expandedParams}</td>
- * <td>Serialize bean property collections/arrays as separate key/value pairs.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>false</jk></td>
- * <td><jk>true</jk></td>
- * </tr>
- * </table>
*/
public class UrlEncodingParserContext extends UonParserContext {
@@ -68,7 +45,7 @@ public class UrlEncodingParserContext extends UonParserContext {
* }
*
* UrlEncodingSerializer s1 = <jk>new</jk> UrlEncodingParser();
- * UrlEncodingSerializer s2 = <jk>new</jk> UrlEncodingParser().setProperty(UrlEncodingContext.<jsf>URLENC_expandedParams</jsf>, <jk>true</jk>);
+ * UrlEncodingSerializer s2 = <jk>new</jk> UrlEncodingParser().setExpandedParams(<jk>true</jk>);
*
* String s1 = p1.serialize(<jk>new</jk> A()); <jc>// Produces "f1=(a,b)&f2=(c,d)"</jc>
* String s2 = p2.serialize(<jk>new</jk> A()); <jc>// Produces "f1=a&f1=b&f2=c&f2=d"</jc>
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializer.java b/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializer.java
index 6bb81d5..232ce6b 100644
--- a/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializer.java
+++ b/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializer.java
@@ -12,7 +12,6 @@
// ***************************************************************************************************************************
package org.apache.juneau.urlencoding;
-import static org.apache.juneau.urlencoding.UonSerializerContext.*;
import static org.apache.juneau.urlencoding.UrlEncodingSerializerContext.*;
import java.io.*;
@@ -179,38 +178,38 @@ public class UrlEncodingSerializer extends UonSerializer {
* Constructor.
*/
public UrlEncodingSerializer() {
- setProperty(UON_encodeChars, true);
+ setEncodeChars(true);
}
/**
- * Equivalent to <code><jk>new</jk> UrlEncodingSerializer().setProperty(UonSerializerContext.<jsf>UON_simpleMode</jsf>,<jk>true</jk>);</code>.
+ * Equivalent to <code><jk>new</jk> UrlEncodingSerializer().setSimpleMode(<jk>true</jk>);</code>.
*/
@Produces(value="application/x-www-form-urlencoded-simple",contentType="application/x-www-form-urlencoded")
public static class Simple extends UrlEncodingSerializer {
/** Constructor */
public Simple() {
- setProperty(UON_simpleMode, true);
+ setSimpleMode(true);
}
}
/**
- * Equivalent to <code><jk>new</jk> UrlEncodingSerializer().setProperty(UonSerializerContext.<jsf>UON_simpleMode</jsf>,<jk>true</jk>).setProperty(UonSerializerContext.<jsf>URLENC_expandedParams</jsf>,<jk>true</jk>);</code>.
+ * Equivalent to <code><jk>new</jk> UrlEncodingSerializer().setSimpleMode(<jk>true</jk>).setExpandedParams(<jk>true</jk>);</code>.
*/
@Produces(value="application/x-www-form-urlencoded-simple",contentType="application/x-www-form-urlencoded")
public static class SimpleExpanded extends Simple {
/** Constructor */
public SimpleExpanded() {
- setProperty(URLENC_expandedParams, true);
+ setExpandedParams(true);
}
}
/**
- * Equivalent to <code><jk>new</jk> UrlEncodingSerializer().setProperty(UonSerializerContext.<jsf>UON_useWhitespace</jsf>,<jk>true</jk>);</code>.
+ * Equivalent to <code><jk>new</jk> UrlEncodingSerializer().setUseWhitespace(<jk>true</jk>);</code>.
*/
public static class Readable extends UrlEncodingSerializer {
/** Constructor */
public Readable() {
- setProperty(UON_useWhitespace, true);
+ setUseWhitespace(true);
}
}
@@ -359,6 +358,7 @@ public class UrlEncodingSerializer extends UonSerializer {
return out;
}
+
//--------------------------------------------------------------------------------
// Methods for constructing individual parameter values.
//--------------------------------------------------------------------------------
@@ -390,7 +390,7 @@ public class UrlEncodingSerializer extends UonSerializer {
//--------------------------------------------------------------------------------
- // Overridden methods
+ // Entry point methods
//--------------------------------------------------------------------------------
@Override /* Serializer */
@@ -404,49 +404,542 @@ public class UrlEncodingSerializer extends UonSerializer {
serializeAnything(s, s.getWriter(), o);
}
+
+ //--------------------------------------------------------------------------------
+ // Properties
+ //--------------------------------------------------------------------------------
+
+ /**
+ * <b>Configuration property:</b> Serialize bean property collections/arrays as separate key/value pairs.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"UrlEncoding.expandedParams"</js>
+ * <li><b>Data type:</b> <code>Boolean</code>
+ * <li><b>Default:</b> <jk>false</jk>
+ * <li><b>Session-overridable:</b> <jk>true</jk>
+ * </ul>
+ * <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>.
+ *
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode'>
+ * <jk>public class</jk> A {
+ * <jk>public</jk> String[] f1 = {<js>"a"</js>,<js>"b"</js>};
+ * <jk>public</jk> List<String> f2 = <jk>new</jk> LinkedList<String>(Arrays.<jsm>asList</jsm>(<jk>new</jk> String[]{<js>"c"</js>,<js>"d"</js>}));
+ * }
+ *
+ * UrlEncodingSerializer s1 = <jk>new</jk> UrlEncodingParser();
+ * UrlEncodingSerializer s2 = <jk>new</jk> UrlEncodingParser().setExpandedParams(<jk>true</jk>);
+ *
+ * String s1 = p1.serialize(<jk>new</jk> A()); <jc>// Produces "f1=(a,b)&f2=(c,d)"</jc>
+ * String s2 = p2.serialize(<jk>new</jk> A()); <jc>// Produces "f1=a&f1=b&f2=c&f2=d"</jc>
+ * </p>
+ * <p>
+ * This option only applies to beans.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>If parsing multi-part parameters, it's highly recommended to use Collections or Lists
+ * as bean property types instead of arrays since arrays have to be recreated from scratch every time a value
+ * is added to it.
+ * </ul>
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>URLENC_expandedParams</jsf>, value)</code>.
+ * <li>This introduces a slight performance penalty.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see UrlEncodingSerializerContext#URLENC_expandedParams
+ */
+ public UrlEncodingSerializer setExpandedParams(boolean value) throws LockedException {
+ return setProperty(URLENC_expandedParams, value);
+ }
+
+ @Override /* UonSerializer */
+ public UrlEncodingSerializer setSimpleMode(boolean value) throws LockedException {
+ super.setSimpleMode(value);
+ return this;
+ }
+
+ @Override /* UonSerializer */
+ public UrlEncodingSerializer setUseWhitespace(boolean value) throws LockedException {
+ super.setUseWhitespace(value);
+ return this;
+ }
+
+ @Override /* UonSerializer */
+ public UrlEncodingSerializer setEncodeChars(boolean value) throws LockedException {
+ super.setEncodeChars(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public UrlEncodingSerializer setMaxDepth(int value) throws LockedException {
+ super.setMaxDepth(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public UrlEncodingSerializer setInitialDepth(int value) throws LockedException {
+ super.setInitialDepth(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public UrlEncodingSerializer setDetectRecursions(boolean value) throws LockedException {
+ super.setDetectRecursions(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public UrlEncodingSerializer setIgnoreRecursions(boolean value) throws LockedException {
+ super.setIgnoreRecursions(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public UrlEncodingSerializer setUseIndentation(boolean value) throws LockedException {
+ super.setUseIndentation(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public UrlEncodingSerializer setAddBeanTypeProperties(boolean value) throws LockedException {
+ super.setAddBeanTypeProperties(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public UrlEncodingSerializer setQuoteChar(char value) throws LockedException {
+ super.setQuoteChar(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public UrlEncodingSerializer setTrimNullProperties(boolean value) throws LockedException {
+ super.setTrimNullProperties(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public UrlEncodingSerializer setTrimEmptyCollections(boolean value) throws LockedException {
+ super.setTrimEmptyCollections(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public UrlEncodingSerializer setTrimEmptyMaps(boolean value) throws LockedException {
+ super.setTrimEmptyMaps(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public UrlEncodingSerializer setTrimStrings(boolean value) throws LockedException {
+ super.setTrimStrings(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public UrlEncodingSerializer setRelativeUriBase(String value) throws LockedException {
+ super.setRelativeUriBase(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public UrlEncodingSerializer setAbsolutePathUriBase(String value) throws LockedException {
+ super.setAbsolutePathUriBase(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public UrlEncodingSerializer setSortCollections(boolean value) throws LockedException {
+ super.setSortCollections(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public UrlEncodingSerializer setSortMaps(boolean value) throws LockedException {
+ super.setSortMaps(value);
+ return this;
+ }
+
@Override /* CoreApi */
- public UrlEncodingSerializer setProperty(String property, Object value) throws LockedException {
- super.setProperty(property, value);
+ public UrlEncodingSerializer setBeansRequireDefaultConstructor(boolean value) throws LockedException {
+ super.setBeansRequireDefaultConstructor(value);
return this;
}
@Override /* CoreApi */
- public UrlEncodingSerializer setProperties(ObjectMap properties) throws LockedException {
- super.setProperties(properties);
+ public UrlEncodingSerializer setBeansRequireSerializable(boolean value) throws LockedException {
+ super.setBeansRequireSerializable(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingSerializer setBeansRequireSettersForGetters(boolean value) throws LockedException {
+ super.setBeansRequireSettersForGetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingSerializer setBeansRequireSomeProperties(boolean value) throws LockedException {
+ super.setBeansRequireSomeProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingSerializer setBeanMapPutReturnsOldValue(boolean value) throws LockedException {
+ super.setBeanMapPutReturnsOldValue(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingSerializer setBeanConstructorVisibility(Visibility value) throws LockedException {
+ super.setBeanConstructorVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingSerializer setBeanClassVisibility(Visibility value) throws LockedException {
+ super.setBeanClassVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingSerializer setBeanFieldVisibility(Visibility value) throws LockedException {
+ super.setBeanFieldVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingSerializer setMethodVisibility(Visibility value) throws LockedException {
+ super.setMethodVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingSerializer setUseJavaBeanIntrospector(boolean value) throws LockedException {
+ super.setUseJavaBeanIntrospector(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingSerializer setUseInterfaceProxies(boolean value) throws LockedException {
+ super.setUseInterfaceProxies(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingSerializer setIgnoreUnknownBeanProperties(boolean value) throws LockedException {
+ super.setIgnoreUnknownBeanProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingSerializer setIgnoreUnknownNullBeanProperties(boolean value) throws LockedException {
+ super.setIgnoreUnknownNullBeanProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingSerializer setIgnorePropertiesWithoutSetters(boolean value) throws LockedException {
+ super.setIgnorePropertiesWithoutSetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingSerializer setIgnoreInvocationExceptionsOnGetters(boolean value) throws LockedException {
+ super.setIgnoreInvocationExceptionsOnGetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingSerializer setIgnoreInvocationExceptionsOnSetters(boolean value) throws LockedException {
+ super.setIgnoreInvocationExceptionsOnSetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingSerializer setSortProperties(boolean value) throws LockedException {
+ super.setSortProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingSerializer setNotBeanPackages(String...values) throws LockedException {
+ super.setNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingSerializer setNotBeanPackages(Collection<String> values) throws LockedException {
+ super.setNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingSerializer addNotBeanPackages(String...values) throws LockedException {
+ super.addNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingSerializer addNotBeanPackages(Collection<String> values) throws LockedException {
+ super.addNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingSerializer removeNotBeanPackages(String...values) throws LockedException {
+ super.removeNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingSerializer removeNotBeanPackages(Collection<String> values) throws LockedException {
+ super.removeNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingSerializer setNotBeanClasses(Class<?>...values) throws LockedException {
+ super.setNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingSerializer setNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ super.setNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingSerializer addNotBeanClasses(Class<?>...values) throws LockedException {
+ super.addNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingSerializer addNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ super.addNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingSerializer removeNotBeanClasses(Class<?>...values) throws LockedException {
+ super.removeNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingSerializer removeNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ super.removeNotBeanClasses(values);
return this;
}
@Override /* CoreApi */
- public UrlEncodingSerializer addNotBeanClasses(Class<?>...classes) throws LockedException {
- super.addNotBeanClasses(classes);
+ public UrlEncodingSerializer setBeanFilters(Class<?>...values) throws LockedException {
+ super.setBeanFilters(values);
return this;
}
@Override /* CoreApi */
- public UrlEncodingSerializer addBeanFilters(Class<?>...classes) throws LockedException {
- super.addBeanFilters(classes);
+ public UrlEncodingSerializer setBeanFilters(Collection<Class<?>> values) throws LockedException {
+ super.setBeanFilters(values);
return this;
}
@Override /* CoreApi */
- public UrlEncodingSerializer addPojoSwaps(Class<?>...classes) throws LockedException {
- super.addPojoSwaps(classes);
+ public UrlEncodingSerializer addBeanFilters(Class<?>...values) throws LockedException {
+ super.addBeanFilters(values);
return this;
}
@Override /* CoreApi */
- public UrlEncodingSerializer addToDictionary(Class<?>...classes) throws LockedException {
- super.addToDictionary(classes);
+ public UrlEncodingSerializer addBeanFilters(Collection<Class<?>> values) throws LockedException {
+ super.addBeanFilters(values);
return this;
}
@Override /* CoreApi */
- public <T> UrlEncodingSerializer addImplClass(Class<T> interfaceClass, Class<? extends T> implClass) throws LockedException {
+ public UrlEncodingSerializer removeBeanFilters(Class<?>...values) throws LockedException {
+ super.removeBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingSerializer removeBeanFilters(Collection<Class<?>> values) throws LockedException {
+ super.removeBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingSerializer setPojoSwaps(Class<?>...values) throws LockedException {
+ super.setPojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingSerializer setPojoSwaps(Collection<Class<?>> values) throws LockedException {
+ super.setPojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingSerializer addPojoSwaps(Class<?>...values) throws LockedException {
+ super.addPojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingSerializer addPojoSwaps(Collection<Class<?>> values) throws LockedException {
+ super.addPojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingSerializer removePojoSwaps(Class<?>...values) throws LockedException {
+ super.removePojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingSerializer removePojoSwaps(Collection<Class<?>> values) throws LockedException {
+ super.removePojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingSerializer setImplClasses(Map<Class<?>,Class<?>> values) throws LockedException {
+ super.setImplClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public <T> CoreApi addImplClass(Class<T> interfaceClass, Class<? extends T> implClass) throws LockedException {
super.addImplClass(interfaceClass, implClass);
return this;
}
@Override /* CoreApi */
+ public UrlEncodingSerializer setBeanDictionary(Class<?>...values) throws LockedException {
+ super.setBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingSerializer setBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ super.setBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingSerializer addToBeanDictionary(Class<?>...values) throws LockedException {
+ super.addToBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingSerializer addToBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ super.addToBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingSerializer removeFromBeanDictionary(Class<?>...values) throws LockedException {
+ super.removeFromBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingSerializer removeFromBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ super.removeFromBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingSerializer setBeanTypePropertyName(String value) throws LockedException {
+ super.setBeanTypePropertyName(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingSerializer setDefaultParser(Class<?> value) throws LockedException {
+ super.setDefaultParser(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingSerializer setLocale(Locale value) throws LockedException {
+ super.setLocale(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingSerializer setTimeZone(TimeZone value) throws LockedException {
+ super.setTimeZone(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingSerializer setMediaType(MediaType value) throws LockedException {
+ super.setMediaType(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingSerializer setDebug(boolean value) throws LockedException {
+ super.setDebug(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingSerializer setProperty(String name, Object value) throws LockedException {
+ super.setProperty(name, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingSerializer setProperties(ObjectMap properties) throws LockedException {
+ super.setProperties(properties);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingSerializer addToProperty(String name, Object value) throws LockedException {
+ super.addToProperty(name, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingSerializer putToProperty(String name, Object key, Object value) throws LockedException {
+ super.putToProperty(name, key, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingSerializer putToProperty(String name, Object value) throws LockedException {
+ super.putToProperty(name, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UrlEncodingSerializer removeFromProperty(String name, Object value) throws LockedException {
+ super.removeFromProperty(name, value);
+ return this;
+ }
+
+
+ //--------------------------------------------------------------------------------
+ // Overridden methods
+ //--------------------------------------------------------------------------------
+
+ @Override /* CoreApi */
public UrlEncodingSerializer setClassLoader(ClassLoader classLoader) throws LockedException {
super.setClassLoader(classLoader);
return this;
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializerContext.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializerContext.java b/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializerContext.java
index 0e68416..dc2c46e 100644
--- a/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializerContext.java
+++ b/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializerContext.java
@@ -20,31 +20,7 @@ import org.apache.juneau.*;
* Context properties are set by calling {@link ContextFactory#setProperty(String, Object)} on the context factory
* returned {@link CoreApi#getContextFactory()}.
* <p>
- * The following convenience methods are also provided for setting context properties:
- * <ul>
- * <li>{@link UrlEncodingSerializer#setProperty(String,Object)}
- * <li>{@link UrlEncodingSerializer#setProperties(ObjectMap)}
- * <li>{@link UrlEncodingSerializer#addNotBeanClasses(Class[])}
- * <li>{@link UrlEncodingSerializer#addBeanFilters(Class[])}
- * <li>{@link UrlEncodingSerializer#addPojoSwaps(Class[])}
- * <li>{@link UrlEncodingSerializer#addToDictionary(Class[])}
- * <li>{@link UrlEncodingSerializer#addImplClass(Class,Class)}
- * </ul>
- * <p>
* See {@link ContextFactory} for more information about context properties.
- *
- *
- * <h6 class='topic' id='ConfigProperties'>Configurable properties on the URL-Encoding serializer</h6>
- * <table class='styled' style='border-collapse: collapse;'>
- * <tr><th>Setting name</th><th>Description</th><th>Data type</th><th>Default value</th><th>Session overridable</th></tr>
- * <tr>
- * <td>{@link #URLENC_expandedParams}</td>
- * <td>Serialize bean property collections/arrays as separate key/value pairs.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>false</jk></td>
- * <td><jk>true</jk></td>
- * </tr>
- * </table>
*/
public class UrlEncodingSerializerContext extends UonSerializerContext {
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/urlencoding/package.html
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/urlencoding/package.html b/juneau-core/src/main/java/org/apache/juneau/urlencoding/package.html
index 83bebb6..d75d638 100644
--- a/juneau-core/src/main/java/org/apache/juneau/urlencoding/package.html
+++ b/juneau-core/src/main/java/org/apache/juneau/urlencoding/package.html
@@ -593,7 +593,7 @@
</p>
<p class='bcode'>
<jc>// Clone an existing serializer and set property for detecting recursions.</jc>
- UrlEncodingSerializer s = UrlEncodingSerializer.<jsf>DEFAULT_READABLE</jsf>.clone().setProperty(SerializerContext.<jsf>SERIALIZER_detectRecursions</jsf>, <jk>true</jk>);
+ UrlEncodingSerializer s = UrlEncodingSerializer.<jsf>DEFAULT_READABLE</jsf>.clone().setDetectRecursions(<jk>true</jk>);
<jc>// Create a recursive loop.</jc>
A a = <jk>new</jk> A();
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/xml/XmlDocSerializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/xml/XmlDocSerializer.java b/juneau-core/src/main/java/org/apache/juneau/xml/XmlDocSerializer.java
index 501de0f..d521717 100644
--- a/juneau-core/src/main/java/org/apache/juneau/xml/XmlDocSerializer.java
+++ b/juneau-core/src/main/java/org/apache/juneau/xml/XmlDocSerializer.java
@@ -12,8 +12,6 @@
// ***************************************************************************************************************************
package org.apache.juneau.xml;
-import static org.apache.juneau.xml.XmlSerializerContext.*;
-
import org.apache.juneau.annotation.*;
import org.apache.juneau.serializer.*;
@@ -39,12 +37,13 @@ public class XmlDocSerializer extends XmlSerializer {
public static class Simple extends XmlDocSerializer {
/** Constructor */
public Simple() {
- setProperty(XML_enableNamespaces, false);
+ setEnableNamespaces(false);
}
}
+
//--------------------------------------------------------------------------------
- // Overridden methods
+ // Entry point methods
//--------------------------------------------------------------------------------
@Override /* Serializer */
[02/14] incubator-juneau git commit: Add convenience property setters
to serializers and parsers.
Posted by ja...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/xml/XmlParser.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/xml/XmlParser.java b/juneau-core/src/main/java/org/apache/juneau/xml/XmlParser.java
index 0e04e3f..f352c47 100644
--- a/juneau-core/src/main/java/org/apache/juneau/xml/XmlParser.java
+++ b/juneau-core/src/main/java/org/apache/juneau/xml/XmlParser.java
@@ -15,14 +15,15 @@ package org.apache.juneau.xml;
import static javax.xml.stream.XMLStreamConstants.*;
import static org.apache.juneau.internal.StringUtils.*;
import static org.apache.juneau.xml.annotation.XmlFormat.*;
+import static org.apache.juneau.xml.XmlParserContext.*;
import java.lang.reflect.*;
import java.util.*;
import javax.xml.stream.*;
+import javax.xml.stream.util.*;
import org.apache.juneau.*;
-import org.apache.juneau.MediaType;
import org.apache.juneau.annotation.*;
import org.apache.juneau.parser.*;
import org.apache.juneau.transform.*;
@@ -499,7 +500,7 @@ public class XmlParser extends ReaderParser {
//--------------------------------------------------------------------------------
- // Overridden methods
+ // Entry point methods
//--------------------------------------------------------------------------------
@Override /* Parser */
@@ -533,49 +534,566 @@ public class XmlParser extends ReaderParser {
return doParseArgs(s, s.getXmlStreamReader(), argTypes);
}
+
+ //--------------------------------------------------------------------------------
+ // Properties
+ //--------------------------------------------------------------------------------
+
+ /**
+ * <b>Configuration property:</b> Enable validation.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"XmlParser.validating"</js>
+ * <li><b>Data type:</b> <code>Boolean</code>
+ * <li><b>Default:</b> <jk>false</jk>
+ * <li><b>Session-overridable:</b> <jk>true</jk>
+ * </ul>
+ * <p>
+ * If <jk>true</jk>, XML document will be validated.
+ * See {@link XMLInputFactory#IS_VALIDATING} for more info.
+ * <p>
+ * If <jk>true</jk>, string values will be trimmed of whitespace using {@link String#trim()} before being added to the POJO.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>XML_validating</jsf>, value)</code>.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see XmlParserContext#XML_validating
+ */
+ public XmlParser setValidating(boolean value) throws LockedException {
+ return setProperty(XML_validating, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> XML reporter.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"XmlParser.reporter"</js>
+ * <li><b>Data type:</b> {@link XMLReporter}
+ * <li><b>Default:</b> <jk>null</jk>
+ * <li><b>Session-overridable:</b> <jk>true</jk>
+ * </ul>
+ * <p>
+ * Associates an {@link XMLReporter} with this parser.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>Reporters are not copied to new parsers during a clone.
+ * </ul>
+ * <p>
+ * If <jk>true</jk>, string values will be trimmed of whitespace using {@link String#trim()} before being added to the POJO.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>XML_reporter</jsf>, value)</code>.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see XmlParserContext#XML_reporter
+ */
+ public XmlParser setReporter(XMLReporter value) throws LockedException {
+ return setProperty(XML_reporter, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> XML resolver.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"XmlParser.resolver"</js>
+ * <li><b>Data type:</b> {@link XMLResolver}
+ * <li><b>Default:</b> <jk>null</jk>
+ * <li><b>Session-overridable:</b> <jk>true</jk>
+ * </ul>
+ * <p>
+ * Associates an {@link XMLResolver} with this parser.
+ * <p>
+ * If <jk>true</jk>, string values will be trimmed of whitespace using {@link String#trim()} before being added to the POJO.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>XML_resolver</jsf>, value)</code>.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see XmlParserContext#XML_resolver
+ */
+ public XmlParser setResolver(XMLResolver value) throws LockedException {
+ return setProperty(XML_resolver, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> XML event allocator.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"XmlParser.eventAllocator"</js>
+ * <li><b>Data type:</b> {@link XMLEventAllocator}
+ * <li><b>Default:</b> <jk>null</jk>
+ * <li><b>Session-overridable:</b> <jk>true</jk>
+ * </ul>
+ * <p>
+ * Associates an {@link XMLEventAllocator} with this parser.
+ * <p>
+ * If <jk>true</jk>, string values will be trimmed of whitespace using {@link String#trim()} before being added to the POJO.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>XML_eventAllocator</jsf>, value)</code>.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see XmlParserContext#XML_eventAllocator
+ */
+ public XmlParser setEventAllocator(XMLEventAllocator value) throws LockedException {
+ return setProperty(XML_eventAllocator, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> Preserve root element during generalized parsing.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"XmlParser.preserveRootElement"</js>
+ * <li><b>Data type:</b> <code>Boolean</code>
+ * <li><b>Default:</b> <jk>false</jk>
+ * <li><b>Session-overridable:</b> <jk>true</jk>
+ * </ul>
+ * <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.
+ *
+ * Example:
+ * <table class='styled'>
+ * <tr>
+ * <td>XML</td>
+ * <td>ObjectMap.toString(), preserveRootElement==false</td>
+ * <td>ObjectMap.toString(), preserveRootElement==true</td>
+ * </tr>
+ * <tr>
+ * <td><code><xt><root><a></xt>foobar<xt></a></root></xt></code></td>
+ * <td><code>{ a:<js>'foobar'</js> }</code></td>
+ * <td><code>{ root: { a:<js>'foobar'</js> }}</code></td>
+ * </tr>
+ * </table>
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>XML_preserveRootElement</jsf>, value)</code>.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see XmlParserContext#XML_preserveRootElement
+ */
+ public XmlParser setPreserveRootElement(boolean value) throws LockedException {
+ return setProperty(XML_preserveRootElement, value);
+ }
+
+ @Override /* Parser */
+ public XmlParser setTrimStrings(boolean value) throws LockedException {
+ super.setTrimStrings(value);
+ return this;
+ }
+
+ @Override /* Parser */
+ public XmlParser setStrict(boolean value) throws LockedException {
+ super.setStrict(value);
+ return this;
+ }
+
+ @Override /* Parser */
+ public XmlParser setInputStreamCharset(String value) throws LockedException {
+ super.setInputStreamCharset(value);
+ return this;
+ }
+
+ @Override /* Parser */
+ public XmlParser setFileCharset(String value) throws LockedException {
+ super.setFileCharset(value);
+ return this;
+ }
+
@Override /* CoreApi */
- public XmlParser setProperty(String property, Object value) throws LockedException {
- super.setProperty(property, value);
+ public XmlParser setBeansRequireDefaultConstructor(boolean value) throws LockedException {
+ super.setBeansRequireDefaultConstructor(value);
return this;
}
@Override /* CoreApi */
- public XmlParser setProperties(ObjectMap properties) throws LockedException {
- super.setProperties(properties);
+ public XmlParser setBeansRequireSerializable(boolean value) throws LockedException {
+ super.setBeansRequireSerializable(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlParser setBeansRequireSettersForGetters(boolean value) throws LockedException {
+ super.setBeansRequireSettersForGetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlParser setBeansRequireSomeProperties(boolean value) throws LockedException {
+ super.setBeansRequireSomeProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlParser setBeanMapPutReturnsOldValue(boolean value) throws LockedException {
+ super.setBeanMapPutReturnsOldValue(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlParser setBeanConstructorVisibility(Visibility value) throws LockedException {
+ super.setBeanConstructorVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlParser setBeanClassVisibility(Visibility value) throws LockedException {
+ super.setBeanClassVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlParser setBeanFieldVisibility(Visibility value) throws LockedException {
+ super.setBeanFieldVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlParser setMethodVisibility(Visibility value) throws LockedException {
+ super.setMethodVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlParser setUseJavaBeanIntrospector(boolean value) throws LockedException {
+ super.setUseJavaBeanIntrospector(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlParser setUseInterfaceProxies(boolean value) throws LockedException {
+ super.setUseInterfaceProxies(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlParser setIgnoreUnknownBeanProperties(boolean value) throws LockedException {
+ super.setIgnoreUnknownBeanProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlParser setIgnoreUnknownNullBeanProperties(boolean value) throws LockedException {
+ super.setIgnoreUnknownNullBeanProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlParser setIgnorePropertiesWithoutSetters(boolean value) throws LockedException {
+ super.setIgnorePropertiesWithoutSetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlParser setIgnoreInvocationExceptionsOnGetters(boolean value) throws LockedException {
+ super.setIgnoreInvocationExceptionsOnGetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlParser setIgnoreInvocationExceptionsOnSetters(boolean value) throws LockedException {
+ super.setIgnoreInvocationExceptionsOnSetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlParser setSortProperties(boolean value) throws LockedException {
+ super.setSortProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlParser setNotBeanPackages(String...values) throws LockedException {
+ super.setNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlParser setNotBeanPackages(Collection<String> values) throws LockedException {
+ super.setNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlParser addNotBeanPackages(String...values) throws LockedException {
+ super.addNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlParser addNotBeanPackages(Collection<String> values) throws LockedException {
+ super.addNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlParser removeNotBeanPackages(String...values) throws LockedException {
+ super.removeNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlParser removeNotBeanPackages(Collection<String> values) throws LockedException {
+ super.removeNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlParser setNotBeanClasses(Class<?>...values) throws LockedException {
+ super.setNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlParser setNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ super.setNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlParser addNotBeanClasses(Class<?>...values) throws LockedException {
+ super.addNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlParser addNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ super.addNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlParser removeNotBeanClasses(Class<?>...values) throws LockedException {
+ super.removeNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlParser removeNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ super.removeNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlParser setBeanFilters(Class<?>...values) throws LockedException {
+ super.setBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlParser setBeanFilters(Collection<Class<?>> values) throws LockedException {
+ super.setBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlParser addBeanFilters(Class<?>...values) throws LockedException {
+ super.addBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlParser addBeanFilters(Collection<Class<?>> values) throws LockedException {
+ super.addBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlParser removeBeanFilters(Class<?>...values) throws LockedException {
+ super.removeBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlParser removeBeanFilters(Collection<Class<?>> values) throws LockedException {
+ super.removeBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlParser setPojoSwaps(Class<?>...values) throws LockedException {
+ super.setPojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlParser setPojoSwaps(Collection<Class<?>> values) throws LockedException {
+ super.setPojoSwaps(values);
return this;
}
@Override /* CoreApi */
- public XmlParser addNotBeanClasses(Class<?>...classes) throws LockedException {
- super.addNotBeanClasses(classes);
+ public XmlParser addPojoSwaps(Class<?>...values) throws LockedException {
+ super.addPojoSwaps(values);
return this;
}
@Override /* CoreApi */
- public XmlParser addBeanFilters(Class<?>...classes) throws LockedException {
- super.addBeanFilters(classes);
+ public XmlParser addPojoSwaps(Collection<Class<?>> values) throws LockedException {
+ super.addPojoSwaps(values);
return this;
}
@Override /* CoreApi */
- public XmlParser addPojoSwaps(Class<?>...classes) throws LockedException {
- super.addPojoSwaps(classes);
+ public XmlParser removePojoSwaps(Class<?>...values) throws LockedException {
+ super.removePojoSwaps(values);
return this;
}
@Override /* CoreApi */
- public XmlParser addToDictionary(Class<?>...classes) throws LockedException {
- super.addToDictionary(classes);
+ public XmlParser removePojoSwaps(Collection<Class<?>> values) throws LockedException {
+ super.removePojoSwaps(values);
return this;
}
@Override /* CoreApi */
- public <T> XmlParser addImplClass(Class<T> interfaceClass, Class<? extends T> implClass) throws LockedException {
+ public XmlParser setImplClasses(Map<Class<?>,Class<?>> values) throws LockedException {
+ super.setImplClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public <T> CoreApi addImplClass(Class<T> interfaceClass, Class<? extends T> implClass) throws LockedException {
super.addImplClass(interfaceClass, implClass);
return this;
}
@Override /* CoreApi */
+ public XmlParser setBeanDictionary(Class<?>...values) throws LockedException {
+ super.setBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlParser setBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ super.setBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlParser addToBeanDictionary(Class<?>...values) throws LockedException {
+ super.addToBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlParser addToBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ super.addToBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlParser removeFromBeanDictionary(Class<?>...values) throws LockedException {
+ super.removeFromBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlParser removeFromBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ super.removeFromBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlParser setBeanTypePropertyName(String value) throws LockedException {
+ super.setBeanTypePropertyName(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlParser setDefaultParser(Class<?> value) throws LockedException {
+ super.setDefaultParser(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlParser setLocale(Locale value) throws LockedException {
+ super.setLocale(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlParser setTimeZone(TimeZone value) throws LockedException {
+ super.setTimeZone(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlParser setMediaType(MediaType value) throws LockedException {
+ super.setMediaType(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlParser setDebug(boolean value) throws LockedException {
+ super.setDebug(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlParser setProperty(String name, Object value) throws LockedException {
+ super.setProperty(name, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlParser setProperties(ObjectMap properties) throws LockedException {
+ super.setProperties(properties);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlParser addToProperty(String name, Object value) throws LockedException {
+ super.addToProperty(name, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlParser putToProperty(String name, Object key, Object value) throws LockedException {
+ super.putToProperty(name, key, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlParser putToProperty(String name, Object value) throws LockedException {
+ super.putToProperty(name, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlParser removeFromProperty(String name, Object value) throws LockedException {
+ super.removeFromProperty(name, value);
+ return this;
+ }
+
+
+ //--------------------------------------------------------------------------------
+ // Overridden methods
+ //--------------------------------------------------------------------------------
+
+ @Override /* CoreApi */
public XmlParser setClassLoader(ClassLoader classLoader) throws LockedException {
super.setClassLoader(classLoader);
return this;
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/xml/XmlParserContext.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/xml/XmlParserContext.java b/juneau-core/src/main/java/org/apache/juneau/xml/XmlParserContext.java
index a5b6802..25df977 100644
--- a/juneau-core/src/main/java/org/apache/juneau/xml/XmlParserContext.java
+++ b/juneau-core/src/main/java/org/apache/juneau/xml/XmlParserContext.java
@@ -24,66 +24,8 @@ import org.apache.juneau.parser.*;
* Context properties are set by calling {@link ContextFactory#setProperty(String, Object)} on the context factory
* returned {@link CoreApi#getContextFactory()}.
* <p>
- * The following convenience methods are also provided for setting context properties:
- * <ul>
- * <li>{@link XmlParser#setProperty(String,Object)}
- * <li>{@link XmlParser#setProperties(ObjectMap)}
- * <li>{@link XmlParser#addNotBeanClasses(Class[])}
- * <li>{@link XmlParser#addBeanFilters(Class[])}
- * <li>{@link XmlParser#addPojoSwaps(Class[])}
- * <li>{@link XmlParser#addToDictionary(Class[])}
- * <li>{@link XmlParser#addImplClass(Class,Class)}
- * </ul>
- * <p>
* See {@link ContextFactory} for more information about context properties.
*
- * <h6 class='topic' id='ConfigProperties'>Configurable properties on the XML parser</h6>
- * <table class='styled' style='border-collapse: collapse;'>
- * <tr><th>Setting name</th><th>Description</th><th>Data type</th><th>Default value</th><th>Session overridable</th></tr>
- * <tr>
- * <td>{@link #XML_xsiNs}</td>
- * <td>XMLSchema-instance namespace URI.</td>
- * <td><code>String</code></td>
- * <td><js>"http://www.w3.org/2001/XMLSchema-instance"</js></td>
- * <td><jk>true</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #XML_validating}</td>
- * <td>Enable validation.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>false</jk></td>
- * <td><jk>true</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #XML_reporter}</td>
- * <td>XML reporter.</td>
- * <td>{@link XMLReporter}</td>
- * <td><jk>null</jk></td>
- * <td><jk>true</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #XML_resolver}</td>
- * <td>XML resolver.</td>
- * <td>{@link XMLResolver}</td>
- * <td><jk>null</jk></td>
- * <td><jk>true</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #XML_eventAllocator}</td>
- * <td>XML event allocator.</td>
- * <td>{@link XMLEventAllocator}</td>
- * <td><jk>null</jk></td>
- * <td><jk>true</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #XML_preserveRootElement}</td>
- * <td>Preserve root element during generalized parsing.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>false</jk></td>
- * <td><jk>true</jk></td>
- * </tr>
- * </table>
- *
* <h5 class='section'>Inherited configurable properties:</h5>
* <ul class='javahierarchy'>
* <li class='c'><a class="doclink" href="../BeanContext.html#ConfigProperties">BeanContext</a> - Properties associated with handling beans on serializers and parsers.
@@ -95,20 +37,6 @@ import org.apache.juneau.parser.*;
public class XmlParserContext extends ParserContext {
/**
- * <b>Configuration property:</b> XMLSchema-instance namespace URI.
- * <p>
- * <ul>
- * <li><b>Name:</b> <js>"XmlParser.xsiNs"</js>
- * <li><b>Data type:</b> <code>String</code>
- * <li><b>Default:</b> <js>"http://www.w3.org/2001/XMLSchema-instance"</js>
- * <li><b>Session-overridable:</b> <jk>true</jk>
- * </ul>
- * <p>
- * The XMLSchema namespace.
- */
- public static final String XML_xsiNs = "XmlParser.xsiNs";
-
- /**
* <b>Configuration property:</b> Enable validation.
* <p>
* <ul>
@@ -199,7 +127,6 @@ public class XmlParserContext extends ParserContext {
*/
public static final String XML_preserveRootElement = "XmlParser.preserveRootElement";
- final String xsiNs;
final boolean
validating,
preserveRootElement;
@@ -216,7 +143,6 @@ public class XmlParserContext extends ParserContext {
*/
public XmlParserContext(ContextFactory cf) {
super(cf);
- xsiNs = cf.getProperty(XML_xsiNs, String.class, "http://www.w3.org/2001/XMLSchema-instance");
validating = cf.getProperty(XML_validating, boolean.class, false);
preserveRootElement = cf.getProperty(XML_preserveRootElement, boolean.class, false);
reporter = cf.getProperty(XML_reporter, XMLReporter.class, null);
@@ -228,7 +154,6 @@ public class XmlParserContext extends ParserContext {
public ObjectMap asMap() {
return super.asMap()
.append("XmlParserContext", new ObjectMap()
- .append("xsiNs", xsiNs)
.append("validating", validating)
.append("preserveRootElement", preserveRootElement)
.append("reporter", reporter)
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/xml/XmlParserSession.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/xml/XmlParserSession.java b/juneau-core/src/main/java/org/apache/juneau/xml/XmlParserSession.java
index e6a7e13..ebf5d5d 100644
--- a/juneau-core/src/main/java/org/apache/juneau/xml/XmlParserSession.java
+++ b/juneau-core/src/main/java/org/apache/juneau/xml/XmlParserSession.java
@@ -34,7 +34,6 @@ import org.apache.juneau.xml.annotation.*;
*/
public class XmlParserSession extends ParserSession {
- private final String xsiNs;
private final boolean
validating,
preserveRootElement;
@@ -70,14 +69,12 @@ public class XmlParserSession extends ParserSession {
public XmlParserSession(XmlParserContext ctx, ObjectMap op, Object input, Method javaMethod, Object outer, Locale locale, TimeZone timeZone, MediaType mediaType) {
super(ctx, op, input, javaMethod, outer, locale, timeZone, mediaType);
if (op == null || op.isEmpty()) {
- xsiNs = ctx.xsiNs;
validating = ctx.validating;
reporter = ctx.reporter;
resolver = ctx.resolver;
eventAllocator = ctx.eventAllocator;
preserveRootElement = ctx.preserveRootElement;
} else {
- xsiNs = op.getString(XML_xsiNs, ctx.xsiNs);
validating = op.getBoolean(XML_validating, ctx.validating);
reporter = (XMLReporter)op.get(XML_reporter, ctx.reporter);
resolver = (XMLResolver)op.get(XML_resolver, ctx.resolver);
@@ -87,15 +84,6 @@ public class XmlParserSession extends ParserSession {
}
/**
- * Returns the {@link XmlParserContext#XML_xsiNs} setting value for this session.
- *
- * @return The {@link XmlParserContext#XML_xsiNs} setting value for this session.
- */
- public final String getXsiNs() {
- return xsiNs;
- }
-
- /**
* Returns the {@link XmlParserContext#XML_preserveRootElement} setting value for this session.
*
* @return The {@link XmlParserContext#XML_preserveRootElement} setting value for this session.
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/xml/XmlSerializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/xml/XmlSerializer.java b/juneau-core/src/main/java/org/apache/juneau/xml/XmlSerializer.java
index 3a86e00..7c38f84 100644
--- a/juneau-core/src/main/java/org/apache/juneau/xml/XmlSerializer.java
+++ b/juneau-core/src/main/java/org/apache/juneau/xml/XmlSerializer.java
@@ -12,7 +12,6 @@
// ***************************************************************************************************************************
package org.apache.juneau.xml;
-import static org.apache.juneau.serializer.SerializerContext.*;
import static org.apache.juneau.xml.XmlSerializerContext.*;
import static org.apache.juneau.xml.annotation.XmlFormat.*;
import static org.apache.juneau.xml.XmlSerializer.ContentResult.*;
@@ -147,7 +146,7 @@ public class XmlSerializer extends WriterSerializer {
public static class Sq extends XmlSerializer {
/** Constructor */
public Sq() {
- setProperty(SERIALIZER_quoteChar, '\'');
+ setQuoteChar('\'');
}
}
@@ -155,7 +154,7 @@ public class XmlSerializer extends WriterSerializer {
public static class SqReadable extends Sq {
/** Constructor */
public SqReadable() {
- setProperty(SERIALIZER_useIndentation, true);
+ setUseIndentation(true);
}
}
@@ -164,7 +163,7 @@ public class XmlSerializer extends WriterSerializer {
public static class Ns extends XmlSerializer {
/** Constructor */
public Ns() {
- setProperty(XML_enableNamespaces, true);
+ setEnableNamespaces(true);
}
}
@@ -172,7 +171,7 @@ public class XmlSerializer extends WriterSerializer {
public static class NsSq extends Ns {
/** Constructor */
public NsSq() {
- setProperty(SERIALIZER_quoteChar, '\'');
+ setQuoteChar('\'');
}
}
@@ -180,7 +179,7 @@ public class XmlSerializer extends WriterSerializer {
public static class NsSqReadable extends NsSq {
/** Constructor */
public NsSqReadable() {
- setProperty(SERIALIZER_useIndentation, true);
+ setUseIndentation(true);
}
}
@@ -745,7 +744,7 @@ public class XmlSerializer extends WriterSerializer {
//--------------------------------------------------------------------------------
- // Overridden methods
+ // Entry point methods
//--------------------------------------------------------------------------------
@Override /* Serializer */
@@ -761,49 +760,656 @@ public class XmlSerializer extends WriterSerializer {
return new XmlSerializerSession(getContext(XmlSerializerContext.class), op, output, javaMethod, locale, timeZone, mediaType);
}
+
+ //--------------------------------------------------------------------------------
+ // Properties
+ //--------------------------------------------------------------------------------
+
+ /**
+ * <b>Configuration property:</b> Enable support for XML namespaces.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"XmlSerializer.enableNamespaces"</js>
+ * <li><b>Data type:</b> <code>Boolean</code>
+ * <li><b>Default:</b> <jk>false</jk>
+ * <li><b>Session-overridable:</b> <jk>true</jk>
+ * </ul>
+ * <p>
+ * If not enabled, XML output will not contain any namespaces regardless of any other settings.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>XML_enableNamespaces</jsf>, value)</code>.
+ * <li>This introduces a slight performance penalty.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see XmlSerializerContext#XML_enableNamespaces
+ */
+ public XmlSerializer setEnableNamespaces(boolean value) throws LockedException {
+ return setProperty(XML_enableNamespaces, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> Auto-detect namespace usage.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"XmlSerializer.autoDetectNamespaces"</js>
+ * <li><b>Data type:</b> <code>Boolean</code>
+ * <li><b>Default:</b> <jk>true</jk>
+ * <li><b>Session-overridable:</b> <jk>true</jk>
+ * </ul>
+ * <p>
+ * Detect namespace usage before serialization.
+ * <p>
+ * Used in conjunction with {@link XmlSerializerContext#XML_addNamespaceUrisToRoot} to reduce
+ * the list of namespace URLs appended to the root element to only those
+ * that will be used in the resulting document.
+ * <p>
+ * If enabled, then the data structure will first be crawled looking for
+ * namespaces that will be encountered before the root element is
+ * serialized.
+ * <p>
+ * This setting is ignored if {@link XmlSerializerContext#XML_enableNamespaces} is not enabled.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>Auto-detection of namespaces can be costly performance-wise.
+ * In high-performance environments, it's recommended that namespace detection be
+ * disabled, and that namespaces be manually defined through the {@link XmlSerializerContext#XML_namespaces} property.
+ * </ul>
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>XML_autoDetectNamespaces</jsf>, value)</code>.
+ * <li>This introduces a slight performance penalty.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see XmlSerializerContext#XML_autoDetectNamespaces
+ */
+ public XmlSerializer setAutoDetectNamespaces(boolean value) throws LockedException {
+ return setProperty(XML_autoDetectNamespaces, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> Add namespace URLs to the root element.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"XmlSerializer.addNamespaceUrisToRoot"</js>
+ * <li><b>Data type:</b> <code>Boolean</code>
+ * <li><b>Default:</b> <jk>false</jk>
+ * <li><b>Session-overridable:</b> <jk>true</jk>
+ * </ul>
+ * <p>
+ * Use this setting to add {@code xmlns:x} attributes to the root
+ * element for the default and all mapped namespaces.
+ * <p>
+ * This setting is ignored if {@link XmlSerializerContext#XML_enableNamespaces} is not enabled.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>XML_addNamespaceUrisToRoot</jsf>, value)</code>.
+ * <li>This introduces a slight performance penalty.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see XmlSerializerContext#XML_addNamespaceUrisToRoot
+ */
+ public XmlSerializer setAddNamespaceUrisToRoot(boolean value) throws LockedException {
+ return setProperty(XML_addNamespaceUrisToRoot, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> Default namespace.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"XmlSerializer.defaultNamespace"</js>
+ * <li><b>Data type:</b> <code>String</code>
+ * <li><b>Default:</b> <js>"{juneau:'http://www.apache.org/2013/Juneau'}"</js>
+ * <li><b>Session-overridable:</b> <jk>true</jk>
+ * </ul>
+ * <p>
+ * Specifies the default namespace URI for this document.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>XML_defaultNamespace</jsf>, value)</code>.
+ * <li>This introduces a slight performance penalty.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see XmlSerializerContext#XML_defaultNamespace
+ */
+ public XmlSerializer setDefaultNamespace(String value) throws LockedException {
+ return setProperty(XML_defaultNamespace, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> XMLSchema namespace.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"XmlSerializer.xsNamespace"</js>
+ * <li><b>Data type:</b> {@link Namespace}
+ * <li><b>Default:</b> <code>{name:<js>'xs'</js>,uri:<js>'http://www.w3.org/2001/XMLSchema'</js>}</code>
+ * <li><b>Session-overridable:</b> <jk>true</jk>
+ * </ul>
+ * <p>
+ * Specifies the namespace for the <code>XMLSchema</code> namespace, used by the schema generated
+ * by the {@link XmlSchemaSerializer} class.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>XML_xsNamespace</jsf>, value)</code>.
+ * <li>This introduces a slight performance penalty.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see XmlSerializerContext#XML_xsNamespace
+ */
+ public XmlSerializer setXsNamespace(Namespace value) throws LockedException {
+ return setProperty(XML_xsNamespace, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> Default namespaces.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"XmlSerializer.namespaces"</js>
+ * <li><b>Data type:</b> <code>Set<{@link Namespace}></code>
+ * <li><b>Default:</b> empty set
+ * <li><b>Session-overridable:</b> <jk>true</jk>
+ * </ul>
+ * <p>
+ * The default list of namespaces associated with this serializer.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>XML_namespaces</jsf>, values)</code>.
+ * <li>This introduces a slight performance penalty.
+ * </ul>
+ *
+ * @param values The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see XmlSerializerContext#XML_namespaces
+ */
+ public XmlSerializer setNamespaces(Namespace...values) throws LockedException {
+ return setProperty(XML_namespaces, values);
+ }
+
+ @Override /* Serializer */
+ public XmlSerializer setMaxDepth(int value) throws LockedException {
+ super.setMaxDepth(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public XmlSerializer setInitialDepth(int value) throws LockedException {
+ super.setInitialDepth(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public XmlSerializer setDetectRecursions(boolean value) throws LockedException {
+ super.setDetectRecursions(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public XmlSerializer setIgnoreRecursions(boolean value) throws LockedException {
+ super.setIgnoreRecursions(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public XmlSerializer setUseIndentation(boolean value) throws LockedException {
+ super.setUseIndentation(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public XmlSerializer setAddBeanTypeProperties(boolean value) throws LockedException {
+ super.setAddBeanTypeProperties(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public XmlSerializer setQuoteChar(char value) throws LockedException {
+ super.setQuoteChar(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public XmlSerializer setTrimNullProperties(boolean value) throws LockedException {
+ super.setTrimNullProperties(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public XmlSerializer setTrimEmptyCollections(boolean value) throws LockedException {
+ super.setTrimEmptyCollections(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public XmlSerializer setTrimEmptyMaps(boolean value) throws LockedException {
+ super.setTrimEmptyMaps(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public XmlSerializer setTrimStrings(boolean value) throws LockedException {
+ super.setTrimStrings(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public XmlSerializer setRelativeUriBase(String value) throws LockedException {
+ super.setRelativeUriBase(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public XmlSerializer setAbsolutePathUriBase(String value) throws LockedException {
+ super.setAbsolutePathUriBase(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public XmlSerializer setSortCollections(boolean value) throws LockedException {
+ super.setSortCollections(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public XmlSerializer setSortMaps(boolean value) throws LockedException {
+ super.setSortMaps(value);
+ return this;
+ }
+
@Override /* CoreApi */
- public XmlSerializer setProperty(String property, Object value) throws LockedException {
- super.setProperty(property, value);
+ public XmlSerializer setBeansRequireDefaultConstructor(boolean value) throws LockedException {
+ super.setBeansRequireDefaultConstructor(value);
return this;
}
@Override /* CoreApi */
- public XmlSerializer setProperties(ObjectMap properties) throws LockedException {
- super.setProperties(properties);
+ public XmlSerializer setBeansRequireSerializable(boolean value) throws LockedException {
+ super.setBeansRequireSerializable(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlSerializer setBeansRequireSettersForGetters(boolean value) throws LockedException {
+ super.setBeansRequireSettersForGetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlSerializer setBeansRequireSomeProperties(boolean value) throws LockedException {
+ super.setBeansRequireSomeProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlSerializer setBeanMapPutReturnsOldValue(boolean value) throws LockedException {
+ super.setBeanMapPutReturnsOldValue(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlSerializer setBeanConstructorVisibility(Visibility value) throws LockedException {
+ super.setBeanConstructorVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlSerializer setBeanClassVisibility(Visibility value) throws LockedException {
+ super.setBeanClassVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlSerializer setBeanFieldVisibility(Visibility value) throws LockedException {
+ super.setBeanFieldVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlSerializer setMethodVisibility(Visibility value) throws LockedException {
+ super.setMethodVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlSerializer setUseJavaBeanIntrospector(boolean value) throws LockedException {
+ super.setUseJavaBeanIntrospector(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlSerializer setUseInterfaceProxies(boolean value) throws LockedException {
+ super.setUseInterfaceProxies(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlSerializer setIgnoreUnknownBeanProperties(boolean value) throws LockedException {
+ super.setIgnoreUnknownBeanProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlSerializer setIgnoreUnknownNullBeanProperties(boolean value) throws LockedException {
+ super.setIgnoreUnknownNullBeanProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlSerializer setIgnorePropertiesWithoutSetters(boolean value) throws LockedException {
+ super.setIgnorePropertiesWithoutSetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlSerializer setIgnoreInvocationExceptionsOnGetters(boolean value) throws LockedException {
+ super.setIgnoreInvocationExceptionsOnGetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlSerializer setIgnoreInvocationExceptionsOnSetters(boolean value) throws LockedException {
+ super.setIgnoreInvocationExceptionsOnSetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlSerializer setSortProperties(boolean value) throws LockedException {
+ super.setSortProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlSerializer setNotBeanPackages(String...values) throws LockedException {
+ super.setNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlSerializer setNotBeanPackages(Collection<String> values) throws LockedException {
+ super.setNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlSerializer addNotBeanPackages(String...values) throws LockedException {
+ super.addNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlSerializer addNotBeanPackages(Collection<String> values) throws LockedException {
+ super.addNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlSerializer removeNotBeanPackages(String...values) throws LockedException {
+ super.removeNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlSerializer removeNotBeanPackages(Collection<String> values) throws LockedException {
+ super.removeNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlSerializer setNotBeanClasses(Class<?>...values) throws LockedException {
+ super.setNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlSerializer setNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ super.setNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlSerializer addNotBeanClasses(Class<?>...values) throws LockedException {
+ super.addNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlSerializer addNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ super.addNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlSerializer removeNotBeanClasses(Class<?>...values) throws LockedException {
+ super.removeNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlSerializer removeNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ super.removeNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlSerializer setBeanFilters(Class<?>...values) throws LockedException {
+ super.setBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlSerializer setBeanFilters(Collection<Class<?>> values) throws LockedException {
+ super.setBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlSerializer addBeanFilters(Class<?>...values) throws LockedException {
+ super.addBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlSerializer addBeanFilters(Collection<Class<?>> values) throws LockedException {
+ super.addBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlSerializer removeBeanFilters(Class<?>...values) throws LockedException {
+ super.removeBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlSerializer removeBeanFilters(Collection<Class<?>> values) throws LockedException {
+ super.removeBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlSerializer setPojoSwaps(Class<?>...values) throws LockedException {
+ super.setPojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlSerializer setPojoSwaps(Collection<Class<?>> values) throws LockedException {
+ super.setPojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlSerializer addPojoSwaps(Class<?>...values) throws LockedException {
+ super.addPojoSwaps(values);
return this;
}
@Override /* CoreApi */
- public XmlSerializer addNotBeanClasses(Class<?>...classes) throws LockedException {
- super.addNotBeanClasses(classes);
+ public XmlSerializer addPojoSwaps(Collection<Class<?>> values) throws LockedException {
+ super.addPojoSwaps(values);
return this;
}
@Override /* CoreApi */
- public XmlSerializer addBeanFilters(Class<?>...classes) throws LockedException {
- super.addBeanFilters(classes);
+ public XmlSerializer removePojoSwaps(Class<?>...values) throws LockedException {
+ super.removePojoSwaps(values);
return this;
}
@Override /* CoreApi */
- public XmlSerializer addPojoSwaps(Class<?>...classes) throws LockedException {
- super.addPojoSwaps(classes);
+ public XmlSerializer removePojoSwaps(Collection<Class<?>> values) throws LockedException {
+ super.removePojoSwaps(values);
return this;
}
@Override /* CoreApi */
- public XmlSerializer addToDictionary(Class<?>...classes) throws LockedException {
- super.addToDictionary(classes);
+ public XmlSerializer setImplClasses(Map<Class<?>,Class<?>> values) throws LockedException {
+ super.setImplClasses(values);
return this;
}
@Override /* CoreApi */
- public <T> XmlSerializer addImplClass(Class<T> interfaceClass, Class<? extends T> implClass) throws LockedException {
+ public <T> CoreApi addImplClass(Class<T> interfaceClass, Class<? extends T> implClass) throws LockedException {
super.addImplClass(interfaceClass, implClass);
return this;
}
@Override /* CoreApi */
+ public XmlSerializer setBeanDictionary(Class<?>...values) throws LockedException {
+ super.setBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlSerializer setBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ super.setBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlSerializer addToBeanDictionary(Class<?>...values) throws LockedException {
+ super.addToBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlSerializer addToBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ super.addToBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlSerializer removeFromBeanDictionary(Class<?>...values) throws LockedException {
+ super.removeFromBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlSerializer removeFromBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ super.removeFromBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlSerializer setBeanTypePropertyName(String value) throws LockedException {
+ super.setBeanTypePropertyName(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlSerializer setDefaultParser(Class<?> value) throws LockedException {
+ super.setDefaultParser(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlSerializer setLocale(Locale value) throws LockedException {
+ super.setLocale(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlSerializer setTimeZone(TimeZone value) throws LockedException {
+ super.setTimeZone(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlSerializer setMediaType(MediaType value) throws LockedException {
+ super.setMediaType(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlSerializer setDebug(boolean value) throws LockedException {
+ super.setDebug(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlSerializer setProperty(String name, Object value) throws LockedException {
+ super.setProperty(name, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlSerializer setProperties(ObjectMap properties) throws LockedException {
+ super.setProperties(properties);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlSerializer addToProperty(String name, Object value) throws LockedException {
+ super.addToProperty(name, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlSerializer putToProperty(String name, Object key, Object value) throws LockedException {
+ super.putToProperty(name, key, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlSerializer putToProperty(String name, Object value) throws LockedException {
+ super.putToProperty(name, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public XmlSerializer removeFromProperty(String name, Object value) throws LockedException {
+ super.removeFromProperty(name, value);
+ return this;
+ }
+
+
+ //--------------------------------------------------------------------------------
+ // Overridden methods
+ //--------------------------------------------------------------------------------
+
+ @Override /* CoreApi */
public XmlSerializer setClassLoader(ClassLoader classLoader) throws LockedException {
super.setClassLoader(classLoader);
return this;
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/xml/XmlSerializerContext.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/xml/XmlSerializerContext.java b/juneau-core/src/main/java/org/apache/juneau/xml/XmlSerializerContext.java
index 215a5e1..181eaa4 100644
--- a/juneau-core/src/main/java/org/apache/juneau/xml/XmlSerializerContext.java
+++ b/juneau-core/src/main/java/org/apache/juneau/xml/XmlSerializerContext.java
@@ -21,66 +21,8 @@ import org.apache.juneau.serializer.*;
* Context properties are set by calling {@link ContextFactory#setProperty(String, Object)} on the context factory
* returned {@link CoreApi#getContextFactory()}.
* <p>
- * The following convenience methods are also provided for setting context properties:
- * <ul>
- * <li>{@link XmlSerializer#setProperty(String,Object)}
- * <li>{@link XmlSerializer#setProperties(ObjectMap)}
- * <li>{@link XmlSerializer#addNotBeanClasses(Class[])}
- * <li>{@link XmlSerializer#addBeanFilters(Class[])}
- * <li>{@link XmlSerializer#addPojoSwaps(Class[])}
- * <li>{@link XmlSerializer#addToDictionary(Class[])}
- * <li>{@link XmlSerializer#addImplClass(Class,Class)}
- * </ul>
- * <p>
* See {@link ContextFactory} for more information about context properties.
*
- * <h6 class='topic' id='ConfigProperties'>Configurable properties on the XML serializer</h6>
- * <table class='styled' style='border-collapse: collapse;'>
- * <tr><th>Setting name</th><th>Description</th><th>Data type</th><th>Default value</th><th>Session overridable</th></tr>
- * <tr>
- * <td>{@link #XML_enableNamespaces}</td>
- * <td>Enable support for XML namespaces.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>false</jk></td>
- * <td><jk>true</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #XML_autoDetectNamespaces}</td>
- * <td>Auto-detect namespace usage.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>true</jk></td>
- * <td><jk>true</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #XML_addNamespaceUrisToRoot}</td>
- * <td>Add namespace URLs to the root element.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>false</jk></td>
- * <td><jk>true</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #XML_defaultNamespace}</td>
- * <td>Default namespace URI.</td>
- * <td><code>String</code></td>
- * <td><jk>null</jk></td>
- * <td><jk>true</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #XML_xsNamespace}</td>
- * <td>XMLSchema namespace.</td>
- * <td>{@link Namespace}</td>
- * <td><code>{name:<js>'xs'</js>,uri:<js>'http://www.w3.org/2001/XMLSchema'</js>}</code></td>
- * <td><jk>true</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #XML_namespaces}</td>
- * <td>Default namespaces.</td>
- * <td><code>Set<{@link Namespace}></code></td>
- * <td>empty set</td>
- * <td><jk>true</jk></td>
- * </tr>
- * </table>
- *
* <h5 class='section'>Inherited configurable properties:</h5>
* <ul class='javahierarchy'>
* <li class='c'><a class="doclink" href="../BeanContext.html#ConfigProperties">BeanContext</a> - Properties associated with handling beans on serializers and parsers.
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/xml/XmlUtils.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/xml/XmlUtils.java b/juneau-core/src/main/java/org/apache/juneau/xml/XmlUtils.java
index 76e8a0a..fe92575 100644
--- a/juneau-core/src/main/java/org/apache/juneau/xml/XmlUtils.java
+++ b/juneau-core/src/main/java/org/apache/juneau/xml/XmlUtils.java
@@ -205,6 +205,7 @@ public final class XmlUtils {
return l;
}
+
//--------------------------------------------------------------------------------
// Encode XML attributes
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/xml/package.html
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/xml/package.html b/juneau-core/src/main/java/org/apache/juneau/xml/package.html
index 9c23da6..2e60821 100644
--- a/juneau-core/src/main/java/org/apache/juneau/xml/package.html
+++ b/juneau-core/src/main/java/org/apache/juneau/xml/package.html
@@ -238,9 +238,9 @@
<p class='bcode'>
<jc>// Create a new serializer with readable output, no namespaces yet.</jc>
XmlSerializer s = <jk>new</jk> XmlSerializer()
- .setProperty(SerializerContext.<jsf>SERIALIZER_useIndentation</jsf>, <jk>true</jk>)
- .setProperty(SerializerContext.<jsf>SERIALIZER_quoteChar</jsf>, <js>'\''</js>)
- .setProperty(XmlSerializerContext.<jsf>XML_enableNamespaces</jsf>, <jk>false</jk>);
+ .setUseIndentation(<jk>true</jk>)
+ .setQuoteChar(<js>'\''</js>)
+ .setEnableNamespaces(<jk>false</jk>);
<jc>// Create our bean.</jc>
Person p = <jk>new</jk> Person(1, <js>"John Smith"</js>);
@@ -254,7 +254,7 @@
<p class='bcode'>
<jc>// Create a new serializer with readable output, no namespaces yet, but use cloning method.</jc>
XmlSerializer s = XmlSerializer.<jsf>DEFAULT_SQ_READABLE</jsf>.clone()
- .setProperty(XmlSerializerContext.<jsf>XML_enableNamespaces</jsf>, <jk>false</jk>);
+ .setEnableNamespaces(<jk>false</jk>);
</p>
<p>
The code above produces the following output:
@@ -1984,9 +1984,9 @@
<jc>// Create a new serializer with readable output, this time with namespaces enabled.</jc>
<jc>// Note that this is identical to XmlSerializer.DEFAULT_NS_SQ_READABLE.</jc>
XmlSerializer s = <jk>new</jk> XmlSerializer()
- .setProperty(XmlSerializerContext.<jsf>XML_enableNamespaces</jsf>, <jk>true</jk>)
- .setProperty(SerializerContext.<jsf>SERIALIZER_useIndentation</jsf>, <jk>true</jk>)
- .setProperty(SerializerContext.<jsf>SERIALIZER_quoteChar</jsf>, <js>'\''</js>);
+ .setEnableNamespaces(<jk>true</jk>)
+ .setUseIndentation(<jk>true</jk>)
+ .setQuoteChar(<js>'\''</js>);
<jc>// Create our bean.</jc>
Person p = <jk>new</jk> Person(1, <js>"John Smith"</js>);
@@ -2073,10 +2073,10 @@
<p class='bcode'>
<jc>// Create a new serializer with readable output, this time with namespaces enabled.</jc>
XmlSerializer s = <jk>new</jk> XmlSerializer()
- .setProperty(SerializerContext.<jsf>SERIALIZER_useIndentation</jsf>, <jk>true</jk>)
- .setProperty(SerializerContext.<jsf>SERIALIZER_quoteChar</jsf>, <js>'\''</js>)
- .setProperty(XmlSerializerContext.<jsf>XML_enableNamespaces</jsf>, <jk>true</jk>)
- .setProperty(XmlSerializerContext.<jsf>XML_defaultNamespaceUri</jsf>, <js>"http://www.apache.org/person/"</js>);
+ .setUseIndentation(<jk>true</jk>)
+ .setQuoteChar(<js>'\''</js>)
+ .setEnableNamespaces(<jk>true</jk>)
+ .setDefaultNamespaceUri(<js>"http://www.apache.org/person/"</js>);
</p>
<p>
This produces the following equivalent where the elements don't need prefixes since they're already in the default document namespace:
@@ -2107,10 +2107,10 @@
<p class='bcode'>
<jc>// Create a new serializer with readable output, this time with namespaces enabled.</jc>
XmlSerializer s = <jk>new</jk> XmlSerializer()
- .setProperty(SerializerContext.<jsf>SERIALIZER_useIndentation</jsf>, <jk>true</jk>)
- .setProperty(SerializerContext.<jsf>SERIALIZER_quoteChar</jsf>, <js>'\''</js>)
- .setProperty(XmlSerializerContext.<jsf>XML_autoDetectNamespaces</jsf>, <jk>false</jk>)
- .setProperty(XmlSerializerContext.<jsf>XML_namespaces</jsf>, <js>"{per:'http://www.apache.org/person/'}"</js>);
+ .setUseIndentation(<jk>true</jk>)
+ .setQuoteChar(<js>'\''</js>)
+ .setAutoDetectNamespaces(<jk>false</jk>)
+ .setNamespaces(<js>"{per:'http://www.apache.org/person/'}"</js>);
</p>
</div>
@@ -2241,8 +2241,8 @@
<p class='bcode'>
<jc>// Create a new serializer with readable output.</jc>
XmlSerializer s = <jk>new</jk> XmlSerializer()
- .setProperty(SerializerContext.<jsf>SERIALIZER_useIndentation</jsf>, <jk>true</jk>)
- .setProperty(SerializerContext.<jsf>SERIALIZER_quoteChar</jsf>, <js>'\''</js>);
+ .setUseIndentation(<jk>true</jk>)
+ .setQuoteChar(<js>'\''</js>);
<jc>// Create our bean.</jc>
Person p = <jk>new</jk> Person(1, <js>"John Smith"</js>, <js>"http://sample/addressBook/person/1"</js>, <js>"http://sample/addressBook"</js>, <js>"Aug 12, 1946"</js>);
@@ -2354,10 +2354,10 @@
<p class='bcode'>
<jc>// Create a new serializer with readable output.</jc>
XmlSerializer s = <jk>new</jk> XmlSerializer()
- .setProperty(SerializerContext.<jsf>SERIALIZER_useIndentation</jsf>, <jk>true</jk>)
- .setProperty(XmlSerializerContext.<jsf>XML_enableNamespaces</jsf>, <jk>true</jk>)
- .setProperty(XmlSerializerContext.<jsf>XML_addNamespaceUrisToRoot</jsf>, <jk>true</jk>)
- .setProperty(SerializerContext.<jsf>SERIALIZER_quoteChar</jsf>, <js>'\''</js>);
+ .setUseIndentation(<jk>true</jk>)
+ .setEnableNamespaces(<jk>true</jk>)
+ .setAddNamespaceUrisToRoot(<jk>true</jk>)
+ .setQuoteChar(<js>'\''</js>);
<jc>// Create the equivalent schema serializer.</jc>
XmlSchemaSerializer ss = s.getSchemaSerializer();
@@ -2656,10 +2656,10 @@
<p class='bcode'>
<jc>// Create a new serializer with readable output.</jc>
XmlSerializer s = <jk>new</jk> XmlSerializer()
- .setProperty(SerializerContext.<jsf>SERIALIZER_useIndentation</jsf>, <jk>true</jk>)
- .setProperty(SerializerContext.<jsf>SERIALIZER_quoteChar</jsf>, <js>'\''</js>)
- .setProperty(XmlSerializerContext.<jsf>XML_enableNamespaces</jsf>, <jk>false</jk>)
- .setProperty(SerializerContext.<jsf>SERIALIZER_detectRecursions</jsf>, <jk>true</jk>);
+ .setUseIndentation(<jk>true</jk>)
+ .setQuoteChar(<js>'\''</js>)
+ .setEnableNamespaces(<jk>false</jk>)
+ .setDetectRecursions(<jk>true</jk>);
<jc>// Create a recursive loop.</jc>
A a = <jk>new</jk> A();
@@ -2736,9 +2736,9 @@
<p class='bcode'>
<jc>// Create a new serializer with readable output.</jc>
XmlSerializer s = <jk>new</jk> XmlSerializer()
- .setProperty(XmlSerializerContext.<jsf>XML_enableNamespaces</jsf>, <jk>true</jk>)
- .setProperty(SerializerContext.<jsf>SERIALIZER_useIndentation</jsf>, <jk>true</jk>)
- .setProperty(SerializerContext.<jsf>SERIALIZER_quoteChar</jsf>, <js>'\''</js>);
+ .setEnableNamespaces(<jk>true</jk>)
+ .setUseIndentation(<jk>true</jk>)
+ .setQuoteChar(<js>'\''</js>);
<jc>// Create our bean.</jc>
Person p = <jk>new</jk> Person(1, <js>"John Smith"</js>, <js>"http://sample/addressBook/person/1"</js>, <js>"http://sample/addressBook"</js>, <js>"Aug 12, 1946"</js>);
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/javadoc/overview.html
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/javadoc/overview.html b/juneau-core/src/main/javadoc/overview.html
index ce52a4e..b238c64 100644
--- a/juneau-core/src/main/javadoc/overview.html
+++ b/juneau-core/src/main/javadoc/overview.html
@@ -334,12 +334,12 @@
<jc>// Create a custom serializer for lax syntax using single quote characters</jc>
JsonSerializer serializer = <jk>new</jk> JsonSerializer()
- .setProperty(JsonSerializerContext.<jsf>JSON_simpleMode</jsf>, <jk>true</jk>)
- .setProperty(SerializerContext.<jsf>SERIALIZER_quoteChar</jsf>, <js>'\''</js>);
+ .setSimpleMode(<jk>true</jk>)
+ .setQuoteChar(<js>'\''</js>);
<jc>// Clone an existing serializer and modify it to use single-quotes</jc>
JsonSerializer serializer = JsonSerializer.<jsf>DEFAULT</jsf>.clone()
- .setProperty(SerializerContext.<jsf>SERIALIZER_quoteChar</jsf>, <js>'\''</js>);
+ .setQuoteChar(<js>'\''</js>);
<jc>// Serialize a POJO to JSON</jc>
String json = serializer.serialize(someObject);
@@ -448,8 +448,8 @@
<jc>// Construct a new serializer group with configuration parameters that get applied to all serializers.</jc>
SerializerGroup sg = <jk>new</jk> SerializerGroup()
.append(JsonSerializer.<jk>class</jk>, UrlEncodingSerializer.<jk>class</jk>);
- .setProperty(SerializerContext.<jsf>SERIALIZER_useIndentation</jsf>, <jk>true</jk>)
- .addTransforms(CalendarSwap.ISO8601DT.<jk>class</jk>);
+ .setUseIndentation(<jk>true</jk>)
+ .addPojoSwaps(CalendarSwap.ISO8601DT.<jk>class</jk>);
<jc>// Find the appropriate serializer by Accept type and serialize our POJO to the specified writer.</jc>
sg.getSerializer(<js>"text/invalid, text/json;q=0.8, text/*;q:0.6, *\/*;q=0.0"</js>)
@@ -549,10 +549,10 @@
</p>
<p class='bcode'>
JsonSerializer s = <jk>new</jk> JsonSerializer()
- .setProperty(SerializerContext.<jsf>SERIALIZER_useIndentation</jsf>, <jk>true</jk>)
- .setProperty(JsonSerializerContext.<jsf>JSON_useWhitespace</jsf>, <jk>true</jk>)
- .setProperty(JsonSerializerContext.<jsf>JSON_simpleMode</jsf>, <jk>true</jk>)
- .setProperty(SerializerContext.<jsf>SERIALIZER_quoteChar</jsf>, <js>'\''</js>);
+ .setUseIndentation(<jk>true</jk>)
+ .setUseWhitespace(<jk>true</jk>)
+ .setSimpleMode(<jk>true</jk>)
+ .setQuoteChar(<js>'\''</js>);
</p>
<p>
However, each of the serializers and parsers already contain reusable instances with common configurations.<br>
@@ -587,7 +587,7 @@
<jc>// Clone and customize an existing serializer.</jc>
JsonSerializer s = JsonSerializer.<jsf>DEFAULT_LAX</jsf>
.clone()
- .setProperty(SerializerContext.<jsf>SERIALIZER_quoteChar</jsf>, <js>'"'</js>);
+ .setQuoteChar(<js>'"'</js>);
<jc>// Lock it so that the configuration cannot be changed.</jc>
s.lock();
@@ -1023,7 +1023,7 @@
</p>
<ul>
<li>On individual bean properties through the {@link org.apache.juneau.annotation.BeanProperty#beanDictionary() @BeanProperty.beanDictionary()} annotation.
- <li>Globally for a parser using the {@link org.apache.juneau.parser.Parser#addToDictionary(Class...)} method.
+ <li>Globally for a parser using the {@link org.apache.juneau.parser.Parser#addToBeanDictionary(Class...)} method.
</ul>
<p class='info'>
Type names do not need to be universally unique.
@@ -2969,8 +2969,8 @@
serializerGroup
.addBeanFilters(HttpServletRequest.<jk>class</jk>, HttpSession.<jk>class</jk>, ServletContext.<jk>class</jk>)
.addPojoSwaps(EnumerationSwap.<jk>class</jk>)
- .setProperty(<jsf>SERIALIZER_maxDepth</jsf>, 10)
- .setProperty(<jsf>SERIALIZER_detectRecursions</jsf>, <jk>true</jk>);
+ .setMaxDepth(10)
+ .setDetectRecursions(<jk>true</jk>);
.setProperty(<jsf>HTMLDOC_links</jsf>, <js>"{...}"</js>);
<jc>// Return the updated group</jc>
@@ -5472,9 +5472,46 @@
<li>{@link org.apache.juneau.parser.Parser#parse(Object,Class)} - Normal method.
<li>{@link org.apache.juneau.parser.Parser#parse(Object,Type,Type...)} - Method for parsing into parameterized maps and collections.
</ul>
+ Using these methods, you can construct arbitrarily complex objects consisting of maps and collections.
+ You could do this before, but it required constructing a <code>ClassMeta</code> object.
+ <br>For example:
+ <p class='bcode'>
+ <jc>// Old way:</jc>
+ ClassMeta<?> cm = parser.getMapClassMeta(
+ HashMap.<jk>class</jk>,
+ String.<jk>class</jk>,
+ parser.getCollectionClassMeta(
+ LinkedList.<jk>class</jk>,
+ MyBean.<jk>class</jk>
+ )
+ );
+ Map<String,List<MyBean>> map = (Map<String,List<MyBean>>)parser.parse(input, cm);
+
+ <jc>// New way:</jc>
+ Map<String,List<MyBean>> map = parser.parse(input, HashMap.<jk>class</jk>, String.<jk>class</jk>, LinkedList.<jk>class</jk>, MyBean.<jk>class</jk>);
+ </p>
<li>Arbitrarily-complex parameterized maps and collections can now be parsed without the need for creating intermediate <code>ClassMeta</code> objects.
<li>No need for casting anymore if you were using the old <code>parseMap()</code> and <code>parseCollection()</code> methods!
<li>Changes allow me to eliminate <code>BeanContext.normalizeClassMeta()</code> method.
+ <li>Convenience methods added for setting parser properties:
+ <p class='bcode'>
+ <jc>// Old way:</jc>
+ <jk>new</jk> JsonParser().setProperty(<jsf>PARSER_strict</jsf>, <jk>true</jk>).setProperty(<jsf>BEAN_locale</jsf>, mylocale);
+
+ <jc>// New way:</jc>
+ <jk>new</jk> JsonParser().setStrict(<jk>true</jk>).setLocale(mylocale);
+ </p>
+ </ul>
+ <li>Improvements to Serializer class:
+ <ul>
+ <li>Convenience methods added for setting serializer properties:
+ <p class='bcode'>
+ <jc>// Old way:</jc>
+ <jk>new</jk> JsonSerializer().setProperty(<jsf>JSON_simpleMode</jsf>, <jk>true</jk>).setProperty(<jsf>SERIALIZER_quoteChar</jsf>, <js>'"'</js>);
+
+ <jc>// New way:</jc>
+ <jk>new</jk> JsonSerializer().setSimpleMode(<jk>true</jk>).setQuoteChar(<js>'"'</js>);
+ </p>
</ul>
<li>Simplified {@link org.apache.juneau.transform.PojoSwap} class. Now just two methods:
<ul>
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-examples-rest/src/test/java/org/apache/juneau/examples/rest/AddressBookResourceTest.java
----------------------------------------------------------------------
diff --git a/juneau-examples-rest/src/test/java/org/apache/juneau/examples/rest/AddressBookResourceTest.java b/juneau-examples-rest/src/test/java/org/apache/juneau/examples/rest/AddressBookResourceTest.java
index d504ee6..67ae42a 100644
--- a/juneau-examples-rest/src/test/java/org/apache/juneau/examples/rest/AddressBookResourceTest.java
+++ b/juneau-examples-rest/src/test/java/org/apache/juneau/examples/rest/AddressBookResourceTest.java
@@ -14,6 +14,7 @@ package org.apache.juneau.examples.rest;
import static org.apache.juneau.examples.rest.TestUtils.*;
import static org.junit.Assert.*;
+import static org.apache.juneau.xml.XmlSerializerContext.*;
import java.util.*;
@@ -45,7 +46,7 @@ public class AddressBookResourceTest {
for (RestClient c : clients) {
c.getSerializer().addPojoSwaps(CalendarSwap.DateMedium.class);
c.getParser().addPojoSwaps(CalendarSwap.DateMedium.class);
- c.getSerializer().setProperty(XmlSerializerContext.XML_autoDetectNamespaces, true);
+ c.getSerializer().setProperty(XML_autoDetectNamespaces, true);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-examples-rest/src/test/java/org/apache/juneau/examples/rest/SampleRemoteableServicesResourceTest.java
----------------------------------------------------------------------
diff --git a/juneau-examples-rest/src/test/java/org/apache/juneau/examples/rest/SampleRemoteableServicesResourceTest.java b/juneau-examples-rest/src/test/java/org/apache/juneau/examples/rest/SampleRemoteableServicesResourceTest.java
index 90e8e7b..945e14a 100644
--- a/juneau-examples-rest/src/test/java/org/apache/juneau/examples/rest/SampleRemoteableServicesResourceTest.java
+++ b/juneau-examples-rest/src/test/java/org/apache/juneau/examples/rest/SampleRemoteableServicesResourceTest.java
@@ -13,6 +13,7 @@
package org.apache.juneau.examples.rest;
import static org.junit.Assert.*;
+import static org.apache.juneau.xml.XmlSerializerContext.*;
import org.apache.juneau.examples.addressbook.*;
import org.apache.juneau.json.*;
@@ -37,7 +38,7 @@ public class SampleRemoteableServicesResourceTest {
for (RestClient c : clients) {
c.addPojoSwaps(CalendarSwap.DateMedium.class);
c.setRemoteableServletUri("/remoteable");
- c.setProperty(XmlSerializerContext.XML_autoDetectNamespaces, true);
+ c.setProperty(XML_autoDetectNamespaces, true);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-examples-rest/src/test/java/org/apache/juneau/examples/rest/TestUtils.java
----------------------------------------------------------------------
diff --git a/juneau-examples-rest/src/test/java/org/apache/juneau/examples/rest/TestUtils.java b/juneau-examples-rest/src/test/java/org/apache/juneau/examples/rest/TestUtils.java
index 970cc47..39463dd 100644
--- a/juneau-examples-rest/src/test/java/org/apache/juneau/examples/rest/TestUtils.java
+++ b/juneau-examples-rest/src/test/java/org/apache/juneau/examples/rest/TestUtils.java
@@ -12,9 +12,6 @@
// ***************************************************************************************************************************
package org.apache.juneau.examples.rest;
-import static org.apache.juneau.BeanContext.*;
-import static org.apache.juneau.serializer.SerializerContext.*;
-import static org.apache.juneau.xml.XmlSerializerContext.*;
import static org.junit.Assert.*;
import java.io.*;
@@ -43,12 +40,12 @@ import org.xml.sax.*;
public class TestUtils {
private static JsonSerializer js = new JsonSerializer.Simple()
- .setProperty(SERIALIZER_trimNullProperties, false);
+ .setTrimNullProperties(false);
private static JsonSerializer jsSorted = new JsonSerializer.Simple()
- .setProperty(SERIALIZER_sortCollections, true)
- .setProperty(SERIALIZER_sortMaps, true)
- .setProperty(SERIALIZER_trimNullProperties, false);
+ .setSortCollections(true)
+ .setSortMaps(true)
+ .setTrimNullProperties(false);
private static JsonSerializer js2 = new JsonSerializer.Simple()
@@ -56,7 +53,7 @@ public class TestUtils {
private static JsonSerializer js3 = new JsonSerializer.Simple()
.addPojoSwaps(IteratorSwap.class, EnumerationSwap.class)
- .setProperty(BEAN_sortProperties, true);
+ .setSortProperties(true);
/**
* Verifies that two objects are equivalent.
@@ -224,7 +221,7 @@ public class TestUtils {
* Test whitespace and generated schema.
*/
public static void validateXml(Object o, XmlSerializer s) throws Exception {
- s = s.clone().setProperty(SERIALIZER_useIndentation, true).setProperty(XML_enableNamespaces, true).setProperty(XML_addNamespaceUrisToRoot, true);
+ s = s.clone().setUseIndentation(true).setEnableNamespaces(true).setAddNamespaceUrisToRoot(true);
String xml = s.serialize(o);
String xmlSchema = null;
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-microservice/src/main/java/org/apache/juneau/microservice/Microservice.java
----------------------------------------------------------------------
diff --git a/juneau-microservice/src/main/java/org/apache/juneau/microservice/Microservice.java b/juneau-microservice/src/main/java/org/apache/juneau/microservice/Microservice.java
index e604231..0d0b7c4 100755
--- a/juneau-microservice/src/main/java/org/apache/juneau/microservice/Microservice.java
+++ b/juneau-microservice/src/main/java/org/apache/juneau/microservice/Microservice.java
@@ -382,6 +382,7 @@ public abstract class Microservice {
return mf;
}
+
//--------------------------------------------------------------------------------
// Abstract lifecycle methods.
//--------------------------------------------------------------------------------
@@ -551,6 +552,7 @@ public abstract class Microservice {
System.exit(2);
}
+
//--------------------------------------------------------------------------------
// Lifecycle listener methods.
// Subclasses can override these methods to run code on certain events.
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-microservice/src/main/java/org/apache/juneau/microservice/RestMicroservice.java
----------------------------------------------------------------------
diff --git a/juneau-microservice/src/main/java/org/apache/juneau/microservice/RestMicroservice.java b/juneau-microservice/src/main/java/org/apache/juneau/microservice/RestMicroservice.java
index a86eb4c..fe46dca 100755
--- a/juneau-microservice/src/main/java/org/apache/juneau/microservice/RestMicroservice.java
+++ b/juneau-microservice/src/main/java/org/apache/juneau/microservice/RestMicroservice.java
@@ -92,6 +92,7 @@ public class RestMicroservice extends Microservice {
super(args);
}
+
//--------------------------------------------------------------------------------
// Methods implemented on Microservice API
//--------------------------------------------------------------------------------
@@ -138,6 +139,7 @@ public class RestMicroservice extends Microservice {
return this;
}
+
//--------------------------------------------------------------------------------
// RestMicroservice API methods.
//--------------------------------------------------------------------------------
@@ -483,6 +485,7 @@ public class RestMicroservice extends Microservice {
}
}
+
//--------------------------------------------------------------------------------
// Lifecycle listener methods.
//--------------------------------------------------------------------------------
@@ -522,6 +525,7 @@ public class RestMicroservice extends Microservice {
*/
protected void onPostStopServer() {}
+
//--------------------------------------------------------------------------------
// Other methods.
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-microservice/src/main/java/org/apache/juneau/microservice/resources/DirectoryResource.java
----------------------------------------------------------------------
diff --git a/juneau-microservice/src/main/java/org/apache/juneau/microservice/resources/DirectoryResource.java b/juneau-microservice/src/main/java/org/apache/juneau/microservice/resources/DirectoryResource.java
index 90a73c2..19e1757 100755
--- a/juneau-microservice/src/main/java/org/apache/juneau/microservice/resources/DirectoryResource.java
+++ b/juneau-microservice/src/main/java/org/apache/juneau/microservice/resources/DirectoryResource.java
@@ -110,7 +110,7 @@ public class DirectoryResource extends Resource {
* @param req The HTTP request.
* @return Either a FileResource or list of FileResources depending on whether it's a
* file or directory.
- * @throws Exception - If file could not be read or access was not granted.
+ * @throws Exception If file could not be read or access was not granted.
*/
@RestMethod(name="GET", path="/*",
description="On directories, returns a directory listing.\nOn files, returns information about the file.",
@@ -148,7 +148,7 @@ public class DirectoryResource extends Resource {
*
* @param req The HTTP request.
* @return The message <js>"File deleted"</js> if successful.
- * @throws Exception - If file could not be read or access was not granted.
+ * @throws Exception If file could not be read or access was not granted.
*/
@RestMethod(name="DELETE", path="/*",
description="Delete a file on the file system."
@@ -170,7 +170,7 @@ public class DirectoryResource extends Resource {
*
* @param req The HTTP request.
* @return The message <js>"File added"</js> if successful.
- * @throws Exception - If file could not be read or access was not granted.
+ * @throws Exception If file could not be read or access was not granted.
*/
@RestMethod(name="PUT", path="/*",
description="Add or overwrite a file on the file system."
@@ -195,7 +195,7 @@ public class DirectoryResource extends Resource {
* @param req The HTTP request.
* @param res The HTTP response.
* @return A Reader containing the contents of the file.
- * @throws Exception - If file could not be read or access was not granted.
+ * @throws Exception If file could not be read or access was not granted.
*/
@RestMethod(name="VIEW", path="/*",
description="View the contents of a file.\nApplies to files only."
@@ -223,7 +223,7 @@ public class DirectoryResource extends Resource {
* @param req The HTTP request.
* @param res The HTTP response.
* @return A Reader containing the contents of the file.
- * @throws Exception - If file could not be read or access was not granted.
+ * @throws Exception If file could not be read or access was not granted.
*/
@RestMethod(name="DOWNLOAD", path="/*",
description="Download the contents of a file.\nApplies to files only."
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClient.java
----------------------------------------------------------------------
diff --git a/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClient.java b/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClient.java
index 54ee36d..6041d6d 100644
--- a/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClient.java
+++ b/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClient.java
@@ -922,14 +922,14 @@ public class RestClient extends CoreApi {
}
@Override /* CoreAPI */
- public RestClient addToDictionary(Class<?>...classes) throws LockedException {
- super.addToDictionary(classes);
+ public RestClient addToBeanDictionary(Class<?>...classes) throws LockedException {
+ super.addToBeanDictionary(classes);
if (serializer != null)
- serializer.addToDictionary(classes);
+ serializer.addToBeanDictionary(classes);
if (parser != null)
- parser.addToDictionary(classes);
+ parser.addToBeanDictionary(classes);
if (urlEncodingSerializer != null)
- urlEncodingSerializer.addToDictionary(classes);
+ urlEncodingSerializer.addToBeanDictionary(classes);
return this;
}
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-rest/src/main/java/org/apache/juneau/rest/ResponseHandler.java
----------------------------------------------------------------------
diff --git a/juneau-rest/src/main/java/org/apache/juneau/rest/ResponseHandler.java b/juneau-rest/src/main/java/org/apache/juneau/rest/ResponseHandler.java
index 8144782..6607e64 100644
--- a/juneau-rest/src/main/java/org/apache/juneau/rest/ResponseHandler.java
+++ b/juneau-rest/src/main/java/org/apache/juneau/rest/ResponseHandler.java
@@ -85,8 +85,8 @@ public interface ResponseHandler {
* @param res The HTTP servlet response;
* @param output The POJO returned by the REST method that now needs to be sent to the response.
* @return true If this handler handled the response.
- * @throws IOException - If low-level exception occurred on output stream. Results in a {@link HttpServletResponse#SC_INTERNAL_SERVER_ERROR} error.
- * @throws RestException - If some other exception occurred. Can be used to provide an appropriate HTTP response code and message.
+ * @throws IOException If low-level exception occurred on output stream. Results in a {@link HttpServletResponse#SC_INTERNAL_SERVER_ERROR} error.
+ * @throws RestException If some other exception occurred. Can be used to provide an appropriate HTTP response code and message.
*/
boolean handle(RestRequest req, RestResponse res, Object output) throws IOException, RestException;
}
[04/14] incubator-juneau git commit: Add convenience property setters
to serializers and parsers.
Posted by ja...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/serializer/SerializerGroup.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/serializer/SerializerGroup.java b/juneau-core/src/main/java/org/apache/juneau/serializer/SerializerGroup.java
index ec62ae8..63f0400 100644
--- a/juneau-core/src/main/java/org/apache/juneau/serializer/SerializerGroup.java
+++ b/juneau-core/src/main/java/org/apache/juneau/serializer/SerializerGroup.java
@@ -74,7 +74,7 @@ public final class SerializerGroup extends Lockable {
/**
* Adds the specified serializer to the beginning of this group.
*
- * @param s - The serializer to add to this group.
+ * @param s The serializer to add to this group.
* @return This object (for method chaining).
*/
public SerializerGroup append(Serializer s) {
@@ -237,103 +237,892 @@ public final class SerializerGroup extends Lockable {
return l;
}
+
//--------------------------------------------------------------------------------
- // Convenience methods for setting properties on all serializers.
+ // Properties
//--------------------------------------------------------------------------------
/**
- * Shortcut for calling {@link Serializer#setProperty(String, Object)} on all serializers in this group.
+ * Calls {@link Serializer#setMaxDepth(int)} on all serializers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see SerializerContext#SERIALIZER_maxDepth
+ */
+ public SerializerGroup setMaxDepth(int value) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.setMaxDepth(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#setInitialDepth(int)} on all serializers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see SerializerContext#SERIALIZER_initialDepth
+ */
+ public SerializerGroup setInitialDepth(int value) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.setInitialDepth(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#setDetectRecursions(boolean)} on all serializers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see SerializerContext#SERIALIZER_detectRecursions
+ */
+ public SerializerGroup setDetectRecursions(boolean value) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.setDetectRecursions(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#setIgnoreRecursions(boolean)} on all serializers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see SerializerContext#SERIALIZER_ignoreRecursions
+ */
+ public SerializerGroup setIgnoreRecursions(boolean value) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.setIgnoreRecursions(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#setUseIndentation(boolean)} on all serializers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see SerializerContext#SERIALIZER_useIndentation
+ */
+ public SerializerGroup setUseIndentation(boolean value) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.setUseIndentation(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#setAddBeanTypeProperties(boolean)} on all serializers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see SerializerContext#SERIALIZER_addBeanTypeProperties
+ */
+ public SerializerGroup setAddBeanTypeProperties(boolean value) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.setAddBeanTypeProperties(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#setQuoteChar(char)} on all serializers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see SerializerContext#SERIALIZER_quoteChar
+ */
+ public SerializerGroup setQuoteChar(char value) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.setQuoteChar(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#setTrimNullProperties(boolean)} on all serializers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see SerializerContext#SERIALIZER_trimNullProperties
+ */
+ public SerializerGroup setTrimNullProperties(boolean value) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.setTrimNullProperties(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#setTrimEmptyCollections(boolean)} on all serializers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see SerializerContext#SERIALIZER_trimEmptyCollections
+ */
+ public SerializerGroup setTrimEmptyCollections(boolean value) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.setTrimEmptyCollections(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#setTrimEmptyMaps(boolean)} on all serializers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see SerializerContext#SERIALIZER_trimEmptyMaps
+ */
+ public SerializerGroup setTrimEmptyMaps(boolean value) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.setTrimEmptyMaps(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#setTrimStrings(boolean)} on all serializers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see SerializerContext#SERIALIZER_trimStrings
+ */
+ public SerializerGroup setTrimStrings(boolean value) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.setTrimStrings(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#setRelativeUriBase(String)} on all serializers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see SerializerContext#SERIALIZER_relativeUriBase
+ */
+ public SerializerGroup setRelativeUriBase(String value) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.setRelativeUriBase(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#setAbsolutePathUriBase(String)} on all serializers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see SerializerContext#SERIALIZER_absolutePathUriBase
+ */
+ public SerializerGroup setAbsolutePathUriBase(String value) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.setAbsolutePathUriBase(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#setSortCollections(boolean)} on all serializers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see SerializerContext#SERIALIZER_sortCollections
+ */
+ public SerializerGroup setSortCollections(boolean value) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.setSortCollections(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#setSortMaps(boolean)} on all serializers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see SerializerContext#SERIALIZER_sortMaps
+ */
+ public SerializerGroup setSortMaps(boolean value) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.setSortMaps(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#setBeansRequireDefaultConstructor(boolean)} on all serializers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beansRequireDefaultConstructor
+ */
+ public SerializerGroup setBeansRequireDefaultConstructor(boolean value) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.setBeansRequireDefaultConstructor(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#setBeansRequireSerializable(boolean)} on all serializers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beansRequireSerializable
+ */
+ public SerializerGroup setBeansRequireSerializable(boolean value) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.setBeansRequireSerializable(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#setBeansRequireSettersForGetters(boolean)} on all serializers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beansRequireSettersForGetters
+ */
+ public SerializerGroup setBeansRequireSettersForGetters(boolean value) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.setBeansRequireSettersForGetters(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#setBeansRequireSomeProperties(boolean)} on all serializers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beansRequireSomeProperties
+ */
+ public SerializerGroup setBeansRequireSomeProperties(boolean value) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.setBeansRequireSomeProperties(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#setBeanMapPutReturnsOldValue(boolean)} on all serializers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beanMapPutReturnsOldValue
+ */
+ public SerializerGroup setBeanMapPutReturnsOldValue(boolean value) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.setBeanMapPutReturnsOldValue(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#setBeanConstructorVisibility(Visibility)} on all serializers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beanConstructorVisibility
+ */
+ public SerializerGroup setBeanConstructorVisibility(Visibility value) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.setBeanConstructorVisibility(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#setBeanClassVisibility(Visibility)} on all serializers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beanClassVisibility
+ */
+ public SerializerGroup setBeanClassVisibility(Visibility value) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.setBeanClassVisibility(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#setBeanFieldVisibility(Visibility)} on all serializers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beanFieldVisibility
+ */
+ public SerializerGroup setBeanFieldVisibility(Visibility value) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.setBeanFieldVisibility(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#setMethodVisibility(Visibility)} on all serializers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_methodVisibility
+ */
+ public SerializerGroup setMethodVisibility(Visibility value) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.setMethodVisibility(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#setUseJavaBeanIntrospector(boolean)} on all serializers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_useJavaBeanIntrospector
+ */
+ public SerializerGroup setUseJavaBeanIntrospector(boolean value) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.setUseJavaBeanIntrospector(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#setUseInterfaceProxies(boolean)} on all serializers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_useInterfaceProxies
+ */
+ public SerializerGroup setUseInterfaceProxies(boolean value) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.setUseInterfaceProxies(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#setIgnoreUnknownBeanProperties(boolean)} on all serializers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_ignoreUnknownBeanProperties
+ */
+ public SerializerGroup setIgnoreUnknownBeanProperties(boolean value) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.setIgnoreUnknownBeanProperties(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#setIgnoreUnknownNullBeanProperties(boolean)} on all serializers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_ignoreUnknownNullBeanProperties
+ */
+ public SerializerGroup setIgnoreUnknownNullBeanProperties(boolean value) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.setIgnoreUnknownNullBeanProperties(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#setIgnorePropertiesWithoutSetters(boolean)} on all serializers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_ignorePropertiesWithoutSetters
+ */
+ public SerializerGroup setIgnorePropertiesWithoutSetters(boolean value) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.setIgnorePropertiesWithoutSetters(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#setIgnoreInvocationExceptionsOnGetters(boolean)} on all serializers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_ignoreInvocationExceptionsOnGetters
+ */
+ public SerializerGroup setIgnoreInvocationExceptionsOnGetters(boolean value) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.setIgnoreInvocationExceptionsOnGetters(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#setIgnoreInvocationExceptionsOnSetters(boolean)} on all serializers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_ignoreInvocationExceptionsOnSetters
+ */
+ public SerializerGroup setIgnoreInvocationExceptionsOnSetters(boolean value) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.setIgnoreInvocationExceptionsOnSetters(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#setSortProperties(boolean)} on all serializers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_sortProperties
+ */
+ public SerializerGroup setSortProperties(boolean value) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.setSortProperties(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#setNotBeanPackages(String...)} on all serializers in this group.
+ *
+ * @param values The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_notBeanPackages
+ */
+ public SerializerGroup setNotBeanPackages(String...values) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.setNotBeanPackages(values);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#setNotBeanPackages(Collection)} on all serializers in this group.
+ *
+ * @param values The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_notBeanPackages
+ */
+ public SerializerGroup setNotBeanPackages(Collection<String> values) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.setNotBeanPackages(values);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#addNotBeanPackages(String...)} on all serializers in this group.
+ *
+ * @param values The values to remove from this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_notBeanPackages
+ * @see BeanContext#BEAN_notBeanPackages_remove
+ */
+ public SerializerGroup addNotBeanPackages(String...values) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.addNotBeanPackages(values);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#addNotBeanPackages(Collection)} on all serializers in this group.
+ *
+ * @param values The values to remove from this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_notBeanPackages
+ * @see BeanContext#BEAN_notBeanPackages_remove
+ */
+ public SerializerGroup addNotBeanPackages(Collection<String> values) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.addNotBeanPackages(values);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#removeNotBeanPackages(String...)} on all serializers in this group.
+ *
+ * @param values The values to remove from this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_notBeanPackages
+ * @see BeanContext#BEAN_notBeanPackages_remove
+ */
+ public SerializerGroup removeNotBeanPackages(String...values) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.removeNotBeanPackages(values);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#removeNotBeanPackages(Collection)} on all serializers in this group.
+ *
+ * @param values The values to remove from this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_notBeanPackages
+ * @see BeanContext#BEAN_notBeanPackages_remove
+ */
+ public SerializerGroup removeNotBeanPackages(Collection<String> values) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.removeNotBeanPackages(values);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#setNotBeanClasses(Class...)} on all serializers in this group.
+ *
+ * @param values The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_notBeanClasses
+ */
+ public SerializerGroup setNotBeanClasses(Class<?>...values) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.setNotBeanClasses(values);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#setNotBeanClasses(Collection)} on all serializers in this group.
+ *
+ * @param values The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_notBeanPackages
+ */
+ public SerializerGroup setNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.setNotBeanClasses(values);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#addNotBeanClasses(Class...)} on all serializers in this group.
+ *
+ * @param values The values to add to this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_notBeanClasses
+ * @see BeanContext#BEAN_notBeanClasses_add
+ */
+ public SerializerGroup addNotBeanClasses(Class<?>...values) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.addNotBeanClasses(values);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#addNotBeanClasses(Collection)} on all serializers in this group.
+ *
+ * @param values The values to add to this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_notBeanClasses
+ * @see BeanContext#BEAN_notBeanClasses_add
+ */
+ public SerializerGroup addNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.addNotBeanClasses(values);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#removeNotBeanClasses(Class...)} on all serializers in this group.
*
- * @param property The property name.
- * @param value The property value.
- * @throws LockedException If {@link #lock()} was called on this object.
+ * @param values The values to remove from this property.
* @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_notBeanClasses
+ * @see BeanContext#BEAN_notBeanClasses_remove
*/
- public SerializerGroup setProperty(String property, Object value) throws LockedException {
+ public SerializerGroup removeNotBeanClasses(Class<?>...values) throws LockedException {
checkLock();
for (Serializer s : serializers)
- s.setProperty(property, value);
+ s.removeNotBeanClasses(values);
return this;
}
/**
- * Shortcut for calling {@link Serializer#setProperties(ObjectMap)} on all serializers in this group.
+ * Calls {@link Serializer#removeNotBeanClasses(Collection)} on all serializers in this group.
*
- * @param properties The properties to set. Ignored if <jk>null</jk>.
- * @throws LockedException If {@link #lock()} was called on this object.
+ * @param values The values to remove from this property.
* @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_notBeanClasses
+ * @see BeanContext#BEAN_notBeanClasses_remove
*/
- public SerializerGroup setProperties(ObjectMap properties) {
+ public SerializerGroup removeNotBeanClasses(Collection<Class<?>> values) throws LockedException {
checkLock();
for (Serializer s : serializers)
- s.setProperties(properties);
+ s.removeNotBeanClasses(values);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#setBeanFilters(Class...)} on all serializers in this group.
+ *
+ * @param values The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beanFilters
+ */
+ public SerializerGroup setBeanFilters(Class<?>...values) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.setBeanFilters(values);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#setBeanFilters(Collection)} on all serializers in this group.
+ *
+ * @param values The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beanFilters
+ */
+ public SerializerGroup setBeanFilters(Collection<Class<?>> values) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.setBeanFilters(values);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#addBeanFilters(Class...)} on all serializers in this group.
+ *
+ * @param values The values to add to this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beanFilters
+ * @see BeanContext#BEAN_beanFilters_add
+ */
+ public SerializerGroup addBeanFilters(Class<?>...values) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.addBeanFilters(values);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#addBeanFilters(Collection)} on all serializers in this group.
+ *
+ * @param values The values to add to this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beanFilters
+ * @see BeanContext#BEAN_beanFilters_add
+ */
+ public SerializerGroup addBeanFilters(Collection<Class<?>> values) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.addBeanFilters(values);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#removeBeanFilters(Class...)} on all serializers in this group.
+ *
+ * @param values The values to remove from this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beanFilters
+ * @see BeanContext#BEAN_beanFilters_remove
+ */
+ public SerializerGroup removeBeanFilters(Class<?>...values) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.removeBeanFilters(values);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#removeBeanFilters(Collection)} on all serializers in this group.
+ *
+ * @param values The values to remove from this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beanFilters
+ * @see BeanContext#BEAN_beanFilters_remove
+ */
+ public SerializerGroup removeBeanFilters(Collection<Class<?>> values) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.removeBeanFilters(values);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#setPojoSwaps(Class...)} on all serializers in this group.
+ *
+ * @param values The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_pojoSwaps
+ */
+ public SerializerGroup setPojoSwaps(Class<?>...values) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.setPojoSwaps(values);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#setPojoSwaps(Collection)} on all serializers in this group.
+ *
+ * @param values The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_pojoSwaps
+ */
+ public SerializerGroup setPojoSwaps(Collection<Class<?>> values) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.setPojoSwaps(values);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#addPojoSwaps(Class...)} on all serializers in this group.
+ *
+ * @param values The values to add to this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_pojoSwaps
+ * @see BeanContext#BEAN_pojoSwaps_add
+ */
+ public SerializerGroup addPojoSwaps(Class<?>...values) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.addPojoSwaps(values);
return this;
}
/**
- * Shortcut for calling {@link Serializer#addNotBeanClasses(Class[])} on all serializers in this group.
+ * Calls {@link Serializer#addPojoSwaps(Collection)} on all serializers in this group.
*
- * @param classes The classes to specify as not-beans to the underlying bean context of all serializers in this group.
- * @throws LockedException If {@link #lock()} was called on this object.
+ * @param values The values to add to this property.
* @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_pojoSwaps
+ * @see BeanContext#BEAN_pojoSwaps_add
*/
- public SerializerGroup addNotBeanClasses(Class<?>...classes) throws LockedException {
+ public SerializerGroup addPojoSwaps(Collection<Class<?>> values) throws LockedException {
checkLock();
for (Serializer s : serializers)
- s.addNotBeanClasses(classes);
+ s.addPojoSwaps(values);
return this;
}
/**
- * Shortcut for calling {@link Serializer#addBeanFilters(Class[])} on all serializers in this group.
+ * Calls {@link Serializer#removePojoSwaps(Class...)} on all serializers in this group.
*
- * @param classes The classes to add bean filters for to the underlying bean context of all serializers in this group.
- * @throws LockedException If {@link #lock()} was called on this object.
+ * @param values The values to remove from this property.
* @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_pojoSwaps
+ * @see BeanContext#BEAN_pojoSwaps_remove
*/
- public SerializerGroup addBeanFilters(Class<?>...classes) throws LockedException {
+ public SerializerGroup removePojoSwaps(Class<?>...values) throws LockedException {
checkLock();
for (Serializer s : serializers)
- s.addBeanFilters(classes);
+ s.removePojoSwaps(values);
return this;
}
/**
- * Shortcut for calling {@link Serializer#addPojoSwaps(Class[])} on all serializers in this group.
+ * Calls {@link Serializer#removePojoSwaps(Collection)} on all serializers in this group.
*
- * @param classes The classes to add POJO swaps for to the underlying bean context of all serializers in this group.
- * @throws LockedException If {@link #lock()} was called on this object.
+ * @param values The values to remove from this property.
* @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_pojoSwaps
+ * @see BeanContext#BEAN_pojoSwaps_remove
*/
- public SerializerGroup addPojoSwaps(Class<?>...classes) throws LockedException {
+ public SerializerGroup removePojoSwaps(Collection<Class<?>> values) throws LockedException {
checkLock();
for (Serializer s : serializers)
- s.addPojoSwaps(classes);
+ s.removePojoSwaps(values);
return this;
}
/**
- * Shortcut for calling {@link Serializer#addToDictionary(Class[])} on all serializers in this group.
+ * Calls {@link Serializer#setImplClasses(Map)} on all serializers in this group.
*
- * @param classes The classes to add to the bean dictionary on the underlying bean context of all serializers in this group.
- * @throws LockedException If {@link #lock()} was called on this object.
+ * @param values The new value for this property.
* @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_implClasses
*/
- public SerializerGroup addToDictionary(Class<?>...classes) throws LockedException {
+ public SerializerGroup setImplClasses(Map<Class<?>,Class<?>> values) throws LockedException {
checkLock();
for (Serializer s : serializers)
- s.addToDictionary(classes);
+ s.setImplClasses(values);
return this;
}
/**
- * Shortcut for calling {@link Serializer#addImplClass(Class, Class)} on all serializers in this group.
+ * Calls {@link Serializer#addImplClass(Class,Class)} on all serializers in this group.
*
- * @param <T> The interface or abstract class type.
- * @param interfaceClass The interface or abstract class.
+ * @param interfaceClass The interface class.
* @param implClass The implementation class.
- * @throws LockedException If {@link #lock()} was called on this object.
+ * @param <T> The class type of the interface.
* @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_implClasses
+ * @see BeanContext#BEAN_implClasses_put
*/
public <T> SerializerGroup addImplClass(Class<T> interfaceClass, Class<? extends T> implClass) throws LockedException {
checkLock();
@@ -342,12 +1131,308 @@ public final class SerializerGroup extends Lockable {
return this;
}
+ /**
+ * Calls {@link Serializer#setBeanDictionary(Class...)} on all serializers in this group.
+ *
+ * @param values The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beanDictionary
+ */
+ public SerializerGroup setBeanDictionary(Class<?>...values) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.setBeanDictionary(values);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#setBeanDictionary(Collection)} on all serializers in this group.
+ *
+ * @param values The values to add to this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beanDictionary
+ * @see BeanContext#BEAN_beanDictionary_add
+ */
+ public SerializerGroup setBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.setBeanDictionary(values);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#addToBeanDictionary(Class...)} on all serializers in this group.
+ *
+ * @param values The values to add to this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beanDictionary
+ * @see BeanContext#BEAN_beanDictionary_add
+ */
+ public SerializerGroup addToBeanDictionary(Class<?>...values) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.addToBeanDictionary(values);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#addToBeanDictionary(Collection)} on all serializers in this group.
+ *
+ * @param values The values to add to this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beanDictionary
+ * @see BeanContext#BEAN_beanDictionary_add
+ */
+ public SerializerGroup addToBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.addToBeanDictionary(values);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#removeFromBeanDictionary(Class...)} on all serializers in this group.
+ *
+ * @param values The values to remove from this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beanDictionary
+ * @see BeanContext#BEAN_beanDictionary_remove
+ */
+ public SerializerGroup removeFromBeanDictionary(Class<?>...values) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.removeFromBeanDictionary(values);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#removeFromBeanDictionary(Collection)} on all serializers in this group.
+ *
+ * @param values The values to remove from this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beanDictionary
+ * @see BeanContext#BEAN_beanDictionary_remove
+ */
+ public SerializerGroup removeFromBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.removeFromBeanDictionary(values);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#setBeanTypePropertyName(String)} on all serializers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beanTypePropertyName
+ */
+ public SerializerGroup setBeanTypePropertyName(String value) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.setBeanTypePropertyName(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#setDefaultParser(Class)} on all serializers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_defaultParser
+ */
+ public SerializerGroup setDefaultParser(Class<?> value) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.setDefaultParser(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#setLocale(Locale)} on all serializers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_locale
+ */
+ public SerializerGroup setLocale(Locale value) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.setLocale(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#setTimeZone(TimeZone)} on all serializers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_timeZone
+ */
+ public SerializerGroup setTimeZone(TimeZone value) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.setTimeZone(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#setMediaType(MediaType)} on all serializers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_mediaType
+ */
+ public SerializerGroup setMediaType(MediaType value) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.setMediaType(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#setDebug(boolean)} on all serializers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_debug
+ */
+ public SerializerGroup setDebug(boolean value) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.setDebug(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#setProperty(String,Object)} on all serializers in this group.
+ *
+ * @param name The property name.
+ * @param value The property value.
+ * @return This class (for method chaining).
+ * @throws LockedException If {@link #lock()} has been called on this object or {@link ContextFactory} object.
+ * @see ContextFactory#setProperty(String, Object)
+ */
+ public SerializerGroup setProperty(String name, Object value) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.setProperty(name, value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#setProperties(ObjectMap)} on all serializers in this group.
+ *
+ * @param properties The properties to set on this class.
+ * @return This class (for method chaining).
+ * @throws LockedException If {@link #lock()} has been called on this object.
+ * @see ContextFactory#setProperties(java.util.Map)
+ */
+ public SerializerGroup setProperties(ObjectMap properties) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.setProperties(properties);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#addToProperty(String,Object)} on all serializers in this group.
+ *
+ * @param name The property name.
+ * @param value The new value to add to the SET property.
+ * @return This object (for method chaining).
+ * @throws ConfigException If property is not a SET property.
+ * @throws LockedException If {@link #lock()} has been called on this object.
+ */
+ public SerializerGroup addToProperty(String name, Object value) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.addToProperty(name, value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#putToProperty(String,Object,Object)} on all serializers in this group.
+ *
+ * @param name The property name.
+ * @param key The property value map key.
+ * @param value The property value map value.
+ * @return This object (for method chaining).
+ * @throws ConfigException If property is not a MAP property.
+ * @throws LockedException If {@link #lock()} has been called on this object.
+ */
+ public SerializerGroup putToProperty(String name, Object key, Object value) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.putToProperty(name, key, value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#putToProperty(String,Object)} on all serializers in this group.
+ *
+ * @param name The property value.
+ * @param value The property value map value.
+ * @return This object (for method chaining).
+ * @throws ConfigException If property is not a MAP property.
+ * @throws LockedException If {@link #lock()} has been called on this object.
+ */
+ public SerializerGroup putToProperty(String name, Object value) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.putToProperty(name, value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Serializer#removeFromProperty(String,Object)} on all serializers in this group.
+ *
+ * @param name The property name.
+ * @param value The property value in the SET property.
+ * @return This object (for method chaining).
+ * @throws ConfigException If property is not a SET property.
+ * @throws LockedException If {@link #lock()} has been called on this object.
+ */
+ public SerializerGroup removeFromProperty(String name, Object value) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.removeFromProperty(name, value);
+ return this;
+ }
+
//--------------------------------------------------------------------------------
// Overridden methods
//--------------------------------------------------------------------------------
/**
+ * Calls {@link Serializer#setClassLoader(ClassLoader)} on all serializers in this group.
+ *
+ * @param classLoader The new classloader.
+ * @throws LockedException If {@link ContextFactory#lock()} was called on this class or the bean context.
+ * @return This object (for method chaining).
+ * @see ContextFactory#setClassLoader(ClassLoader)
+ */
+ public SerializerGroup setClassLoader(ClassLoader classLoader) throws LockedException {
+ checkLock();
+ for (Serializer s : serializers)
+ s.setClassLoader(classLoader);
+ return this;
+ }
+
+ /**
* Locks this group and all serializers in this group.
*/
@Override /* Lockable */
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/serializer/WriterSerializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/serializer/WriterSerializer.java b/juneau-core/src/main/java/org/apache/juneau/serializer/WriterSerializer.java
index 5f38d4a..27aa39c 100644
--- a/juneau-core/src/main/java/org/apache/juneau/serializer/WriterSerializer.java
+++ b/juneau-core/src/main/java/org/apache/juneau/serializer/WriterSerializer.java
@@ -45,6 +45,7 @@ public abstract class WriterSerializer extends Serializer {
return true;
}
+
//--------------------------------------------------------------------------------
// Other methods
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/svl/VarResolver.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/svl/VarResolver.java b/juneau-core/src/main/java/org/apache/juneau/svl/VarResolver.java
index 6ffdaeb..37344b8 100644
--- a/juneau-core/src/main/java/org/apache/juneau/svl/VarResolver.java
+++ b/juneau-core/src/main/java/org/apache/juneau/svl/VarResolver.java
@@ -198,6 +198,7 @@ public class VarResolver extends CoreApi {
createSession(null).resolveTo(s, w);
}
+
//--------------------------------------------------------------------------------
// Overridden methods
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/transform/PojoSwap.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/transform/PojoSwap.java b/juneau-core/src/main/java/org/apache/juneau/transform/PojoSwap.java
index efd94d1..910561f 100644
--- a/juneau-core/src/main/java/org/apache/juneau/transform/PojoSwap.java
+++ b/juneau-core/src/main/java/org/apache/juneau/transform/PojoSwap.java
@@ -229,6 +229,7 @@ public abstract class PojoSwap<T,S> {
return ClassUtils.isParentClass(swapClass, o.getClass());
}
+
//--------------------------------------------------------------------------------
// Overridden methods
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/urlencoding/UonParser.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/urlencoding/UonParser.java b/juneau-core/src/main/java/org/apache/juneau/urlencoding/UonParser.java
index 7f803ae..510078a 100644
--- a/juneau-core/src/main/java/org/apache/juneau/urlencoding/UonParser.java
+++ b/juneau-core/src/main/java/org/apache/juneau/urlencoding/UonParser.java
@@ -18,7 +18,6 @@ import java.lang.reflect.*;
import java.util.*;
import org.apache.juneau.*;
-import org.apache.juneau.MediaType;
import org.apache.juneau.annotation.*;
import org.apache.juneau.internal.*;
import org.apache.juneau.parser.*;
@@ -55,7 +54,7 @@ public class UonParser extends ReaderParser {
public static final UonParser DEFAULT_DECODING = new Decoding().lock();
/** Reusable instance of {@link UonParser}, all default settings, whitespace-aware. */
- public static final UonParser DEFAULT_WS_AWARE = new UonParser().setProperty(UON_whitespaceAware, true).lock();
+ public static final UonParser DEFAULT_WS_AWARE = new UonParser().setWhitespaceAware(true).lock();
// Characters that need to be preceeded with an escape character.
private static final AsciiSet escapedChars = new AsciiSet(",()~=$\u0001\u0002");
@@ -68,7 +67,7 @@ public class UonParser extends ReaderParser {
public static class Decoding extends UonParser {
/** Constructor */
public Decoding() {
- setProperty(UON_decodeChars, true);
+ setDecodeChars(true);
}
}
@@ -719,8 +718,9 @@ public class UonParser extends ReaderParser {
return new UonParserSession(getContext(UonParserContext.class), input);
}
+
//--------------------------------------------------------------------------------
- // Overridden methods
+ // Entry point methods
//--------------------------------------------------------------------------------
@Override /* Parser */
@@ -766,49 +766,460 @@ public class UonParser extends ReaderParser {
return a;
}
+
+ //--------------------------------------------------------------------------------
+ // Properties
+ //--------------------------------------------------------------------------------
+
+ /**
+ * <b>Configuration property:</b> Decode <js>"%xx"</js> sequences.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"UonParser.decodeChars"</js>
+ * <li><b>Data type:</b> <code>Boolean</code>
+ * <li><b>Default:</b> <jk>false</jk> for {@link UonParser}, <jk>true</jk> for {@link UrlEncodingParser}
+ * <li><b>Session-overridable:</b> <jk>true</jk>
+ * </ul>
+ * <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.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>UON_decodeChars</jsf>, value)</code>.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see UonParserContext#UON_decodeChars
+ */
+ public UonParser setDecodeChars(boolean value) throws LockedException {
+ return setProperty(UON_decodeChars, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> Whitespace aware.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"UonParser.whitespaceAware"</js>
+ * <li><b>Data type:</b> <code>Boolean</code>
+ * <li><b>Default:</b> <jk>false</jk>
+ * <li><b>Session-overridable:</b> <jk>true</jk>
+ * </ul>
+ * <p>
+ * Expect input to contain readable whitespace characters from using the {@link UonSerializerContext#UON_useWhitespace} setting.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>UON_whitespaceAware</jsf>, value)</code>.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see UonParserContext#UON_whitespaceAware
+ */
+ public UonParser setWhitespaceAware(boolean value) throws LockedException {
+ return setProperty(UON_whitespaceAware, value);
+ }
+
@Override /* Parser */
- public UonParser setProperty(String property, Object value) throws LockedException {
- super.setProperty(property, value);
+ public UonParser setTrimStrings(boolean value) throws LockedException {
+ super.setTrimStrings(value);
+ return this;
+ }
+
+ @Override /* Parser */
+ public UonParser setStrict(boolean value) throws LockedException {
+ super.setStrict(value);
+ return this;
+ }
+
+ @Override /* Parser */
+ public UonParser setInputStreamCharset(String value) throws LockedException {
+ super.setInputStreamCharset(value);
+ return this;
+ }
+
+ @Override /* Parser */
+ public UonParser setFileCharset(String value) throws LockedException {
+ super.setFileCharset(value);
return this;
}
@Override /* CoreApi */
- public UonParser setProperties(ObjectMap properties) throws LockedException {
- super.setProperties(properties);
+ public UonParser setBeansRequireDefaultConstructor(boolean value) throws LockedException {
+ super.setBeansRequireDefaultConstructor(value);
return this;
}
@Override /* CoreApi */
- public UonParser addNotBeanClasses(Class<?>...classes) throws LockedException {
- super.addNotBeanClasses(classes);
+ public UonParser setBeansRequireSerializable(boolean value) throws LockedException {
+ super.setBeansRequireSerializable(value);
return this;
}
@Override /* CoreApi */
- public UonParser addBeanFilters(Class<?>...classes) throws LockedException {
- super.addBeanFilters(classes);
+ public UonParser setBeansRequireSettersForGetters(boolean value) throws LockedException {
+ super.setBeansRequireSettersForGetters(value);
return this;
}
@Override /* CoreApi */
- public UonParser addPojoSwaps(Class<?>...classes) throws LockedException {
- super.addPojoSwaps(classes);
+ public UonParser setBeansRequireSomeProperties(boolean value) throws LockedException {
+ super.setBeansRequireSomeProperties(value);
return this;
}
@Override /* CoreApi */
- public UonParser addToDictionary(Class<?>...classes) throws LockedException {
- super.addToDictionary(classes);
+ public UonParser setBeanMapPutReturnsOldValue(boolean value) throws LockedException {
+ super.setBeanMapPutReturnsOldValue(value);
return this;
}
@Override /* CoreApi */
- public <T> UonParser addImplClass(Class<T> interfaceClass, Class<? extends T> implClass) throws LockedException {
+ public UonParser setBeanConstructorVisibility(Visibility value) throws LockedException {
+ super.setBeanConstructorVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonParser setBeanClassVisibility(Visibility value) throws LockedException {
+ super.setBeanClassVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonParser setBeanFieldVisibility(Visibility value) throws LockedException {
+ super.setBeanFieldVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonParser setMethodVisibility(Visibility value) throws LockedException {
+ super.setMethodVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonParser setUseJavaBeanIntrospector(boolean value) throws LockedException {
+ super.setUseJavaBeanIntrospector(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonParser setUseInterfaceProxies(boolean value) throws LockedException {
+ super.setUseInterfaceProxies(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonParser setIgnoreUnknownBeanProperties(boolean value) throws LockedException {
+ super.setIgnoreUnknownBeanProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonParser setIgnoreUnknownNullBeanProperties(boolean value) throws LockedException {
+ super.setIgnoreUnknownNullBeanProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonParser setIgnorePropertiesWithoutSetters(boolean value) throws LockedException {
+ super.setIgnorePropertiesWithoutSetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonParser setIgnoreInvocationExceptionsOnGetters(boolean value) throws LockedException {
+ super.setIgnoreInvocationExceptionsOnGetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonParser setIgnoreInvocationExceptionsOnSetters(boolean value) throws LockedException {
+ super.setIgnoreInvocationExceptionsOnSetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonParser setSortProperties(boolean value) throws LockedException {
+ super.setSortProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonParser setNotBeanPackages(String...values) throws LockedException {
+ super.setNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonParser setNotBeanPackages(Collection<String> values) throws LockedException {
+ super.setNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonParser addNotBeanPackages(String...values) throws LockedException {
+ super.addNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonParser addNotBeanPackages(Collection<String> values) throws LockedException {
+ super.addNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonParser removeNotBeanPackages(String...values) throws LockedException {
+ super.removeNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonParser removeNotBeanPackages(Collection<String> values) throws LockedException {
+ super.removeNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonParser setNotBeanClasses(Class<?>...values) throws LockedException {
+ super.setNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonParser setNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ super.setNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonParser addNotBeanClasses(Class<?>...values) throws LockedException {
+ super.addNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonParser addNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ super.addNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonParser removeNotBeanClasses(Class<?>...values) throws LockedException {
+ super.removeNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonParser removeNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ super.removeNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonParser setBeanFilters(Class<?>...values) throws LockedException {
+ super.setBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonParser setBeanFilters(Collection<Class<?>> values) throws LockedException {
+ super.setBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonParser addBeanFilters(Class<?>...values) throws LockedException {
+ super.addBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonParser addBeanFilters(Collection<Class<?>> values) throws LockedException {
+ super.addBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonParser removeBeanFilters(Class<?>...values) throws LockedException {
+ super.removeBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonParser removeBeanFilters(Collection<Class<?>> values) throws LockedException {
+ super.removeBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonParser setPojoSwaps(Class<?>...values) throws LockedException {
+ super.setPojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonParser setPojoSwaps(Collection<Class<?>> values) throws LockedException {
+ super.setPojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonParser addPojoSwaps(Class<?>...values) throws LockedException {
+ super.addPojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonParser addPojoSwaps(Collection<Class<?>> values) throws LockedException {
+ super.addPojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonParser removePojoSwaps(Class<?>...values) throws LockedException {
+ super.removePojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonParser removePojoSwaps(Collection<Class<?>> values) throws LockedException {
+ super.removePojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonParser setImplClasses(Map<Class<?>,Class<?>> values) throws LockedException {
+ super.setImplClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public <T> CoreApi addImplClass(Class<T> interfaceClass, Class<? extends T> implClass) throws LockedException {
super.addImplClass(interfaceClass, implClass);
return this;
}
@Override /* CoreApi */
+ public UonParser setBeanDictionary(Class<?>...values) throws LockedException {
+ super.setBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonParser setBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ super.setBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonParser addToBeanDictionary(Class<?>...values) throws LockedException {
+ super.addToBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonParser addToBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ super.addToBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonParser removeFromBeanDictionary(Class<?>...values) throws LockedException {
+ super.removeFromBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonParser removeFromBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ super.removeFromBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonParser setBeanTypePropertyName(String value) throws LockedException {
+ super.setBeanTypePropertyName(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonParser setDefaultParser(Class<?> value) throws LockedException {
+ super.setDefaultParser(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonParser setLocale(Locale value) throws LockedException {
+ super.setLocale(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonParser setTimeZone(TimeZone value) throws LockedException {
+ super.setTimeZone(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonParser setMediaType(MediaType value) throws LockedException {
+ super.setMediaType(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonParser setDebug(boolean value) throws LockedException {
+ super.setDebug(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonParser setProperty(String name, Object value) throws LockedException {
+ super.setProperty(name, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonParser setProperties(ObjectMap properties) throws LockedException {
+ super.setProperties(properties);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonParser addToProperty(String name, Object value) throws LockedException {
+ super.addToProperty(name, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonParser putToProperty(String name, Object key, Object value) throws LockedException {
+ super.putToProperty(name, key, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonParser putToProperty(String name, Object value) throws LockedException {
+ super.putToProperty(name, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public UonParser removeFromProperty(String name, Object value) throws LockedException {
+ super.removeFromProperty(name, value);
+ return this;
+ }
+
+
+ //--------------------------------------------------------------------------------
+ // Overridden methods
+ //--------------------------------------------------------------------------------
+
+ @Override /* CoreApi */
public UonParser setClassLoader(ClassLoader classLoader) throws LockedException {
super.setClassLoader(classLoader);
return this;
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/urlencoding/UonParserContext.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/urlencoding/UonParserContext.java b/juneau-core/src/main/java/org/apache/juneau/urlencoding/UonParserContext.java
index 144ade5..f1f65bb 100644
--- a/juneau-core/src/main/java/org/apache/juneau/urlencoding/UonParserContext.java
+++ b/juneau-core/src/main/java/org/apache/juneau/urlencoding/UonParserContext.java
@@ -21,38 +21,8 @@ import org.apache.juneau.parser.*;
* Context properties are set by calling {@link ContextFactory#setProperty(String, Object)} on the context factory
* returned {@link CoreApi#getContextFactory()}.
* <p>
- * The following convenience methods are also provided for setting context properties:
- * <ul>
- * <li>{@link UonParser#setProperty(String,Object)}
- * <li>{@link UonParser#setProperties(ObjectMap)}
- * <li>{@link UonParser#addNotBeanClasses(Class[])}
- * <li>{@link UonParser#addBeanFilters(Class[])}
- * <li>{@link UonParser#addPojoSwaps(Class[])}
- * <li>{@link UonParser#addToDictionary(Class[])}
- * <li>{@link UonParser#addImplClass(Class,Class)}
- * </ul>
- * <p>
* See {@link ContextFactory} for more information about context properties.
*
- * <h6 class='topic' id='ConfigProperties'>Configurable properties on the URL-Encoding and UON parsers</h6>
- * <table class='styled' style='border-collapse: collapse;'>
- * <tr><th>Setting name</th><th>Description</th><th>Data type</th><th>Default value</th><th>Session overridable</th></tr>
- * <tr>
- * <td>{@link #UON_decodeChars}</td>
- * <td>Decode <js>"%xx"</js> sequences</td>
- * <td><code>Boolean</code></td>
- * <td><jk>false</jk> for {@link UonParser}<br><jk>true</jk> for {@link UrlEncodingParser}</td>
- * <td><jk>true</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #UON_whitespaceAware}</td>
- * <td>Whitespace aware</td>
- * <td><code>Boolean</code></td>
- * <td><jk>false</jk></td>
- * <td><jk>true</jk></td>
- * </tr>
- * </table>
- *
* <h5 class='section'>Inherited configurable properties:</h5>
* <ul class='javahierarchy'>
* <li class='c'><a class="doclink" href="../BeanContext.html#ConfigProperties">BeanContext</a> - Properties associated with handling beans on serializers and parsers.
[07/14] incubator-juneau git commit: Add convenience property setters
to serializers and parsers.
Posted by ja...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/html/HtmlParser.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/html/HtmlParser.java b/juneau-core/src/main/java/org/apache/juneau/html/HtmlParser.java
index 1242265..decdaad 100644
--- a/juneau-core/src/main/java/org/apache/juneau/html/HtmlParser.java
+++ b/juneau-core/src/main/java/org/apache/juneau/html/HtmlParser.java
@@ -20,9 +20,9 @@ import java.lang.reflect.*;
import java.util.*;
import javax.xml.stream.*;
+import javax.xml.stream.util.*;
import org.apache.juneau.*;
-import org.apache.juneau.MediaType;
import org.apache.juneau.annotation.*;
import org.apache.juneau.json.*;
import org.apache.juneau.parser.*;
@@ -526,7 +526,7 @@ public final class HtmlParser extends XmlParser {
//--------------------------------------------------------------------------------
- // Overridden methods
+ // Entry point methods
//--------------------------------------------------------------------------------
@Override /* Parser */
@@ -558,49 +558,431 @@ public final class HtmlParser extends XmlParser {
return parseArgs(s, s.getXmlStreamReader(), argTypes);
}
+
+ //--------------------------------------------------------------------------------
+ // Properties
+ //--------------------------------------------------------------------------------
+
+ @Override /* XmlParser */
+ public HtmlParser setValidating(boolean value) throws LockedException {
+ super.setValidating(value);
+ return this;
+ }
+
+ @Override /* XmlParser */
+ public HtmlParser setReporter(XMLReporter value) throws LockedException {
+ super.setReporter(value);
+ return this;
+ }
+
+ @Override /* XmlParser */
+ public HtmlParser setResolver(XMLResolver value) throws LockedException {
+ super.setResolver(value);
+ return this;
+ }
+
+ @Override /* XmlParser */
+ public HtmlParser setEventAllocator(XMLEventAllocator value) throws LockedException {
+ super.setEventAllocator(value);
+ return this;
+ }
+
+ @Override /* Parser */
+ public HtmlParser setTrimStrings(boolean value) throws LockedException {
+ super.setTrimStrings(value);
+ return this;
+ }
+
+ @Override /* Parser */
+ public HtmlParser setStrict(boolean value) throws LockedException {
+ super.setStrict(value);
+ return this;
+ }
+
+ @Override /* Parser */
+ public HtmlParser setInputStreamCharset(String value) throws LockedException {
+ super.setInputStreamCharset(value);
+ return this;
+ }
+
+ @Override /* Parser */
+ public HtmlParser setFileCharset(String value) throws LockedException {
+ super.setFileCharset(value);
+ return this;
+ }
+
@Override /* CoreApi */
- public HtmlParser setProperty(String property, Object value) throws LockedException {
- super.setProperty(property, value);
+ public HtmlParser setBeansRequireDefaultConstructor(boolean value) throws LockedException {
+ super.setBeansRequireDefaultConstructor(value);
return this;
}
@Override /* CoreApi */
- public HtmlParser setProperties(ObjectMap properties) throws LockedException {
- super.setProperties(properties);
+ public HtmlParser setBeansRequireSerializable(boolean value) throws LockedException {
+ super.setBeansRequireSerializable(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlParser setBeansRequireSettersForGetters(boolean value) throws LockedException {
+ super.setBeansRequireSettersForGetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlParser setBeansRequireSomeProperties(boolean value) throws LockedException {
+ super.setBeansRequireSomeProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlParser setBeanMapPutReturnsOldValue(boolean value) throws LockedException {
+ super.setBeanMapPutReturnsOldValue(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlParser setBeanConstructorVisibility(Visibility value) throws LockedException {
+ super.setBeanConstructorVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlParser setBeanClassVisibility(Visibility value) throws LockedException {
+ super.setBeanClassVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlParser setBeanFieldVisibility(Visibility value) throws LockedException {
+ super.setBeanFieldVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlParser setMethodVisibility(Visibility value) throws LockedException {
+ super.setMethodVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlParser setUseJavaBeanIntrospector(boolean value) throws LockedException {
+ super.setUseJavaBeanIntrospector(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlParser setUseInterfaceProxies(boolean value) throws LockedException {
+ super.setUseInterfaceProxies(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlParser setIgnoreUnknownBeanProperties(boolean value) throws LockedException {
+ super.setIgnoreUnknownBeanProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlParser setIgnoreUnknownNullBeanProperties(boolean value) throws LockedException {
+ super.setIgnoreUnknownNullBeanProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlParser setIgnorePropertiesWithoutSetters(boolean value) throws LockedException {
+ super.setIgnorePropertiesWithoutSetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlParser setIgnoreInvocationExceptionsOnGetters(boolean value) throws LockedException {
+ super.setIgnoreInvocationExceptionsOnGetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlParser setIgnoreInvocationExceptionsOnSetters(boolean value) throws LockedException {
+ super.setIgnoreInvocationExceptionsOnSetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlParser setSortProperties(boolean value) throws LockedException {
+ super.setSortProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlParser setNotBeanPackages(String...values) throws LockedException {
+ super.setNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlParser setNotBeanPackages(Collection<String> values) throws LockedException {
+ super.setNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlParser addNotBeanPackages(String...values) throws LockedException {
+ super.addNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlParser addNotBeanPackages(Collection<String> values) throws LockedException {
+ super.addNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlParser removeNotBeanPackages(String...values) throws LockedException {
+ super.removeNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlParser removeNotBeanPackages(Collection<String> values) throws LockedException {
+ super.removeNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlParser setNotBeanClasses(Class<?>...values) throws LockedException {
+ super.setNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlParser setNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ super.setNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlParser addNotBeanClasses(Class<?>...values) throws LockedException {
+ super.addNotBeanClasses(values);
return this;
}
@Override /* CoreApi */
- public HtmlParser addNotBeanClasses(Class<?>...classes) throws LockedException {
- super.addNotBeanClasses(classes);
+ public HtmlParser addNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ super.addNotBeanClasses(values);
return this;
}
@Override /* CoreApi */
- public HtmlParser addBeanFilters(Class<?>...classes) throws LockedException {
- super.addBeanFilters(classes);
+ public HtmlParser removeNotBeanClasses(Class<?>...values) throws LockedException {
+ super.removeNotBeanClasses(values);
return this;
}
@Override /* CoreApi */
- public HtmlParser addPojoSwaps(Class<?>...classes) throws LockedException {
- super.addPojoSwaps(classes);
+ public HtmlParser removeNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ super.removeNotBeanClasses(values);
return this;
}
@Override /* CoreApi */
- public HtmlParser addToDictionary(Class<?>...classes) throws LockedException {
- super.addToDictionary(classes);
+ public HtmlParser setBeanFilters(Class<?>...values) throws LockedException {
+ super.setBeanFilters(values);
return this;
}
@Override /* CoreApi */
- public <T> HtmlParser addImplClass(Class<T> interfaceClass, Class<? extends T> implClass) throws LockedException {
+ public HtmlParser setBeanFilters(Collection<Class<?>> values) throws LockedException {
+ super.setBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlParser addBeanFilters(Class<?>...values) throws LockedException {
+ super.addBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlParser addBeanFilters(Collection<Class<?>> values) throws LockedException {
+ super.addBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlParser removeBeanFilters(Class<?>...values) throws LockedException {
+ super.removeBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlParser removeBeanFilters(Collection<Class<?>> values) throws LockedException {
+ super.removeBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlParser setPojoSwaps(Class<?>...values) throws LockedException {
+ super.setPojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlParser setPojoSwaps(Collection<Class<?>> values) throws LockedException {
+ super.setPojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlParser addPojoSwaps(Class<?>...values) throws LockedException {
+ super.addPojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlParser addPojoSwaps(Collection<Class<?>> values) throws LockedException {
+ super.addPojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlParser removePojoSwaps(Class<?>...values) throws LockedException {
+ super.removePojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlParser removePojoSwaps(Collection<Class<?>> values) throws LockedException {
+ super.removePojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlParser setImplClasses(Map<Class<?>,Class<?>> values) throws LockedException {
+ super.setImplClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public <T> CoreApi addImplClass(Class<T> interfaceClass, Class<? extends T> implClass) throws LockedException {
super.addImplClass(interfaceClass, implClass);
return this;
}
@Override /* CoreApi */
+ public HtmlParser setBeanDictionary(Class<?>...values) throws LockedException {
+ super.setBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlParser setBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ super.setBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlParser addToBeanDictionary(Class<?>...values) throws LockedException {
+ super.addToBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlParser addToBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ super.addToBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlParser removeFromBeanDictionary(Class<?>...values) throws LockedException {
+ super.removeFromBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlParser removeFromBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ super.removeFromBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlParser setBeanTypePropertyName(String value) throws LockedException {
+ super.setBeanTypePropertyName(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlParser setDefaultParser(Class<?> value) throws LockedException {
+ super.setDefaultParser(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlParser setLocale(Locale value) throws LockedException {
+ super.setLocale(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlParser setTimeZone(TimeZone value) throws LockedException {
+ super.setTimeZone(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlParser setMediaType(MediaType value) throws LockedException {
+ super.setMediaType(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlParser setDebug(boolean value) throws LockedException {
+ super.setDebug(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlParser setProperty(String name, Object value) throws LockedException {
+ super.setProperty(name, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlParser setProperties(ObjectMap properties) throws LockedException {
+ super.setProperties(properties);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlParser addToProperty(String name, Object value) throws LockedException {
+ super.addToProperty(name, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlParser putToProperty(String name, Object key, Object value) throws LockedException {
+ super.putToProperty(name, key, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlParser putToProperty(String name, Object value) throws LockedException {
+ super.putToProperty(name, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlParser removeFromProperty(String name, Object value) throws LockedException {
+ super.removeFromProperty(name, value);
+ return this;
+ }
+
+
+ //--------------------------------------------------------------------------------
+ // Overridden methods
+ //--------------------------------------------------------------------------------
+
+ @Override /* CoreApi */
public HtmlParser setClassLoader(ClassLoader classLoader) throws LockedException {
super.setClassLoader(classLoader);
return this;
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/html/HtmlParserContext.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/html/HtmlParserContext.java b/juneau-core/src/main/java/org/apache/juneau/html/HtmlParserContext.java
index 2a1eca6..8ea06a2 100644
--- a/juneau-core/src/main/java/org/apache/juneau/html/HtmlParserContext.java
+++ b/juneau-core/src/main/java/org/apache/juneau/html/HtmlParserContext.java
@@ -21,23 +21,8 @@ import org.apache.juneau.xml.*;
* Context properties are set by calling {@link ContextFactory#setProperty(String, Object)} on the context factory
* returned {@link CoreApi#getContextFactory()}.
* <p>
- * The following convenience methods are also provided for setting context properties:
- * <ul>
- * <li>{@link HtmlParser#setProperty(String,Object)}
- * <li>{@link HtmlParser#setProperties(ObjectMap)}
- * <li>{@link HtmlParser#addNotBeanClasses(Class[])}
- * <li>{@link HtmlParser#addBeanFilters(Class[])}
- * <li>{@link HtmlParser#addPojoSwaps(Class[])}
- * <li>{@link HtmlParser#addToDictionary(Class[])}
- * <li>{@link HtmlParser#addImplClass(Class,Class)}
- * </ul>
- * <p>
* See {@link ContextFactory} for more information about context properties.
*
- * <h6 class='topic' id='ConfigProperties'>Configurable properties on the HTML parser</h6>
- * <p>
- * None.
- *
* <h5 class='section'>Inherited configurable properties:</h5>
* <ul class='javahierarchy'>
* <li class='c'><a class="doclink" href="../BeanContext.html#ConfigProperties">BeanContext</a> - Properties associated with handling beans on serializers and parsers.
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/html/HtmlSchemaDocSerializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/html/HtmlSchemaDocSerializer.java b/juneau-core/src/main/java/org/apache/juneau/html/HtmlSchemaDocSerializer.java
index 4d46043..f5b2fa4 100644
--- a/juneau-core/src/main/java/org/apache/juneau/html/HtmlSchemaDocSerializer.java
+++ b/juneau-core/src/main/java/org/apache/juneau/html/HtmlSchemaDocSerializer.java
@@ -13,7 +13,6 @@
package org.apache.juneau.html;
import static org.apache.juneau.internal.ClassUtils.*;
-import static org.apache.juneau.serializer.SerializerContext.*;
import java.lang.reflect.*;
import java.util.*;
@@ -49,8 +48,8 @@ public final class HtmlSchemaDocSerializer extends HtmlDocSerializer {
* Constructor.
*/
public HtmlSchemaDocSerializer() {
- setProperty(SERIALIZER_detectRecursions, true);
- setProperty(SERIALIZER_ignoreRecursions, true);
+ setDetectRecursions(true);
+ setIgnoreRecursions(true);
}
/**
@@ -60,8 +59,8 @@ public final class HtmlSchemaDocSerializer extends HtmlDocSerializer {
*/
public HtmlSchemaDocSerializer(ContextFactory cf) {
getContextFactory().copyFrom(cf);
- setProperty(SERIALIZER_detectRecursions, true);
- setProperty(SERIALIZER_ignoreRecursions, true);
+ setDetectRecursions(true);
+ setIgnoreRecursions(true);
}
@Override /* Serializer */
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/html/HtmlSerializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/html/HtmlSerializer.java b/juneau-core/src/main/java/org/apache/juneau/html/HtmlSerializer.java
index 996333b..d462732 100644
--- a/juneau-core/src/main/java/org/apache/juneau/html/HtmlSerializer.java
+++ b/juneau-core/src/main/java/org/apache/juneau/html/HtmlSerializer.java
@@ -12,8 +12,8 @@
// ***************************************************************************************************************************
package org.apache.juneau.html;
-import static org.apache.juneau.serializer.SerializerContext.*;
import static org.apache.juneau.html.HtmlSerializer.ContentResult.*;
+import static org.apache.juneau.html.HtmlSerializerContext.*;
import java.io.*;
import java.lang.reflect.*;
@@ -72,11 +72,11 @@ import org.apache.juneau.xml.annotation.*;
*
* <jc>// Create a custom serializer that doesn't use whitespace and newlines</jc>
* HtmlSerializer serializer = <jk>new</jk> HtmlSerializer()
- * .setProperty(SerializerContext.<jsf>SERIALIZER_useIndentation</jsf>, <jk>false</jk>);
+ * .setUseIndentation(<jk>false</jk>);
*
* <jc>// Same as above, except uses cloning</jc>
* HtmlSerializer serializer = HtmlSerializer.<jsf>DEFAULT</jsf>.clone()
- * .setProperty(SerializerContext.<jsf>SERIALIZER_useIndentation</jsf>, <jk>false</jk>);
+ * .setUseIndentation(<jk>false</jk>);
*
* <jc>// Serialize POJOs to HTML</jc>
*
@@ -144,7 +144,7 @@ public class HtmlSerializer extends XmlSerializer {
public static class Sq extends HtmlSerializer {
/** Constructor */
public Sq() {
- setProperty(SERIALIZER_quoteChar, '\'');
+ setQuoteChar('\'');
}
}
@@ -152,7 +152,7 @@ public class HtmlSerializer extends XmlSerializer {
public static class SqReadable extends Sq {
/** Constructor */
public SqReadable() {
- setProperty(SERIALIZER_useIndentation, true);
+ setUseIndentation(true);
}
}
@@ -641,8 +641,9 @@ public class HtmlSerializer extends XmlSerializer {
}
}
+
//--------------------------------------------------------------------------------
- // Overridden methods
+ // Entry point methods
//--------------------------------------------------------------------------------
@Override /* Serializer */
@@ -656,49 +657,617 @@ public class HtmlSerializer extends XmlSerializer {
doSerialize(s, o, s.getWriter());
}
+
+ //--------------------------------------------------------------------------------
+ // Properties
+ //--------------------------------------------------------------------------------
+
+ /**
+ * <b>Configuration property:</b> Anchor text source.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"HtmlSerializer.uriAnchorText"</js>
+ * <li><b>Data type:</b> <code>String</code>
+ * <li><b>Default:</b> <js>"toString"</js>
+ * <li><b>Session-overridable:</b> <jk>true</jk>
+ * </ul>
+ * <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.
+ * <p>
+ * Possible values:
+ * <ul class='spaced-list'>
+ * <li>{@link HtmlSerializerContext#TO_STRING} / <js>"toString"</js> - Set to whatever is returned by {@link #toString()} on the object.
+ * <li>{@link HtmlSerializerContext#URI} / <js>"uri"</js> - Set to the URI value.
+ * <li>{@link HtmlSerializerContext#LAST_TOKEN} / <js>"lastToken"</js> - Set to the last token of the URI value.
+ * <li>{@link HtmlSerializerContext#PROPERTY_NAME} / <js>"propertyName"</js> - Set to the bean property name.
+ * <li>{@link HtmlSerializerContext#URI_ANCHOR} / <js>"uriAnchor"</js> - Set to the anchor of the URL. (e.g. <js>"http://localhost:9080/foobar#anchorTextHere"</js>)
+ * </ul>
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>HTML_uriAnchorText</jsf>, value)</code>.
+ * <li>This introduces a slight performance penalty.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see HtmlSerializerContext#HTML_uriAnchorText
+ */
+ public HtmlSerializer setUriAnchorText(String value) throws LockedException {
+ return setProperty(HTML_uriAnchorText, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> Look for URLs in {@link String Strings}.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"HtmlSerializer.detectLinksInStrings"</js>
+ * <li><b>Data type:</b> <code>Boolean</code>
+ * <li><b>Default:</b> <jk>true</jk>
+ * <li><b>Session-overridable:</b> <jk>true</jk>
+ * </ul>
+ * <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 HtmlSerializerContext#HTML_uriAnchorText}.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>HTML_detectLinksInStrings</jsf>, value)</code>.
+ * <li>This introduces a slight performance penalty.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see HtmlSerializerContext#HTML_detectLinksInStrings
+ */
+ public HtmlSerializer setDetectLinksInStrings(boolean value) throws LockedException {
+ return setProperty(HTML_detectLinksInStrings, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> Look for link labels in the <js>"label"</js> parameter of the URL.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"HtmlSerializer.lookForLabelParameters"</js>
+ * <li><b>Data type:</b> <code>Boolean</code>
+ * <li><b>Default:</b> <jk>true</jk>
+ * <li><b>Session-overridable:</b> <jk>true</jk>
+ * </ul>
+ * <p>
+ * If the URL has a label parameter (e.g. <js>"?label=foobar"</js>), then use that as the anchor text of the link.
+ * <p>
+ * The parameter name can be changed via the {@link HtmlSerializerContext#HTML_labelParameter} property.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>HTML_lookForLabelParameters</jsf>, value)</code>.
+ * <li>This introduces a slight performance penalty.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see HtmlSerializerContext#HTML_lookForLabelParameters
+ */
+ public HtmlSerializer setLookForLabelParameters(boolean value) throws LockedException {
+ return setProperty(HTML_lookForLabelParameters, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> The parameter name to use when using {@link HtmlSerializerContext#HTML_lookForLabelParameters}.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"HtmlSerializer.labelParameter"</js>
+ * <li><b>Data type:</b> <code>String</code>
+ * <li><b>Default:</b> <js>"label"</js>
+ * <li><b>Session-overridable:</b> <jk>true</jk>
+ * </ul>
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>HTML_labelParameter</jsf>, value)</code>.
+ * <li>This introduces a slight performance penalty.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see HtmlSerializerContext#HTML_labelParameter
+ */
+ public HtmlSerializer setLabelParameter(String value) throws LockedException {
+ return setProperty(HTML_labelParameter, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> Add key/value headers on bean/map tables.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"HtmlSerializer.addKeyValueTableHeaders"</js>
+ * <li><b>Data type:</b> <code>Boolean</code>
+ * <li><b>Default:</b> <jk>false</jk>
+ * <li><b>Session-overridable:</b> <jk>true</jk>
+ * </ul>
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>HTML_addKeyValueTableHeaders</jsf>, value)</code>.
+ * <li>This introduces a slight performance penalty.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see HtmlSerializerContext#HTML_addKeyValueTableHeaders
+ */
+ public HtmlSerializer setAddKeyValueTableHeaders(boolean value) throws LockedException {
+ return setProperty(HTML_addKeyValueTableHeaders, value);
+ }
+
+ @Override /* Serializer */
+ public HtmlSerializer setMaxDepth(int value) throws LockedException {
+ super.setMaxDepth(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public HtmlSerializer setInitialDepth(int value) throws LockedException {
+ super.setInitialDepth(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public HtmlSerializer setDetectRecursions(boolean value) throws LockedException {
+ super.setDetectRecursions(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public HtmlSerializer setIgnoreRecursions(boolean value) throws LockedException {
+ super.setIgnoreRecursions(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public HtmlSerializer setUseIndentation(boolean value) throws LockedException {
+ super.setUseIndentation(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public HtmlSerializer setAddBeanTypeProperties(boolean value) throws LockedException {
+ super.setAddBeanTypeProperties(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public HtmlSerializer setQuoteChar(char value) throws LockedException {
+ super.setQuoteChar(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public HtmlSerializer setTrimNullProperties(boolean value) throws LockedException {
+ super.setTrimNullProperties(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public HtmlSerializer setTrimEmptyCollections(boolean value) throws LockedException {
+ super.setTrimEmptyCollections(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public HtmlSerializer setTrimEmptyMaps(boolean value) throws LockedException {
+ super.setTrimEmptyMaps(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public HtmlSerializer setTrimStrings(boolean value) throws LockedException {
+ super.setTrimStrings(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public HtmlSerializer setRelativeUriBase(String value) throws LockedException {
+ super.setRelativeUriBase(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public HtmlSerializer setAbsolutePathUriBase(String value) throws LockedException {
+ super.setAbsolutePathUriBase(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public HtmlSerializer setSortCollections(boolean value) throws LockedException {
+ super.setSortCollections(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public HtmlSerializer setSortMaps(boolean value) throws LockedException {
+ super.setSortMaps(value);
+ return this;
+ }
+
@Override /* CoreApi */
- public HtmlSerializer setProperty(String property, Object value) throws LockedException {
- super.setProperty(property, value);
+ public HtmlSerializer setBeansRequireDefaultConstructor(boolean value) throws LockedException {
+ super.setBeansRequireDefaultConstructor(value);
return this;
}
@Override /* CoreApi */
- public HtmlSerializer setProperties(ObjectMap properties) throws LockedException {
- super.setProperties(properties);
+ public HtmlSerializer setBeansRequireSerializable(boolean value) throws LockedException {
+ super.setBeansRequireSerializable(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlSerializer setBeansRequireSettersForGetters(boolean value) throws LockedException {
+ super.setBeansRequireSettersForGetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlSerializer setBeansRequireSomeProperties(boolean value) throws LockedException {
+ super.setBeansRequireSomeProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlSerializer setBeanMapPutReturnsOldValue(boolean value) throws LockedException {
+ super.setBeanMapPutReturnsOldValue(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlSerializer setBeanConstructorVisibility(Visibility value) throws LockedException {
+ super.setBeanConstructorVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlSerializer setBeanClassVisibility(Visibility value) throws LockedException {
+ super.setBeanClassVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlSerializer setBeanFieldVisibility(Visibility value) throws LockedException {
+ super.setBeanFieldVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlSerializer setMethodVisibility(Visibility value) throws LockedException {
+ super.setMethodVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlSerializer setUseJavaBeanIntrospector(boolean value) throws LockedException {
+ super.setUseJavaBeanIntrospector(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlSerializer setUseInterfaceProxies(boolean value) throws LockedException {
+ super.setUseInterfaceProxies(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlSerializer setIgnoreUnknownBeanProperties(boolean value) throws LockedException {
+ super.setIgnoreUnknownBeanProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlSerializer setIgnoreUnknownNullBeanProperties(boolean value) throws LockedException {
+ super.setIgnoreUnknownNullBeanProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlSerializer setIgnorePropertiesWithoutSetters(boolean value) throws LockedException {
+ super.setIgnorePropertiesWithoutSetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlSerializer setIgnoreInvocationExceptionsOnGetters(boolean value) throws LockedException {
+ super.setIgnoreInvocationExceptionsOnGetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlSerializer setIgnoreInvocationExceptionsOnSetters(boolean value) throws LockedException {
+ super.setIgnoreInvocationExceptionsOnSetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlSerializer setSortProperties(boolean value) throws LockedException {
+ super.setSortProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlSerializer setNotBeanPackages(String...values) throws LockedException {
+ super.setNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlSerializer setNotBeanPackages(Collection<String> values) throws LockedException {
+ super.setNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlSerializer addNotBeanPackages(String...values) throws LockedException {
+ super.addNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlSerializer addNotBeanPackages(Collection<String> values) throws LockedException {
+ super.addNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlSerializer removeNotBeanPackages(String...values) throws LockedException {
+ super.removeNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlSerializer removeNotBeanPackages(Collection<String> values) throws LockedException {
+ super.removeNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlSerializer setNotBeanClasses(Class<?>...values) throws LockedException {
+ super.setNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlSerializer setNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ super.setNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlSerializer addNotBeanClasses(Class<?>...values) throws LockedException {
+ super.addNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlSerializer addNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ super.addNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlSerializer removeNotBeanClasses(Class<?>...values) throws LockedException {
+ super.removeNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlSerializer removeNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ super.removeNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlSerializer setBeanFilters(Class<?>...values) throws LockedException {
+ super.setBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlSerializer setBeanFilters(Collection<Class<?>> values) throws LockedException {
+ super.setBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlSerializer addBeanFilters(Class<?>...values) throws LockedException {
+ super.addBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlSerializer addBeanFilters(Collection<Class<?>> values) throws LockedException {
+ super.addBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlSerializer removeBeanFilters(Class<?>...values) throws LockedException {
+ super.removeBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlSerializer removeBeanFilters(Collection<Class<?>> values) throws LockedException {
+ super.removeBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlSerializer setPojoSwaps(Class<?>...values) throws LockedException {
+ super.setPojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlSerializer setPojoSwaps(Collection<Class<?>> values) throws LockedException {
+ super.setPojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlSerializer addPojoSwaps(Class<?>...values) throws LockedException {
+ super.addPojoSwaps(values);
return this;
}
@Override /* CoreApi */
- public HtmlSerializer addNotBeanClasses(Class<?>...classes) throws LockedException {
- super.addNotBeanClasses(classes);
+ public HtmlSerializer addPojoSwaps(Collection<Class<?>> values) throws LockedException {
+ super.addPojoSwaps(values);
return this;
}
@Override /* CoreApi */
- public HtmlSerializer addBeanFilters(Class<?>...classes) throws LockedException {
- super.addBeanFilters(classes);
+ public HtmlSerializer removePojoSwaps(Class<?>...values) throws LockedException {
+ super.removePojoSwaps(values);
return this;
}
@Override /* CoreApi */
- public HtmlSerializer addPojoSwaps(Class<?>...classes) throws LockedException {
- super.addPojoSwaps(classes);
+ public HtmlSerializer removePojoSwaps(Collection<Class<?>> values) throws LockedException {
+ super.removePojoSwaps(values);
return this;
}
@Override /* CoreApi */
- public HtmlSerializer addToDictionary(Class<?>...classes) throws LockedException {
- super.addToDictionary(classes);
+ public HtmlSerializer setImplClasses(Map<Class<?>,Class<?>> values) throws LockedException {
+ super.setImplClasses(values);
return this;
}
@Override /* CoreApi */
- public <T> HtmlSerializer addImplClass(Class<T> interfaceClass, Class<? extends T> implClass) throws LockedException {
+ public <T> CoreApi addImplClass(Class<T> interfaceClass, Class<? extends T> implClass) throws LockedException {
super.addImplClass(interfaceClass, implClass);
return this;
}
@Override /* CoreApi */
+ public HtmlSerializer setBeanDictionary(Class<?>...values) throws LockedException {
+ super.setBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlSerializer setBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ super.setBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlSerializer addToBeanDictionary(Class<?>...values) throws LockedException {
+ super.addToBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlSerializer addToBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ super.addToBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlSerializer removeFromBeanDictionary(Class<?>...values) throws LockedException {
+ super.removeFromBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlSerializer removeFromBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ super.removeFromBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlSerializer setBeanTypePropertyName(String value) throws LockedException {
+ super.setBeanTypePropertyName(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlSerializer setDefaultParser(Class<?> value) throws LockedException {
+ super.setDefaultParser(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlSerializer setLocale(Locale value) throws LockedException {
+ super.setLocale(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlSerializer setTimeZone(TimeZone value) throws LockedException {
+ super.setTimeZone(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlSerializer setMediaType(MediaType value) throws LockedException {
+ super.setMediaType(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlSerializer setDebug(boolean value) throws LockedException {
+ super.setDebug(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlSerializer setProperty(String name, Object value) throws LockedException {
+ super.setProperty(name, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlSerializer setProperties(ObjectMap properties) throws LockedException {
+ super.setProperties(properties);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlSerializer addToProperty(String name, Object value) throws LockedException {
+ super.addToProperty(name, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlSerializer putToProperty(String name, Object key, Object value) throws LockedException {
+ super.putToProperty(name, key, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlSerializer putToProperty(String name, Object value) throws LockedException {
+ super.putToProperty(name, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlSerializer removeFromProperty(String name, Object value) throws LockedException {
+ super.removeFromProperty(name, value);
+ return this;
+ }
+
+
+ //--------------------------------------------------------------------------------
+ // Overridden methods
+ //--------------------------------------------------------------------------------
+
+ @Override /* CoreApi */
public HtmlSerializer setClassLoader(ClassLoader classLoader) throws LockedException {
super.setClassLoader(classLoader);
return this;
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/html/HtmlSerializerContext.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/html/HtmlSerializerContext.java b/juneau-core/src/main/java/org/apache/juneau/html/HtmlSerializerContext.java
index 2179a5e..b15271a 100644
--- a/juneau-core/src/main/java/org/apache/juneau/html/HtmlSerializerContext.java
+++ b/juneau-core/src/main/java/org/apache/juneau/html/HtmlSerializerContext.java
@@ -21,52 +21,8 @@ import org.apache.juneau.xml.*;
* Context properties are set by calling {@link ContextFactory#setProperty(String, Object)} on the context factory
* returned {@link CoreApi#getContextFactory()}.
* <p>
- * The following convenience methods are also provided for setting context properties:
- * <ul>
- * <li>{@link HtmlSerializer#setProperty(String,Object)}
- * <li>{@link HtmlSerializer#setProperties(ObjectMap)}
- * <li>{@link HtmlSerializer#addNotBeanClasses(Class[])}
- * <li>{@link HtmlSerializer#addBeanFilters(Class[])}
- * <li>{@link HtmlSerializer#addPojoSwaps(Class[])}
- * <li>{@link HtmlSerializer#addToDictionary(Class[])}
- * <li>{@link HtmlSerializer#addImplClass(Class,Class)}
- * </ul>
- * <p>
* See {@link ContextFactory} for more information about context properties.
*
- * <h6 class='topic' id='ConfigProperties'>Configurable properties on the HTML serializer</h6>
- * <table class='styled' style='border-collapse: collapse;'>
- * <tr><th>Setting name</th><th>Description</th><th>Data type</th><th>Default value</th><th>Session overridable</th></tr>
- * <tr>
- * <td>{@link #HTML_uriAnchorText}</td>
- * <td>Anchor text source.</td>
- * <td><code>String</code></td>
- * <td><js>"TO_STRING"</js></td>
- * <td><jk>true</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #HTML_detectLinksInStrings}</td>
- * <td>Look for URLs in {@link String Strings}.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>true</jk></td>
- * <td><jk>true</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #HTML_lookForLabelParameters}</td>
- * <td>Look for link labels in the <js>"label"</js> parameter of the URL.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>true</jk></td>
- * <td><jk>true</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #HTML_labelParameter}</td>
- * <td>The parameter name to use when using {@link #HTML_lookForLabelParameters}.</td>
- * <td><code>String</code></td>
- * <td><js>"label"</js></td>
- * <td><jk>true</jk></td>
- * </tr>
- * </table>
- *
* <h5 class='section'>Inherited configurable properties:</h5>
* <ul class='javahierarchy'>
* <li class='c'><a class="doclink" href="../BeanContext.html#ConfigProperties">BeanContext</a> - Properties associated with handling beans on serializers and parsers.
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/ini/ConfigFileImpl.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/ini/ConfigFileImpl.java b/juneau-core/src/main/java/org/apache/juneau/ini/ConfigFileImpl.java
index 653e515..e215aa4 100644
--- a/juneau-core/src/main/java/org/apache/juneau/ini/ConfigFileImpl.java
+++ b/juneau-core/src/main/java/org/apache/juneau/ini/ConfigFileImpl.java
@@ -193,6 +193,7 @@ public final class ConfigFileImpl extends ConfigFile {
return this;
}
+
//--------------------------------------------------------------------------------
// Map methods
//--------------------------------------------------------------------------------
@@ -412,6 +413,7 @@ public final class ConfigFileImpl extends ConfigFile {
}
}
+
//--------------------------------------------------------------------------------
// API methods
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/ini/Section.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/ini/Section.java b/juneau-core/src/main/java/org/apache/juneau/ini/Section.java
index 3050084..d75404b 100644
--- a/juneau-core/src/main/java/org/apache/juneau/ini/Section.java
+++ b/juneau-core/src/main/java/org/apache/juneau/ini/Section.java
@@ -86,6 +86,7 @@ public class Section implements Map<String,String> {
return this;
}
+
//--------------------------------------------------------------------------------
// Map methods
//--------------------------------------------------------------------------------
@@ -302,6 +303,7 @@ public class Section implements Map<String,String> {
return Collections.unmodifiableCollection(entries.values());
}
+
//--------------------------------------------------------------------------------
// API methods
//--------------------------------------------------------------------------------
@@ -453,6 +455,7 @@ public class Section implements Map<String,String> {
}
}
+
//--------------------------------------------------------------------------------
// Protected methods used by ConfigFile
//--------------------------------------------------------------------------------
@@ -512,6 +515,7 @@ public class Section implements Map<String,String> {
return l;
}
+
//--------------------------------------------------------------------------------
// Private methods
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/internal/ClassUtils.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/internal/ClassUtils.java b/juneau-core/src/main/java/org/apache/juneau/internal/ClassUtils.java
index cc4b2a2..088d70a 100644
--- a/juneau-core/src/main/java/org/apache/juneau/internal/ClassUtils.java
+++ b/juneau-core/src/main/java/org/apache/juneau/internal/ClassUtils.java
@@ -425,4 +425,113 @@ public final class ClassUtils {
}
}
}
+
+// This code is inherently unsafe (but still potentially useful?)
+//
+// /**
+// * Converts class name strings to ClassMeta objects.
+// *
+// * <h5 class='section'>Example:</h5>
+// * <ul>
+// * <li><js>"java.lang.String"</js>
+// * <li><js>"com.foo.sample.MyBean[]"</js>
+// * <li><js>"java.util.HashMap<java.lang.String,java.lang.Integer>"</js>
+// * <li><js>"[Ljava.lang.String;"</js> (i.e. the value of <code>String[].<jk>class</jk>.getName()</code>)
+// * </ul>
+// *
+// * @param s The class name.
+// * @return The ClassMeta corresponding to the class name string.
+// */
+// protected final ClassMeta<?> getClassMetaFromString(String s) {
+// int d = 0;
+// if (s == null || s.isEmpty())
+// return null;
+//
+// // Check for Class.getName() on array class types.
+// if (s.charAt(0) == '[') {
+// try {
+// return getClassMeta(findClass(s));
+// } catch (ClassNotFoundException e) {
+// throw new RuntimeException(e);
+// }
+// }
+//
+// int i1 = 0;
+// int i2 = 0;
+// int dim = 0;
+// List<ClassMeta<?>> p = null;
+// for (int i = 0; i < s.length(); i++) {
+// char c = s.charAt(i);
+// if (c == '<') {
+// if (d == 0) {
+// i1 = i;
+// i2 = i+1;
+// p = new LinkedList<ClassMeta<?>>();
+// }
+// d++;
+// } else if (c == '>') {
+// d--;
+// if (d == 0 && p != null)
+// p.add(getClassMetaFromString(s.substring(i2, i)));
+// } else if (c == ',' && d == 1) {
+// if (p != null)
+// p.add(getClassMetaFromString(s.substring(i2, i)));
+// i2 = i+1;
+// }
+// if (c == '[') {
+// if (i1 == 0)
+// i1 = i;
+// dim++;
+// }
+// }
+// if (i1 == 0)
+// i1 = s.length();
+// try {
+// String name = s.substring(0, i1).trim();
+// char x = name.charAt(0);
+// Class<?> c = null;
+// if (x >= 'b' && x <= 's') {
+// if (x == 'b' && name.equals("boolean"))
+// c = boolean.class;
+// else if (x == 'b' && name.equals("byte"))
+// c = byte.class;
+// else if (x == 'c' && name.equals("char"))
+// c = char.class;
+// else if (x == 'd' && name.equals("double"))
+// c = double.class;
+// else if (x == 'i' && name.equals("int"))
+// c = int.class;
+// else if (x == 'l' && name.equals("long"))
+// c = long.class;
+// else if (x == 's' && name.equals("short"))
+// c = short.class;
+// else
+// c = findClass(name);
+// } else {
+// c = findClass(name);
+// }
+//
+// ClassMeta<?> cm = getClassMeta(c);
+//
+// if (p != null) {
+// if (cm.isMap())
+// cm = new ClassMeta(c, this).setKeyType(p.get(0)).setValueType(p.get(1));
+// if (cm.isCollection())
+// cm = new ClassMeta(c, this).setElementType(p.get(0));
+// }
+//
+// while (dim > 0) {
+// cm = new ClassMeta(Array.newInstance(cm.getInnerClass(), 0).getClass(), this);
+// dim--;
+// }
+//
+// return cm;
+// } catch (ClassNotFoundException e) {
+// throw new RuntimeException(e);
+// }
+// }
+//
+// private Class<?> findClass(String name) throws ClassNotFoundException {
+// return classLoader == null ? Class.forName(name) : Class.forName(name, true, classLoader);
+// }
}
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/internal/Version.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/internal/Version.java b/juneau-core/src/main/java/org/apache/juneau/internal/Version.java
index 6836659..33530c7 100644
--- a/juneau-core/src/main/java/org/apache/juneau/internal/Version.java
+++ b/juneau-core/src/main/java/org/apache/juneau/internal/Version.java
@@ -26,7 +26,7 @@ public class Version {
/**
* Constructor
*
- * @param versionString - A string of the form <js>"#.#..."</js> where there can be any number of parts.
+ * @param versionString A string of the form <js>"#.#..."</js> where there can be any number of parts.
* <br>Valid values:
* <ul>
* <li><js>"1.2"</js>
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/json/JsonParser.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/json/JsonParser.java b/juneau-core/src/main/java/org/apache/juneau/json/JsonParser.java
index 0086a78..a897d1a 100644
--- a/juneau-core/src/main/java/org/apache/juneau/json/JsonParser.java
+++ b/juneau-core/src/main/java/org/apache/juneau/json/JsonParser.java
@@ -12,14 +12,11 @@
// ***************************************************************************************************************************
package org.apache.juneau.json;
-import static org.apache.juneau.json.JsonParserContext.*;
-
import java.io.*;
import java.lang.reflect.*;
import java.util.*;
import org.apache.juneau.*;
-import org.apache.juneau.MediaType;
import org.apache.juneau.annotation.*;
import org.apache.juneau.internal.*;
import org.apache.juneau.parser.*;
@@ -92,7 +89,7 @@ public final class JsonParser extends ReaderParser {
public static final JsonParser DEFAULT = new JsonParser().lock();
/** Default parser, all default settings.*/
- public static final JsonParser DEFAULT_STRICT = new JsonParser().setProperty(PARSER_strict, true).lock();
+ public static final JsonParser DEFAULT_STRICT = new JsonParser().setStrict(true).lock();
private static final AsciiSet decChars = new AsciiSet("0123456789");
@@ -775,7 +772,7 @@ public final class JsonParser extends ReaderParser {
//--------------------------------------------------------------------------------
- // Overridden methods
+ // Entry point methods
//--------------------------------------------------------------------------------
@Override /* Parser */
@@ -821,39 +818,284 @@ public final class JsonParser extends ReaderParser {
return a;
}
+
+ //--------------------------------------------------------------------------------
+ // Properties
+ //--------------------------------------------------------------------------------
+
+ @Override /* Parser */
+ public JsonParser setTrimStrings(boolean value) throws LockedException {
+ super.setTrimStrings(value);
+ return this;
+ }
+
+ @Override /* Parser */
+ public JsonParser setStrict(boolean value) throws LockedException {
+ super.setStrict(value);
+ return this;
+ }
+
@Override /* Parser */
- public JsonParser setProperty(String property, Object value) throws LockedException {
- super.setProperty(property, value);
+ public JsonParser setInputStreamCharset(String value) throws LockedException {
+ super.setInputStreamCharset(value);
+ return this;
+ }
+
+ @Override /* Parser */
+ public JsonParser setFileCharset(String value) throws LockedException {
+ super.setFileCharset(value);
return this;
}
@Override /* CoreApi */
- public JsonParser setProperties(ObjectMap properties) throws LockedException {
- super.setProperties(properties);
+ public JsonParser setBeansRequireDefaultConstructor(boolean value) throws LockedException {
+ super.setBeansRequireDefaultConstructor(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonParser setBeansRequireSerializable(boolean value) throws LockedException {
+ super.setBeansRequireSerializable(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonParser setBeansRequireSettersForGetters(boolean value) throws LockedException {
+ super.setBeansRequireSettersForGetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonParser setBeansRequireSomeProperties(boolean value) throws LockedException {
+ super.setBeansRequireSomeProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonParser setBeanMapPutReturnsOldValue(boolean value) throws LockedException {
+ super.setBeanMapPutReturnsOldValue(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonParser setBeanConstructorVisibility(Visibility value) throws LockedException {
+ super.setBeanConstructorVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonParser setBeanClassVisibility(Visibility value) throws LockedException {
+ super.setBeanClassVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonParser setBeanFieldVisibility(Visibility value) throws LockedException {
+ super.setBeanFieldVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonParser setMethodVisibility(Visibility value) throws LockedException {
+ super.setMethodVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonParser setUseJavaBeanIntrospector(boolean value) throws LockedException {
+ super.setUseJavaBeanIntrospector(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonParser setUseInterfaceProxies(boolean value) throws LockedException {
+ super.setUseInterfaceProxies(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonParser setIgnoreUnknownBeanProperties(boolean value) throws LockedException {
+ super.setIgnoreUnknownBeanProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonParser setIgnoreUnknownNullBeanProperties(boolean value) throws LockedException {
+ super.setIgnoreUnknownNullBeanProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonParser setIgnorePropertiesWithoutSetters(boolean value) throws LockedException {
+ super.setIgnorePropertiesWithoutSetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonParser setIgnoreInvocationExceptionsOnGetters(boolean value) throws LockedException {
+ super.setIgnoreInvocationExceptionsOnGetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonParser setIgnoreInvocationExceptionsOnSetters(boolean value) throws LockedException {
+ super.setIgnoreInvocationExceptionsOnSetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonParser setSortProperties(boolean value) throws LockedException {
+ super.setSortProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonParser setNotBeanPackages(String...values) throws LockedException {
+ super.setNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonParser setNotBeanPackages(Collection<String> values) throws LockedException {
+ super.setNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonParser addNotBeanPackages(String...values) throws LockedException {
+ super.addNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonParser addNotBeanPackages(Collection<String> values) throws LockedException {
+ super.addNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonParser removeNotBeanPackages(String...values) throws LockedException {
+ super.removeNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonParser removeNotBeanPackages(Collection<String> values) throws LockedException {
+ super.removeNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonParser setNotBeanClasses(Class<?>...values) throws LockedException {
+ super.setNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonParser setNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ super.setNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonParser addNotBeanClasses(Class<?>...values) throws LockedException {
+ super.addNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonParser addNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ super.addNotBeanClasses(values);
return this;
}
@Override /* CoreApi */
- public JsonParser addNotBeanClasses(Class<?>...classes) throws LockedException {
- super.addNotBeanClasses(classes);
+ public JsonParser removeNotBeanClasses(Class<?>...values) throws LockedException {
+ super.removeNotBeanClasses(values);
return this;
}
@Override /* CoreApi */
- public JsonParser addBeanFilters(Class<?>...classes) throws LockedException {
- super.addBeanFilters(classes);
+ public JsonParser removeNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ super.removeNotBeanClasses(values);
return this;
}
@Override /* CoreApi */
- public JsonParser addPojoSwaps(Class<?>...classes) throws LockedException {
- super.addPojoSwaps(classes);
+ public JsonParser setBeanFilters(Class<?>...values) throws LockedException {
+ super.setBeanFilters(values);
return this;
}
@Override /* CoreApi */
- public JsonParser addToDictionary(Class<?>...classes) throws LockedException {
- super.addToDictionary(classes);
+ public JsonParser setBeanFilters(Collection<Class<?>> values) throws LockedException {
+ super.setBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonParser addBeanFilters(Class<?>...values) throws LockedException {
+ super.addBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonParser addBeanFilters(Collection<Class<?>> values) throws LockedException {
+ super.addBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonParser removeBeanFilters(Class<?>...values) throws LockedException {
+ super.removeBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonParser removeBeanFilters(Collection<Class<?>> values) throws LockedException {
+ super.removeBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonParser setPojoSwaps(Class<?>...values) throws LockedException {
+ super.setPojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonParser setPojoSwaps(Collection<Class<?>> values) throws LockedException {
+ super.setPojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonParser addPojoSwaps(Class<?>...values) throws LockedException {
+ super.addPojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonParser addPojoSwaps(Collection<Class<?>> values) throws LockedException {
+ super.addPojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonParser removePojoSwaps(Class<?>...values) throws LockedException {
+ super.removePojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonParser removePojoSwaps(Collection<Class<?>> values) throws LockedException {
+ super.removePojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonParser setImplClasses(Map<Class<?>,Class<?>> values) throws LockedException {
+ super.setImplClasses(values);
return this;
}
@@ -864,6 +1106,119 @@ public final class JsonParser extends ReaderParser {
}
@Override /* CoreApi */
+ public JsonParser setBeanDictionary(Class<?>...values) throws LockedException {
+ super.setBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonParser setBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ super.setBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonParser addToBeanDictionary(Class<?>...values) throws LockedException {
+ super.addToBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonParser addToBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ super.addToBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonParser removeFromBeanDictionary(Class<?>...values) throws LockedException {
+ super.removeFromBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonParser removeFromBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ super.removeFromBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonParser setBeanTypePropertyName(String value) throws LockedException {
+ super.setBeanTypePropertyName(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonParser setDefaultParser(Class<?> value) throws LockedException {
+ super.setDefaultParser(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonParser setLocale(Locale value) throws LockedException {
+ super.setLocale(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonParser setTimeZone(TimeZone value) throws LockedException {
+ super.setTimeZone(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonParser setMediaType(MediaType value) throws LockedException {
+ super.setMediaType(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonParser setDebug(boolean value) throws LockedException {
+ super.setDebug(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonParser setProperty(String name, Object value) throws LockedException {
+ super.setProperty(name, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonParser setProperties(ObjectMap properties) throws LockedException {
+ super.setProperties(properties);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonParser addToProperty(String name, Object value) throws LockedException {
+ super.addToProperty(name, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonParser putToProperty(String name, Object key, Object value) throws LockedException {
+ super.putToProperty(name, key, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonParser putToProperty(String name, Object value) throws LockedException {
+ super.putToProperty(name, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonParser removeFromProperty(String name, Object value) throws LockedException {
+ super.removeFromProperty(name, value);
+ return this;
+ }
+
+
+ //--------------------------------------------------------------------------------
+ // Overridden methods
+ //--------------------------------------------------------------------------------
+
+ @Override /* CoreApi */
public JsonParser setClassLoader(ClassLoader classLoader) throws LockedException {
super.setClassLoader(classLoader);
return this;
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/json/JsonParserContext.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/json/JsonParserContext.java b/juneau-core/src/main/java/org/apache/juneau/json/JsonParserContext.java
index 360a743..c53d224 100644
--- a/juneau-core/src/main/java/org/apache/juneau/json/JsonParserContext.java
+++ b/juneau-core/src/main/java/org/apache/juneau/json/JsonParserContext.java
@@ -21,23 +21,8 @@ import org.apache.juneau.parser.*;
* Context properties are set by calling {@link ContextFactory#setProperty(String, Object)} on the context factory
* returned {@link CoreApi#getContextFactory()}.
* <p>
- * The following convenience methods are also provided for setting context properties:
- * <ul>
- * <li>{@link JsonParser#setProperty(String,Object)}
- * <li>{@link JsonParser#setProperties(ObjectMap)}
- * <li>{@link JsonParser#addNotBeanClasses(Class[])}
- * <li>{@link JsonParser#addBeanFilters(Class[])}
- * <li>{@link JsonParser#addPojoSwaps(Class[])}
- * <li>{@link JsonParser#addToDictionary(Class[])}
- * <li>{@link JsonParser#addImplClass(Class,Class)}
- * </ul>
- * <p>
* See {@link ContextFactory} for more information about context properties.
*
- * <h6 class='topic' id='ConfigProperties'>Configurable properties on the JSON parser</h6>
- * <p>
- * None.
- *
* <h5 class='section'>Inherited configurable properties:</h5>
* <ul class='javahierarchy'>
* <li class='c'><a class="doclink" href="../BeanContext.html#ConfigProperties">BeanContext</a> - Properties associated with handling beans on serializers and parsers.
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/json/JsonSchemaSerializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/json/JsonSchemaSerializer.java b/juneau-core/src/main/java/org/apache/juneau/json/JsonSchemaSerializer.java
index 8826b29..54aa643 100644
--- a/juneau-core/src/main/java/org/apache/juneau/json/JsonSchemaSerializer.java
+++ b/juneau-core/src/main/java/org/apache/juneau/json/JsonSchemaSerializer.java
@@ -13,7 +13,6 @@
package org.apache.juneau.json;
import static org.apache.juneau.internal.ClassUtils.*;
-import static org.apache.juneau.serializer.SerializerContext.*;
import java.util.*;
@@ -42,8 +41,8 @@ public final class JsonSchemaSerializer extends JsonSerializer {
* Constructor.
*/
public JsonSchemaSerializer() {
- setProperty(SERIALIZER_detectRecursions, true);
- setProperty(SERIALIZER_ignoreRecursions, true);
+ setDetectRecursions(true);
+ setIgnoreRecursions(true);
}
/**
@@ -53,12 +52,13 @@ public final class JsonSchemaSerializer extends JsonSerializer {
*/
public JsonSchemaSerializer(ContextFactory config) {
getContextFactory().copyFrom(config);
- setProperty(SERIALIZER_detectRecursions, true);
- setProperty(SERIALIZER_ignoreRecursions, true);
+ setDetectRecursions(true);
+ setIgnoreRecursions(true);
}
+
//--------------------------------------------------------------------------------
- // Overridden methods
+ // Entry point methods
//--------------------------------------------------------------------------------
@Override /* JsonSerializer */
@@ -144,6 +144,10 @@ public final class JsonSchemaSerializer extends JsonSerializer {
}
+ //--------------------------------------------------------------------------------
+ // Overridden methods
+ //--------------------------------------------------------------------------------
+
@Override /* Lockable */
public JsonSchemaSerializer lock() {
super.lock();
[11/14] incubator-juneau git commit: Add convenience property setters
to serializers and parsers.
Posted by ja...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core-test/src/test/java/org/apache/juneau/xml/XmlTest.java
----------------------------------------------------------------------
diff --git a/juneau-core-test/src/test/java/org/apache/juneau/xml/XmlTest.java b/juneau-core-test/src/test/java/org/apache/juneau/xml/XmlTest.java
index e9f635f..6e8317e 100755
--- a/juneau-core-test/src/test/java/org/apache/juneau/xml/XmlTest.java
+++ b/juneau-core-test/src/test/java/org/apache/juneau/xml/XmlTest.java
@@ -13,8 +13,6 @@
package org.apache.juneau.xml;
import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.serializer.SerializerContext.*;
-import static org.apache.juneau.xml.XmlSerializerContext.*;
import static org.apache.juneau.xml.annotation.XmlFormat.*;
import static org.junit.Assert.*;
@@ -79,12 +77,12 @@ public class XmlTest {
+"</object>\n";
ObjectMap m = (ObjectMap) XmlParser.DEFAULT.parse(xml1, Object.class);
- String json2 = new JsonSerializer.SimpleReadable().setProperty(SERIALIZER_quoteChar, '"').setProperty(SERIALIZER_trimNullProperties, false).serialize(m);
+ String json2 = new JsonSerializer.SimpleReadable().setQuoteChar('"').setTrimNullProperties(false).serialize(m);
assertEquals(json1, json2);
m = (ObjectMap) JsonParser.DEFAULT.parse(json1, Object.class);
String xml2 = new XmlSerializer.SqReadable()
- .setProperty(SERIALIZER_trimNullProperties, false)
+ .setTrimNullProperties(false)
.serialize(m);
assertEquals(xml1, xml2);
}
@@ -135,9 +133,9 @@ public class XmlTest {
ObjectMap m = (ObjectMap) JsonParser.DEFAULT.parse(json1, Object.class);
String r = new XmlSerializer.NsSqReadable()
- .setProperty(XML_addNamespaceUrisToRoot, true)
- .setProperty(XML_defaultNamespace, "http://www.apache.org")
- .setProperty(SERIALIZER_trimNullProperties, false)
+ .setAddNamespaceUrisToRoot(true)
+ .setDefaultNamespace("http://www.apache.org")
+ .setTrimNullProperties(false)
.serialize(m);
assertEquals(xml1, r);
}
@@ -359,7 +357,7 @@ public class XmlTest {
String r = null;
r = s.serialize(t);
assertEquals("<object f1='1' f2='2' f3='3'/>", r);
- s.setProperty(XML_enableNamespaces, true).setProperty(XML_addNamespaceUrisToRoot, true).setProperty(XML_autoDetectNamespaces, true).setProperty(SERIALIZER_trimNullProperties, false);
+ s.setEnableNamespaces(true).setAddNamespaceUrisToRoot(true).setAutoDetectNamespaces(true).setTrimNullProperties(false);
t.f1 = 4; t.f2 = 5; t.f3 = 6;
r = s.serialize(t);
assertEquals("<object xmlns='http://www.apache.org/2013/Juneau' xmlns:bar='http://bar' xmlns:foo='http://foo' xmlns:baz='http://baz' bar:f1='4' foo:f2='5' baz:f3='6'/>", r);
@@ -521,7 +519,7 @@ public class XmlTest {
//====================================================================================================
@Test
public void testNsOnClass() throws Exception {
- XmlSerializer s = new XmlSerializer.Sq().setProperty(XML_autoDetectNamespaces, false);
+ XmlSerializer s = new XmlSerializer.Sq().setAutoDetectNamespaces(false);
XmlParser p = XmlParser.DEFAULT;
T1 t = new T1();
@@ -529,23 +527,21 @@ public class XmlTest {
assertEquals("<object><f1>1</f1><f2>2</f2><f3>3</f3><f4>4</f4></object>", r);
assertTrue(t.equals(p.parse(r, T1.class)));
- s.setProperty(XML_enableNamespaces, true).setProperty(XML_addNamespaceUrisToRoot, false);
+ s.setEnableNamespaces(true).setAddNamespaceUrisToRoot(false);
r = s.serialize(t);
assertEquals("<object><foo:f1>1</foo:f1><bar:f2>2</bar:f2><foo:f3>3</foo:f3><baz:f4>4</baz:f4></object>", r);
// Add namespace URIs to root, but don't auto-detect.
// Only xsi should be added to root.
- s.setProperty(XML_addNamespaceUrisToRoot, true);
+ s.setAddNamespaceUrisToRoot(true);
r = s.serialize(t);
assertEquals("<object xmlns='http://www.apache.org/2013/Juneau'><foo:f1>1</foo:f1><bar:f2>2</bar:f2><foo:f3>3</foo:f3><baz:f4>4</baz:f4></object>", r);
// Manually set namespaces
- s.setProperty(XML_namespaces,
- new Namespace[] {
- NamespaceFactory.get("foo","http://foo"),
- NamespaceFactory.get("bar","http://bar"),
- NamespaceFactory.get("baz","http://baz")
- }
+ s.setNamespaces(
+ NamespaceFactory.get("foo","http://foo"),
+ NamespaceFactory.get("bar","http://bar"),
+ NamespaceFactory.get("baz","http://baz")
);
r = s.serialize(t);
assertEquals("<object xmlns='http://www.apache.org/2013/Juneau' xmlns:foo='http://foo' xmlns:bar='http://bar' xmlns:baz='http://baz'><foo:f1>1</foo:f1><bar:f2>2</bar:f2><foo:f3>3</foo:f3><baz:f4>4</baz:f4></object>", r);
@@ -553,17 +549,17 @@ public class XmlTest {
validateXml(t, s);
// Auto-detect namespaces.
- s = new XmlSerializer.Sq().setProperty(XML_autoDetectNamespaces, true);
+ s = new XmlSerializer.Sq().setAutoDetectNamespaces(true);
r = s.serialize(t);
assertEquals("<object><f1>1</f1><f2>2</f2><f3>3</f3><f4>4</f4></object>", r);
assertTrue(t.equals(p.parse(r, T1.class)));
- s.setProperty(XML_addNamespaceUrisToRoot, true);
+ s.setAddNamespaceUrisToRoot(true);
r = s.serialize(t);
assertEquals("<object><f1>1</f1><f2>2</f2><f3>3</f3><f4>4</f4></object>", r);
assertTrue(t.equals(p.parse(r, T1.class)));
- s.setProperty(XML_enableNamespaces, true);
+ s.setEnableNamespaces(true);
r = s.serialize(t);
assertEquals("<object xmlns='http://www.apache.org/2013/Juneau' xmlns:foo='http://foo' xmlns:bar='http://bar' xmlns:baz='http://baz'><foo:f1>1</foo:f1><bar:f2>2</bar:f2><foo:f3>3</foo:f3><baz:f4>4</baz:f4></object>", r);
assertTrue(t.equals(p.parse(r, T1.class)));
@@ -575,7 +571,7 @@ public class XmlTest {
//====================================================================================================
@Test
public void testNsOnClassWithElementName() throws Exception {
- XmlSerializer s = new XmlSerializer.Sq().setProperty(XML_autoDetectNamespaces, false);
+ XmlSerializer s = new XmlSerializer.Sq().setAutoDetectNamespaces(false);
XmlParser p = XmlParser.DEFAULT;
T2 t = new T2();
@@ -583,23 +579,21 @@ public class XmlTest {
assertEquals("<T2><f1>1</f1><f2>2</f2><f3>3</f3><f4>4</f4></T2>", r);
assertTrue(t.equals(p.parse(r, T2.class)));
- s.setProperty(XML_enableNamespaces, true).setProperty(XML_addNamespaceUrisToRoot, false);
+ s.setEnableNamespaces(true).setAddNamespaceUrisToRoot(false);
r = s.serialize(t);
assertEquals("<foo:T2><foo:f1>1</foo:f1><bar:f2>2</bar:f2><foo:f3>3</foo:f3><baz:f4>4</baz:f4></foo:T2>", r);
// Add namespace URIs to root, but don't auto-detect.
// Only xsi should be added to root.
- s.setProperty(XML_addNamespaceUrisToRoot, true);
+ s.setAddNamespaceUrisToRoot(true);
r = s.serialize(t);
assertEquals("<foo:T2 xmlns='http://www.apache.org/2013/Juneau'><foo:f1>1</foo:f1><bar:f2>2</bar:f2><foo:f3>3</foo:f3><baz:f4>4</baz:f4></foo:T2>", r);
// Manually set namespaces
- s.setProperty(XML_namespaces,
- new Namespace[] {
- NamespaceFactory.get("foo","http://foo"),
- NamespaceFactory.get("bar","http://bar"),
- NamespaceFactory.get("baz","http://baz")
- }
+ s.setNamespaces(
+ NamespaceFactory.get("foo","http://foo"),
+ NamespaceFactory.get("bar","http://bar"),
+ NamespaceFactory.get("baz","http://baz")
);
r = s.serialize(t);
assertEquals("<foo:T2 xmlns='http://www.apache.org/2013/Juneau' xmlns:foo='http://foo' xmlns:bar='http://bar' xmlns:baz='http://baz'><foo:f1>1</foo:f1><bar:f2>2</bar:f2><foo:f3>3</foo:f3><baz:f4>4</baz:f4></foo:T2>", r);
@@ -607,15 +601,15 @@ public class XmlTest {
validateXml(t, s);
// Auto-detect namespaces.
- s = new XmlSerializer.Sq().setProperty(XML_autoDetectNamespaces, true);
+ s = new XmlSerializer.Sq().setAutoDetectNamespaces(true);
r = s.serialize(t);
assertEquals("<T2><f1>1</f1><f2>2</f2><f3>3</f3><f4>4</f4></T2>", r);
- s.setProperty(XML_addNamespaceUrisToRoot, true);
+ s.setAddNamespaceUrisToRoot(true);
r = s.serialize(t);
assertEquals("<T2><f1>1</f1><f2>2</f2><f3>3</f3><f4>4</f4></T2>", r);
- s.setProperty(XML_enableNamespaces, true);
+ s.setEnableNamespaces(true);
r = s.serialize(t);
assertEquals("<foo:T2 xmlns='http://www.apache.org/2013/Juneau' xmlns:foo='http://foo' xmlns:bar='http://bar' xmlns:baz='http://baz'><foo:f1>1</foo:f1><bar:f2>2</bar:f2><foo:f3>3</foo:f3><baz:f4>4</baz:f4></foo:T2>", r);
assertTrue(t.equals(p.parse(r, T2.class)));
@@ -637,24 +631,22 @@ public class XmlTest {
assertTrue(t.equals(p.parse(r, T3.class)));
validateXml(t, s);
- s.setProperty(XML_enableNamespaces, true).setProperty(XML_addNamespaceUrisToRoot, false);
+ s.setEnableNamespaces(true).setAddNamespaceUrisToRoot(false);
r = s.serialize(t);
assertEquals("<object><p1:f1>1</p1:f1><bar:f2>2</bar:f2><p1:f3>3</p1:f3><baz:f4>4</baz:f4></object>", r);
// Add namespace URIs to root, but don't auto-detect.
// Only xsi should be added to root.
- s.setProperty(XML_addNamespaceUrisToRoot, true).setProperty(XML_autoDetectNamespaces, false);
+ s.setAddNamespaceUrisToRoot(true).setAutoDetectNamespaces(false);
r = s.serialize(t);
assertEquals("<object xmlns='http://www.apache.org/2013/Juneau'><p1:f1>1</p1:f1><bar:f2>2</bar:f2><p1:f3>3</p1:f3><baz:f4>4</baz:f4></object>", r);
// Manually set namespaces
- s.setProperty(XML_autoDetectNamespaces, false);
- s.setProperty(XML_namespaces,
- new Namespace[] {
- NamespaceFactory.get("p1","http://p1"),
- NamespaceFactory.get("bar","http://bar"),
- NamespaceFactory.get("baz","http://baz")
- }
+ s.setAutoDetectNamespaces(false);
+ s.setNamespaces(
+ NamespaceFactory.get("p1","http://p1"),
+ NamespaceFactory.get("bar","http://bar"),
+ NamespaceFactory.get("baz","http://baz")
);
r = s.serialize(t);
assertEquals("<object xmlns='http://www.apache.org/2013/Juneau' xmlns:p1='http://p1' xmlns:bar='http://bar' xmlns:baz='http://baz'><p1:f1>1</p1:f1><bar:f2>2</bar:f2><p1:f3>3</p1:f3><baz:f4>4</baz:f4></object>", r);
@@ -662,15 +654,15 @@ public class XmlTest {
validateXml(t, s);
// Auto-detect namespaces.
- s = new XmlSerializer.Sq().setProperty(XML_autoDetectNamespaces, true);
+ s = new XmlSerializer.Sq().setAutoDetectNamespaces(true);
r = s.serialize(t);
assertEquals("<object><f1>1</f1><f2>2</f2><f3>3</f3><f4>4</f4></object>", r);
- s.setProperty(XML_addNamespaceUrisToRoot, true);
+ s.setAddNamespaceUrisToRoot(true);
r = s.serialize(t);
assertEquals("<object><f1>1</f1><f2>2</f2><f3>3</f3><f4>4</f4></object>", r);
- s.setProperty(XML_enableNamespaces, true);
+ s.setEnableNamespaces(true);
r = s.serialize(t);
assertEquals("<object xmlns='http://www.apache.org/2013/Juneau' xmlns:p1='http://p1' xmlns:bar='http://bar' xmlns:baz='http://baz'><p1:f1>1</p1:f1><bar:f2>2</bar:f2><p1:f3>3</p1:f3><baz:f4>4</baz:f4></object>", r);
assertTrue(t.equals(p.parse(r, T3.class)));
@@ -682,7 +674,7 @@ public class XmlTest {
//====================================================================================================
@Test
public void testNsOnPackageNoNsOnClassElementNameOnClass() throws Exception {
- XmlSerializer s = new XmlSerializer.Sq().setProperty(XML_autoDetectNamespaces, false);
+ XmlSerializer s = new XmlSerializer.Sq().setAutoDetectNamespaces(false);
XmlParser p = XmlParser.DEFAULT;
T4 t = new T4();
@@ -690,24 +682,22 @@ public class XmlTest {
assertEquals("<T4><f1>1</f1><f2>2</f2><f3>3</f3><f4>4</f4></T4>", r);
assertTrue(t.equals(p.parse(r, T4.class)));
- s.setProperty(XML_enableNamespaces, true).setProperty(XML_addNamespaceUrisToRoot, false);
+ s.setEnableNamespaces(true).setAddNamespaceUrisToRoot(false);
r = s.serialize(t);
assertEquals("<p1:T4><p1:f1>1</p1:f1><bar:f2>2</bar:f2><p1:f3>3</p1:f3><baz:f4>4</baz:f4></p1:T4>", r);
// Add namespace URIs to root, but don't auto-detect.
// Only xsi should be added to root.
- s.setProperty(XML_addNamespaceUrisToRoot, true);
+ s.setAddNamespaceUrisToRoot(true);
r = s.serialize(t);
assertEquals("<p1:T4 xmlns='http://www.apache.org/2013/Juneau'><p1:f1>1</p1:f1><bar:f2>2</bar:f2><p1:f3>3</p1:f3><baz:f4>4</baz:f4></p1:T4>", r);
// Manually set namespaces
- s.setProperty(XML_namespaces,
- new Namespace[] {
- NamespaceFactory.get("foo","http://foo"),
- NamespaceFactory.get("bar","http://bar"),
- NamespaceFactory.get("baz","http://baz"),
- NamespaceFactory.get("p1","http://p1")
- }
+ s.setNamespaces(
+ NamespaceFactory.get("foo","http://foo"),
+ NamespaceFactory.get("bar","http://bar"),
+ NamespaceFactory.get("baz","http://baz"),
+ NamespaceFactory.get("p1","http://p1")
);
r = s.serialize(t);
assertEquals("<p1:T4 xmlns='http://www.apache.org/2013/Juneau' xmlns:foo='http://foo' xmlns:bar='http://bar' xmlns:baz='http://baz' xmlns:p1='http://p1'><p1:f1>1</p1:f1><bar:f2>2</bar:f2><p1:f3>3</p1:f3><baz:f4>4</baz:f4></p1:T4>", r);
@@ -715,15 +705,15 @@ public class XmlTest {
validateXml(t, s);
// Auto-detect namespaces.
- s = new XmlSerializer.Sq().setProperty(XML_autoDetectNamespaces, true);
+ s = new XmlSerializer.Sq().setAutoDetectNamespaces(true);
r = s.serialize(t);
assertEquals("<T4><f1>1</f1><f2>2</f2><f3>3</f3><f4>4</f4></T4>", r);
- s.setProperty(XML_addNamespaceUrisToRoot, true);
+ s.setAddNamespaceUrisToRoot(true);
r = s.serialize(t);
assertEquals("<T4><f1>1</f1><f2>2</f2><f3>3</f3><f4>4</f4></T4>", r);
- s.setProperty(XML_enableNamespaces, true);
+ s.setEnableNamespaces(true);
r = s.serialize(t);
assertEquals("<p1:T4 xmlns='http://www.apache.org/2013/Juneau' xmlns:p1='http://p1' xmlns:bar='http://bar' xmlns:baz='http://baz'><p1:f1>1</p1:f1><bar:f2>2</bar:f2><p1:f3>3</p1:f3><baz:f4>4</baz:f4></p1:T4>", r);
assertTrue(t.equals(p.parse(r, T4.class)));
@@ -744,23 +734,21 @@ public class XmlTest {
assertTrue(t.equals(p.parse(r, T5.class)));
validateXml(t, s);
- s.setProperty(XML_enableNamespaces, true).setProperty(XML_addNamespaceUrisToRoot, false).setProperty(XML_autoDetectNamespaces, false);
+ s.setEnableNamespaces(true).setAddNamespaceUrisToRoot(false).setAutoDetectNamespaces(false);
r = s.serialize(t);
assertEquals("<foo:T5><foo:f1>1</foo:f1><bar:f2>2</bar:f2><foo:f3>3</foo:f3><baz:f4>4</baz:f4></foo:T5>", r);
// Add namespace URIs to root, but don't auto-detect.
// Only xsi should be added to root.
- s.setProperty(XML_addNamespaceUrisToRoot, true);
+ s.setAddNamespaceUrisToRoot(true);
r = s.serialize(t);
assertEquals("<foo:T5 xmlns='http://www.apache.org/2013/Juneau'><foo:f1>1</foo:f1><bar:f2>2</bar:f2><foo:f3>3</foo:f3><baz:f4>4</baz:f4></foo:T5>", r);
// Manually set namespaces
- s.setProperty(XML_namespaces,
- new Namespace[] {
- NamespaceFactory.get("foo","http://foo"),
- NamespaceFactory.get("bar","http://bar"),
- NamespaceFactory.get("baz","http://baz")
- }
+ s.setNamespaces(
+ NamespaceFactory.get("foo","http://foo"),
+ NamespaceFactory.get("bar","http://bar"),
+ NamespaceFactory.get("baz","http://baz")
);
r = s.serialize(t);
assertEquals("<foo:T5 xmlns='http://www.apache.org/2013/Juneau' xmlns:foo='http://foo' xmlns:bar='http://bar' xmlns:baz='http://baz'><foo:f1>1</foo:f1><bar:f2>2</bar:f2><foo:f3>3</foo:f3><baz:f4>4</baz:f4></foo:T5>", r);
@@ -768,17 +756,17 @@ public class XmlTest {
validateXml(t, s);
// Auto-detect namespaces.
- s = new XmlSerializer.Sq().setProperty(XML_autoDetectNamespaces, true);
+ s = new XmlSerializer.Sq().setAutoDetectNamespaces(true);
r = s.serialize(t);
assertEquals("<T5><f1>1</f1><f2>2</f2><f3>3</f3><f4>4</f4></T5>", r);
validateXml(t, s);
- s.setProperty(XML_addNamespaceUrisToRoot, true);
+ s.setAddNamespaceUrisToRoot(true);
r = s.serialize(t);
assertEquals("<T5><f1>1</f1><f2>2</f2><f3>3</f3><f4>4</f4></T5>", r);
validateXml(t, s);
- s.setProperty(XML_enableNamespaces, true);
+ s.setEnableNamespaces(true);
r = s.serialize(t);
assertEquals("<foo:T5 xmlns='http://www.apache.org/2013/Juneau' xmlns:foo='http://foo' xmlns:bar='http://bar' xmlns:baz='http://baz'><foo:f1>1</foo:f1><bar:f2>2</bar:f2><foo:f3>3</foo:f3><baz:f4>4</baz:f4></foo:T5>", r);
assertTrue(t.equals(p.parse(r, T5.class)));
@@ -790,7 +778,7 @@ public class XmlTest {
//====================================================================================================
@Test
public void testNsOnPackageNsOnClassNoElementNameOnClass() throws Exception {
- XmlSerializer s = new XmlSerializer.Sq().setProperty(XML_autoDetectNamespaces, false);
+ XmlSerializer s = new XmlSerializer.Sq().setAutoDetectNamespaces(false);
XmlParser p = XmlParser.DEFAULT;
T6 t = new T6();
@@ -798,23 +786,21 @@ public class XmlTest {
assertEquals("<object><f1>1</f1><f2>2</f2><f3>3</f3><f4>4</f4></object>", r);
assertTrue(t.equals(p.parse(r, T6.class)));
- s.setProperty(XML_enableNamespaces, true).setProperty(XML_addNamespaceUrisToRoot, false);
+ s.setEnableNamespaces(true).setAddNamespaceUrisToRoot(false);
r = s.serialize(t);
assertEquals("<object><foo:f1>1</foo:f1><bar:f2>2</bar:f2><foo:f3>3</foo:f3><baz:f4>4</baz:f4></object>", r);
// Add namespace URIs to root, but don't auto-detect.
// Only xsi should be added to root.
- s.setProperty(XML_addNamespaceUrisToRoot, true).setProperty(XML_autoDetectNamespaces, false);
+ s.setAddNamespaceUrisToRoot(true).setAutoDetectNamespaces(false);
r = s.serialize(t);
assertEquals("<object xmlns='http://www.apache.org/2013/Juneau'><foo:f1>1</foo:f1><bar:f2>2</bar:f2><foo:f3>3</foo:f3><baz:f4>4</baz:f4></object>", r);
// Manually set namespaces
- s.setProperty(XML_namespaces,
- new Namespace[] {
- NamespaceFactory.get("foo","http://foo"),
- NamespaceFactory.get("bar","http://bar"),
- NamespaceFactory.get("baz","http://baz")
- }
+ s.setNamespaces(
+ NamespaceFactory.get("foo","http://foo"),
+ NamespaceFactory.get("bar","http://bar"),
+ NamespaceFactory.get("baz","http://baz")
);
r = s.serialize(t);
assertEquals("<object xmlns='http://www.apache.org/2013/Juneau' xmlns:foo='http://foo' xmlns:bar='http://bar' xmlns:baz='http://baz'><foo:f1>1</foo:f1><bar:f2>2</bar:f2><foo:f3>3</foo:f3><baz:f4>4</baz:f4></object>", r);
@@ -822,17 +808,17 @@ public class XmlTest {
validateXml(t, s);
// Auto-detect namespaces.
- s = new XmlSerializer.Sq().setProperty(XML_autoDetectNamespaces, true);
+ s = new XmlSerializer.Sq().setAutoDetectNamespaces(true);
r = s.serialize(t);
assertEquals("<object><f1>1</f1><f2>2</f2><f3>3</f3><f4>4</f4></object>", r);
validateXml(t, s);
- s.setProperty(XML_addNamespaceUrisToRoot, true);
+ s.setAddNamespaceUrisToRoot(true);
r = s.serialize(t);
assertEquals("<object><f1>1</f1><f2>2</f2><f3>3</f3><f4>4</f4></object>", r);
validateXml(t, s);
- s.setProperty(XML_enableNamespaces, true);
+ s.setEnableNamespaces(true);
r = s.serialize(t);
assertEquals("<object xmlns='http://www.apache.org/2013/Juneau' xmlns:foo='http://foo' xmlns:bar='http://bar' xmlns:baz='http://baz'><foo:f1>1</foo:f1><bar:f2>2</bar:f2><foo:f3>3</foo:f3><baz:f4>4</baz:f4></object>", r);
assertTrue(t.equals(p.parse(r, T6.class)));
@@ -844,7 +830,7 @@ public class XmlTest {
//====================================================================================================
@Test
public void testComboOfNsAndOverriddenBeanPropertyNames() throws Exception {
- XmlSerializer s = new XmlSerializer.Sq().setProperty(XML_autoDetectNamespaces, false);
+ XmlSerializer s = new XmlSerializer.Sq().setAutoDetectNamespaces(false);
XmlParser p = XmlParser.DEFAULT;
T7 t = new T7();
@@ -852,39 +838,37 @@ public class XmlTest {
assertEquals("<object><g1>1</g1><g2>2</g2><g3>3</g3><g4>4</g4></object>", r);
assertTrue(t.equals(p.parse(r, T7.class)));
- s.setProperty(XML_enableNamespaces, true).setProperty(XML_addNamespaceUrisToRoot, false);
+ s.setEnableNamespaces(true).setAddNamespaceUrisToRoot(false);
r = s.serialize(t);
assertEquals("<object><p1:g1>1</p1:g1><bar:g2>2</bar:g2><p1:g3>3</p1:g3><baz:g4>4</baz:g4></object>", r);
// Add namespace URIs to root, but don't auto-detect.
// Only xsi should be added to root.
- s.setProperty(XML_addNamespaceUrisToRoot, true).setProperty(XML_autoDetectNamespaces, false);
+ s.setAddNamespaceUrisToRoot(true).setAutoDetectNamespaces(false);
r = s.serialize(t);
assertEquals("<object xmlns='http://www.apache.org/2013/Juneau'><p1:g1>1</p1:g1><bar:g2>2</bar:g2><p1:g3>3</p1:g3><baz:g4>4</baz:g4></object>", r);
// Manually set namespaces
- s.setProperty(XML_namespaces,
- new Namespace[] {
- NamespaceFactory.get("foo","http://foo"),
- NamespaceFactory.get("bar","http://bar"),
- NamespaceFactory.get("baz","http://baz"),
- NamespaceFactory.get("p1","http://p1")
- }
+ s.setNamespaces(
+ NamespaceFactory.get("foo","http://foo"),
+ NamespaceFactory.get("bar","http://bar"),
+ NamespaceFactory.get("baz","http://baz"),
+ NamespaceFactory.get("p1","http://p1")
);
r = s.serialize(t);
assertEquals("<object xmlns='http://www.apache.org/2013/Juneau' xmlns:foo='http://foo' xmlns:bar='http://bar' xmlns:baz='http://baz' xmlns:p1='http://p1'><p1:g1>1</p1:g1><bar:g2>2</bar:g2><p1:g3>3</p1:g3><baz:g4>4</baz:g4></object>", r);
assertTrue(t.equals(p.parse(r, T7.class)));
// Auto-detect namespaces.
- s = new XmlSerializer.Sq().setProperty(XML_autoDetectNamespaces, true);
+ s = new XmlSerializer.Sq().setAutoDetectNamespaces(true);
r = s.serialize(t);
assertEquals("<object><g1>1</g1><g2>2</g2><g3>3</g3><g4>4</g4></object>", r);
- s.setProperty(XML_enableNamespaces, false);
+ s.setEnableNamespaces(false);
r = s.serialize(t);
assertEquals("<object><g1>1</g1><g2>2</g2><g3>3</g3><g4>4</g4></object>", r);
- s.setProperty(XML_enableNamespaces, true).setProperty(XML_addNamespaceUrisToRoot, true);
+ s.setEnableNamespaces(true).setAddNamespaceUrisToRoot(true);
r = s.serialize(t);
assertEquals("<object xmlns='http://www.apache.org/2013/Juneau' xmlns:p1='http://p1' xmlns:bar='http://bar' xmlns:baz='http://baz'><p1:g1>1</p1:g1><bar:g2>2</bar:g2><p1:g3>3</p1:g3><baz:g4>4</baz:g4></object>", r);
assertTrue(t.equals(p.parse(r, T7.class)));
@@ -896,7 +880,7 @@ public class XmlTest {
//====================================================================================================
@Test
public void testXmlNsAnnotation() throws Exception {
- XmlSerializer s = new XmlSerializer.Sq().setProperty(XML_autoDetectNamespaces, false);
+ XmlSerializer s = new XmlSerializer.Sq().setAutoDetectNamespaces(false);
XmlParser p = XmlParser.DEFAULT;
T8 t = new T8();
@@ -904,40 +888,38 @@ public class XmlTest {
assertEquals("<object><f1>1</f1><f2>2</f2><f3>3</f3><f4>4</f4></object>", r);
assertTrue(t.equals(p.parse(r, T8.class)));
- s.setProperty(XML_enableNamespaces, true).setProperty(XML_addNamespaceUrisToRoot, false).setProperty(XML_autoDetectNamespaces, false);
+ s.setEnableNamespaces(true).setAddNamespaceUrisToRoot(false).setAutoDetectNamespaces(false);
r = s.serialize(t);
assertEquals("<object><p2:f1>1</p2:f1><p1:f2>2</p1:f2><c1:f3>3</c1:f3><f1:f4>4</f1:f4></object>", r);
// Add namespace URIs to root, but don't auto-detect.
// Only xsi should be added to root.
- s.setProperty(XML_addNamespaceUrisToRoot, true);
+ s.setAddNamespaceUrisToRoot(true);
r = s.serialize(t);
assertEquals("<object xmlns='http://www.apache.org/2013/Juneau'><p2:f1>1</p2:f1><p1:f2>2</p1:f2><c1:f3>3</c1:f3><f1:f4>4</f1:f4></object>", r);
// Manually set namespaces
- s.setProperty(XML_namespaces,
- new Namespace[] {
- NamespaceFactory.get("foo","http://foo"),
- NamespaceFactory.get("bar","http://bar"),
- NamespaceFactory.get("baz","http://baz")
- }
+ s.setNamespaces(
+ NamespaceFactory.get("foo","http://foo"),
+ NamespaceFactory.get("bar","http://bar"),
+ NamespaceFactory.get("baz","http://baz")
);
r = s.serialize(t);
assertEquals("<object xmlns='http://www.apache.org/2013/Juneau' xmlns:foo='http://foo' xmlns:bar='http://bar' xmlns:baz='http://baz'><p2:f1>1</p2:f1><p1:f2>2</p1:f2><c1:f3>3</c1:f3><f1:f4>4</f1:f4></object>", r);
// Auto-detect namespaces.
- s = new XmlSerializer.Sq().setProperty(XML_autoDetectNamespaces, true);
+ s = new XmlSerializer.Sq().setAutoDetectNamespaces(true);
r = s.serialize(t);
assertEquals("<object><f1>1</f1><f2>2</f2><f3>3</f3><f4>4</f4></object>", r);
assertTrue(t.equals(p.parse(r, T8.class)));
validateXml(t, s);
- s.setProperty(XML_addNamespaceUrisToRoot, true);
+ s.setAddNamespaceUrisToRoot(true);
r = s.serialize(t);
assertEquals("<object><f1>1</f1><f2>2</f2><f3>3</f3><f4>4</f4></object>", r);
validateXml(t, s);
- s.setProperty(XML_enableNamespaces, true);
+ s.setEnableNamespaces(true);
r = s.serialize(t);
assertEquals("<object xmlns='http://www.apache.org/2013/Juneau' xmlns:p2='http://p2' xmlns:p1='http://p1' xmlns:c1='http://c1' xmlns:f1='http://f1'><p2:f1>1</p2:f1><p1:f2>2</p1:f2><c1:f3>3</c1:f3><f1:f4>4</f1:f4></object>", r);
assertTrue(t.equals(p.parse(r, T8.class)));
@@ -949,7 +931,7 @@ public class XmlTest {
//====================================================================================================
@Test
public void testXmlNsOnPackageNsUriInXmlNs() throws Exception {
- XmlSerializer s = new XmlSerializer.Sq().setProperty(XML_autoDetectNamespaces, false);
+ XmlSerializer s = new XmlSerializer.Sq().setAutoDetectNamespaces(false);
XmlParser p = XmlParser.DEFAULT;
T9 t = new T9();
@@ -957,40 +939,38 @@ public class XmlTest {
assertEquals("<object><f1>1</f1></object>", r);
assertTrue(t.equals(p.parse(r, T9.class)));
- s.setProperty(XML_enableNamespaces, true).setProperty(XML_autoDetectNamespaces, false).setProperty(XML_addNamespaceUrisToRoot, false);
+ s.setEnableNamespaces(true).setAutoDetectNamespaces(false).setAddNamespaceUrisToRoot(false);
r = s.serialize(t);
assertEquals("<object><p1:f1>1</p1:f1></object>", r);
// Add namespace URIs to root, but don't auto-detect.
// Only xsi should be added to root.
- s.setProperty(XML_addNamespaceUrisToRoot, true);
+ s.setAddNamespaceUrisToRoot(true);
r = s.serialize(t);
assertEquals("<object xmlns='http://www.apache.org/2013/Juneau'><p1:f1>1</p1:f1></object>", r);
// Manually set namespaces
- s.setProperty(XML_namespaces,
- new Namespace[] {
- NamespaceFactory.get("foo","http://foo"),
- NamespaceFactory.get("bar","http://bar"),
- NamespaceFactory.get("baz","http://baz")
- }
+ s.setNamespaces(
+ NamespaceFactory.get("foo","http://foo"),
+ NamespaceFactory.get("bar","http://bar"),
+ NamespaceFactory.get("baz","http://baz")
);
r = s.serialize(t);
assertEquals("<object xmlns='http://www.apache.org/2013/Juneau' xmlns:foo='http://foo' xmlns:bar='http://bar' xmlns:baz='http://baz'><p1:f1>1</p1:f1></object>", r);
// Auto-detect namespaces.
- s = new XmlSerializer.Sq().setProperty(XML_autoDetectNamespaces, true);
+ s = new XmlSerializer.Sq().setAutoDetectNamespaces(true);
r = s.serialize(t);
assertEquals("<object><f1>1</f1></object>", r);
assertTrue(t.equals(p.parse(r, T9.class)));
validateXml(t, s);
- s.setProperty(XML_addNamespaceUrisToRoot, true);
+ s.setAddNamespaceUrisToRoot(true);
r = s.serialize(t);
assertEquals("<object><f1>1</f1></object>", r);
validateXml(t, s);
- s.setProperty(XML_enableNamespaces, true);
+ s.setEnableNamespaces(true);
r = s.serialize(t);
assertEquals("<object xmlns='http://www.apache.org/2013/Juneau' xmlns:p1='http://p1'><p1:f1>1</p1:f1></object>", r);
assertTrue(t.equals(p.parse(r, T9.class)));
@@ -1017,7 +997,7 @@ public class XmlTest {
assertEquals("xf2", t.f2);
assertEquals("xf3", t.f3);
- s.setProperty(XML_enableNamespaces, true).setProperty(XML_addNamespaceUrisToRoot, true).setProperty(XML_autoDetectNamespaces, true);
+ s.setEnableNamespaces(true).setAddNamespaceUrisToRoot(true).setAutoDetectNamespaces(true);
r = s.serialize(t);
assertEquals("<object xmlns='http://www.apache.org/2013/Juneau' xmlns:ns='http://ns' xmlns:nsf1='http://nsf1' xmlns:nsf3='http://nsf3' nsf1:f1='http://xf1' ns:f2='xf2' nsf3:x3='xf3'/>", r);
validateXml(t, s);
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/BeanContext.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/BeanContext.java b/juneau-core/src/main/java/org/apache/juneau/BeanContext.java
index dd88562..116d6e9 100644
--- a/juneau-core/src/main/java/org/apache/juneau/BeanContext.java
+++ b/juneau-core/src/main/java/org/apache/juneau/BeanContext.java
@@ -91,250 +91,6 @@ import org.apache.juneau.transform.*;
* .getBeanContext();
* </p>
*
- * <h6 class='topic' id='ConfigProperties'>Properties associated with handling beans on serializers and parsers</h6>
- * <table class='styled' style='border-collapse: collapse;'>
- * <tr><th>Setting name</th><th>Description</th><th>Data type</th><th>Default value</th><th>Session overridable</th></tr>
- * <tr>
- * <td>{@link #BEAN_beansRequireDefaultConstructor}</td>
- * <td>Beans require no-arg constructors.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>false</jk></td>
- * <td><jk>false</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #BEAN_beansRequireSerializable}</td>
- * <td>Beans require Serializable interface.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>false</jk></td>
- * <td><jk>false</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #BEAN_beansRequireSettersForGetters}</td>
- * <td>Beans require setters for getters.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>false</jk></td>
- * <td><jk>false</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #BEAN_beansRequireSomeProperties}</td>
- * <td>Beans require at least one property.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>true</jk></td>
- * <td><jk>false</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #BEAN_beanMapPutReturnsOldValue}</td>
- * <td>{@link BeanMap#put(String,Object) BeanMap.put()} method will return old property value.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>false</jk></td>
- * <td><jk>false</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #BEAN_beanConstructorVisibility}</td>
- * <td>Look for bean constructors with specified minimum visibility.</td>
- * <td>{@link Visibility}</td>
- * <td>{@link Visibility#PUBLIC}</td>
- * <td><jk>false</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #BEAN_beanClassVisibility}</td>
- * <td>Look for bean classes with specified minimum visibility.</td>
- * <td>{@link Visibility}</td>
- * <td>{@link Visibility#PUBLIC}</td>
- * <td><jk>false</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #BEAN_beanFieldVisibility}</td>
- * <td>Look for bean fields with specified minimum visibility.</td>
- * <td>{@link Visibility}</td>
- * <td>{@link Visibility#PUBLIC}</td>
- * <td><jk>false</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #BEAN_methodVisibility}</td>
- * <td>Look for bean methods with specified minimum visibility.</td>
- * <td>{@link Visibility}</td>
- * <td>{@link Visibility#PUBLIC}</td>
- * <td><jk>false</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #BEAN_useJavaBeanIntrospector}</td>
- * <td>Use Java {@link Introspector} for determining bean properties.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>false</jk></td>
- * <td><jk>false</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #BEAN_useInterfaceProxies}</td>
- * <td>Use interface proxies.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>true</jk></td>
- * <td><jk>false</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #BEAN_ignoreUnknownBeanProperties}</td>
- * <td>Ignore unknown properties.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>false</jk></td>
- * <td><jk>false</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #BEAN_ignoreUnknownNullBeanProperties}</td>
- * <td>Ignore unknown properties with null values.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>true</jk></td>
- * <td><jk>false</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #BEAN_ignorePropertiesWithoutSetters}</td>
- * <td>Ignore bean properties without setters.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>true</jk></td>
- * <td><jk>false</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #BEAN_ignoreInvocationExceptionsOnGetters}</td>
- * <td>Ignore invocation errors on getters.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>false</jk></td>
- * <td><jk>false</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #BEAN_ignoreInvocationExceptionsOnSetters}</td>
- * <td>Ignore invocation errors on setters.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>false</jk></td>
- * <td><jk>false</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #BEAN_sortProperties}</td>
- * <td>Sort bean properties in alphabetical order.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>false</jk></td>
- * <td><jk>false</jk></td>
- * </tr>
- * <tr>
- * <td>
- * {@link #BEAN_notBeanPackages}<br>
- * {@link #BEAN_notBeanPackages_add}<br>
- * {@link #BEAN_notBeanPackages_remove}
- * </td>
- * <td>Packages whose classes should not be considered beans.</td>
- * <td><code>Set<String></code></td>
- * <td>See details</td>
- * <td><jk>false</jk></td>
- * </tr>
- * <tr>
- * <td>
- * {@link #BEAN_notBeanClasses}<br>
- * {@link #BEAN_notBeanClasses_add}<br>
- * {@link #BEAN_notBeanClasses_remove}
- * </td>
- * <td>Classes that should not be considered beans.</td>
- * <td><code>Set<Class></code></td>
- * <td>empty set</td>
- * <td><jk>false</jk></td>
- * </tr>
- * <tr>
- * <td>
- * {@link #BEAN_beanFilters}<br>
- * {@link #BEAN_beanFilters_add}<br>
- * {@link #BEAN_beanFilters_remove}
- * </td>
- * <td>Bean filters to apply to beans.</td>
- * <td><code>List<Class></code></td>
- * <td>empty list</td>
- * <td><jk>false</jk></td>
- * </tr>
- * <tr>
- * <td>
- * {@link #BEAN_pojoSwaps}<br>
- * {@link #BEAN_pojoSwaps_add}<br>
- * {@link #BEAN_pojoSwaps_remove}
- * </td>
- * <td>POJO swaps to apply to java objects.</td>
- * <td><code>List<Class></code></td>
- * <td>empty list</td>
- * <td><jk>false</jk></td>
- * </tr>
- * <tr>
- * <td>
- * {@link #BEAN_implClasses}<br>
- * {@link #BEAN_implClasses_put}
- * </td>
- * <td>Implementation classes for interfaces and abstract classes.</td>
- * <td><code>Map<Class,Class></code></td>
- * <td>empty map</td>
- * <td><jk>false</jk></td>
- * </tr>
- * <tr>
- * <td>
- * {@link #BEAN_beanDictionary}<br>
- * {@link #BEAN_beanDictionary_add}<br>
- * {@link #BEAN_beanDictionary_remove}
- * </td>
- * <td>Bean lookup dictionary.</td>
- * <td><code>List<Class></code></td>
- * <td>empty list</td>
- * <td><jk>false</jk></td>
- * </tr>
- * <tr>
- * <td>
- * {@link #BEAN_beanTypePropertyName}
- * </td>
- * <td>Name to use for the bean type property used to represent a bean type.</td>
- * <td><code>String</code></td>
- * <td><js>"_type"</js></td>
- * <td><jk>false</jk></td>
- * </tr>
- * <tr>
- * <td>
- * {@link #BEAN_defaultParser}
- * </td>
- * <td>Default parser to use when converting <code>Strings</code> to POJOs.</td>
- * <td><code>Class</code></td>
- * <td>{@link JsonParser}</td>
- * <td><jk>false</jk></td>
- * </tr>
- * <tr>
- * <td>
- * {@link #BEAN_locale}
- * </td>
- * <td>User locale.</td>
- * <td><code>Locale</code></td>
- * <td>{@link Locale#getDefault()}</td>
- * <td><jk>true</jk></td>
- * </tr>
- * <tr>
- * <td>
- * {@link #BEAN_timeZone}
- * </td>
- * <td>User timezone.</td>
- * <td><code>TimeZone</code></td>
- * <td><jk>null</jk></td>
- * <td><jk>true</jk></td>
- * </tr>
- * <tr>
- * <td>
- * {@link #BEAN_mediaType}
- * </td>
- * <td>Default media type value for serializer and parser sessions</td>
- * <td>{@link MediaType}</td>
- * <td><jk>null</jk></td>
- * <td><jk>true</jk></td>
- * </tr>
- * <tr>
- * <td>
- * {@link #BEAN_debug}
- * </td>
- * <td>Debug mode.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>false</jk></td>
- * <td><jk>true</jk></td>
- * </tr>
- * </table>
- *
- *
* <h5 class='topic'>Bean Maps</h5>
* <p>
* {@link BeanMap BeanMaps} are wrappers around Java beans that allow properties to be retrieved and
@@ -1558,116 +1314,6 @@ public class BeanContext extends Context {
return cmObject;
}
-//
-// This code is inherently unsafe (but still potentially useful?)
-//
-// /**
-// * Converts class name strings to ClassMeta objects.
-// *
-// * <h5 class='section'>Example:</h5>
-// * <ul>
-// * <li><js>"java.lang.String"</js>
-// * <li><js>"com.foo.sample.MyBean[]"</js>
-// * <li><js>"java.util.HashMap<java.lang.String,java.lang.Integer>"</js>
-// * <li><js>"[Ljava.lang.String;"</js> (i.e. the value of <code>String[].<jk>class</jk>.getName()</code>)
-// * </ul>
-// *
-// * @param s The class name.
-// * @return The ClassMeta corresponding to the class name string.
-// */
-// protected final ClassMeta<?> getClassMetaFromString(String s) {
-// int d = 0;
-// if (s == null || s.isEmpty())
-// return null;
-//
-// // Check for Class.getName() on array class types.
-// if (s.charAt(0) == '[') {
-// try {
-// return getClassMeta(findClass(s));
-// } catch (ClassNotFoundException e) {
-// throw new RuntimeException(e);
-// }
-// }
-//
-// int i1 = 0;
-// int i2 = 0;
-// int dim = 0;
-// List<ClassMeta<?>> p = null;
-// for (int i = 0; i < s.length(); i++) {
-// char c = s.charAt(i);
-// if (c == '<') {
-// if (d == 0) {
-// i1 = i;
-// i2 = i+1;
-// p = new LinkedList<ClassMeta<?>>();
-// }
-// d++;
-// } else if (c == '>') {
-// d--;
-// if (d == 0 && p != null)
-// p.add(getClassMetaFromString(s.substring(i2, i)));
-// } else if (c == ',' && d == 1) {
-// if (p != null)
-// p.add(getClassMetaFromString(s.substring(i2, i)));
-// i2 = i+1;
-// }
-// if (c == '[') {
-// if (i1 == 0)
-// i1 = i;
-// dim++;
-// }
-// }
-// if (i1 == 0)
-// i1 = s.length();
-// try {
-// String name = s.substring(0, i1).trim();
-// char x = name.charAt(0);
-// Class<?> c = null;
-// if (x >= 'b' && x <= 's') {
-// if (x == 'b' && name.equals("boolean"))
-// c = boolean.class;
-// else if (x == 'b' && name.equals("byte"))
-// c = byte.class;
-// else if (x == 'c' && name.equals("char"))
-// c = char.class;
-// else if (x == 'd' && name.equals("double"))
-// c = double.class;
-// else if (x == 'i' && name.equals("int"))
-// c = int.class;
-// else if (x == 'l' && name.equals("long"))
-// c = long.class;
-// else if (x == 's' && name.equals("short"))
-// c = short.class;
-// else
-// c = findClass(name);
-// } else {
-// c = findClass(name);
-// }
-//
-// ClassMeta<?> cm = getClassMeta(c);
-//
-// if (p != null) {
-// if (cm.isMap())
-// cm = new ClassMeta(c, this).setKeyType(p.get(0)).setValueType(p.get(1));
-// if (cm.isCollection())
-// cm = new ClassMeta(c, this).setElementType(p.get(0));
-// }
-//
-// while (dim > 0) {
-// cm = new ClassMeta(Array.newInstance(cm.getInnerClass(), 0).getClass(), this);
-// dim--;
-// }
-//
-// return cm;
-// } catch (ClassNotFoundException e) {
-// throw new RuntimeException(e);
-// }
-// }
-//
-// private Class<?> findClass(String name) throws ClassNotFoundException {
-// return classLoader == null ? Class.forName(name) : Class.forName(name, true, classLoader);
-// }
-
/**
* Returns the {@link PojoSwap} associated with the specified class, or <jk>null</jk> if there is no
* pojo swap associated with the class.
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/ConfigException.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/ConfigException.java b/juneau-core/src/main/java/org/apache/juneau/ConfigException.java
index a3894e6..a9af489 100644
--- a/juneau-core/src/main/java/org/apache/juneau/ConfigException.java
+++ b/juneau-core/src/main/java/org/apache/juneau/ConfigException.java
@@ -12,9 +12,20 @@
// ***************************************************************************************************************************
package org.apache.juneau;
-class ConfigException extends FormattedRuntimeException {
+import java.text.*;
+
+/**
+ * An exception that typically occurs when trying to perform an invalid operation on a configuration property.
+ */
+public class ConfigException extends FormattedRuntimeException {
private static final long serialVersionUID = 1L;
+ /**
+ * Constructor
+ *
+ * @param message The error message.
+ * @param args Optional {@link MessageFormat}-style arguments.
+ */
public ConfigException(String message, Object...args) {
super(message, args);
}
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/ContextFactory.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/ContextFactory.java b/juneau-core/src/main/java/org/apache/juneau/ContextFactory.java
index efa69b3..fff9e21 100644
--- a/juneau-core/src/main/java/org/apache/juneau/ContextFactory.java
+++ b/juneau-core/src/main/java/org/apache/juneau/ContextFactory.java
@@ -622,7 +622,7 @@ public final class ContextFactory extends Lockable {
* @param def The default value if the property is not set.
*
* @return The property value.
- * @throws ConfigException - If property has a value that cannot be converted to a boolean.
+ * @throws ConfigException If property has a value that cannot be converted to a boolean.
*/
public <T> T getProperty(String name, Class<T> type, T def) {
rl.lock();
@@ -649,7 +649,7 @@ public final class ContextFactory extends Lockable {
* @param def The default value if the property is not set.
*
* @return The property value.
- * @throws ConfigException - If property has a value that cannot be converted to a boolean.
+ * @throws ConfigException If property has a value that cannot be converted to a boolean.
*/
public <K,V> Map<K,V> getMap(String name, Class<K> keyType, Class<V> valType, Map<K,V> def) {
rl.lock();
@@ -663,6 +663,7 @@ public final class ContextFactory extends Lockable {
}
}
+
//-------------------------------------------------------------------------------------
// Convenience methods.
//-------------------------------------------------------------------------------------
@@ -731,7 +732,7 @@ public final class ContextFactory extends Lockable {
* @see ContextFactory#addToProperty(String, Object)
* @see BeanContext#BEAN_beanDictionary
*/
- public ContextFactory addToDictionary(Class<?>...classes) throws LockedException {
+ public ContextFactory addToBeanDictionary(Class<?>...classes) throws LockedException {
checkLock();
addToProperty(BEAN_beanDictionary, classes);
return this;
@@ -767,6 +768,7 @@ public final class ContextFactory extends Lockable {
return c.get();
}
+
//--------------------------------------------------------------------------------
// Utility classes and methods.
//--------------------------------------------------------------------------------
[05/14] incubator-juneau git commit: Add convenience property setters
to serializers and parsers.
Posted by ja...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/parser/ParserGroup.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/parser/ParserGroup.java b/juneau-core/src/main/java/org/apache/juneau/parser/ParserGroup.java
index 800db11..6f2247b 100644
--- a/juneau-core/src/main/java/org/apache/juneau/parser/ParserGroup.java
+++ b/juneau-core/src/main/java/org/apache/juneau/parser/ParserGroup.java
@@ -73,7 +73,7 @@ public final class ParserGroup extends Lockable {
/**
* Adds the specified parser to the beginning of this group.
*
- * @param p - The parser to add to this group.
+ * @param p The parser to add to this group.
* @return This object (for method chaining).
*/
public ParserGroup append(Parser p) {
@@ -203,103 +203,727 @@ public final class ParserGroup extends Lockable {
return l;
}
+
//--------------------------------------------------------------------------------
- // Convenience methods for setting properties on all parsers.
+ // Properties
//--------------------------------------------------------------------------------
/**
- * Shortcut for calling {@link Parser#setProperty(String, Object)} on all parsers in this group.
+ * Calls {@link Parser#setTrimStrings(boolean)} on all parsers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see ParserContext#PARSER_trimStrings
+ */
+ public ParserGroup setTrimStrings(boolean value) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.setTrimStrings(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Parser#setStrict(boolean)} on all parsers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see ParserContext#PARSER_strict
+ */
+ public ParserGroup setStrict(boolean value) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.setStrict(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Parser#setInputStreamCharset(String)} on all parsers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see ParserContext#PARSER_inputStreamCharset
+ */
+ public ParserGroup setInputStreamCharset(String value) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.setInputStreamCharset(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Parser#setFileCharset(String)} on all parsers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see ParserContext#PARSER_fileCharset
+ */
+ public ParserGroup setFileCharset(String value) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.setFileCharset(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Parser#setBeansRequireDefaultConstructor(boolean)} on all parsers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beansRequireDefaultConstructor
+ */
+ public ParserGroup setBeansRequireDefaultConstructor(boolean value) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.setBeansRequireDefaultConstructor(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Parser#setBeansRequireSerializable(boolean)} on all parsers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beansRequireSerializable
+ */
+ public ParserGroup setBeansRequireSerializable(boolean value) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.setBeansRequireSerializable(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Parser#setBeansRequireSettersForGetters(boolean)} on all parsers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beansRequireSettersForGetters
+ */
+ public ParserGroup setBeansRequireSettersForGetters(boolean value) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.setBeansRequireSettersForGetters(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Parser#setBeansRequireSomeProperties(boolean)} on all parsers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beansRequireSomeProperties
+ */
+ public ParserGroup setBeansRequireSomeProperties(boolean value) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.setBeansRequireSomeProperties(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Parser#setBeanMapPutReturnsOldValue(boolean)} on all parsers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beanMapPutReturnsOldValue
+ */
+ public ParserGroup setBeanMapPutReturnsOldValue(boolean value) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.setBeanMapPutReturnsOldValue(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Parser#setBeanConstructorVisibility(Visibility)} on all parsers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beanConstructorVisibility
+ */
+ public ParserGroup setBeanConstructorVisibility(Visibility value) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.setBeanConstructorVisibility(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Parser#setBeanClassVisibility(Visibility)} on all parsers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beanClassVisibility
+ */
+ public ParserGroup setBeanClassVisibility(Visibility value) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.setBeanClassVisibility(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Parser#setBeanFieldVisibility(Visibility)} on all parsers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beanFieldVisibility
+ */
+ public ParserGroup setBeanFieldVisibility(Visibility value) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.setBeanFieldVisibility(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Parser#setMethodVisibility(Visibility)} on all parsers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_methodVisibility
+ */
+ public ParserGroup setMethodVisibility(Visibility value) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.setMethodVisibility(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Parser#setUseJavaBeanIntrospector(boolean)} on all parsers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_useJavaBeanIntrospector
+ */
+ public ParserGroup setUseJavaBeanIntrospector(boolean value) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.setUseJavaBeanIntrospector(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Parser#setUseInterfaceProxies(boolean)} on all parsers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_useInterfaceProxies
+ */
+ public ParserGroup setUseInterfaceProxies(boolean value) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.setUseInterfaceProxies(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Parser#setIgnoreUnknownBeanProperties(boolean)} on all parsers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_ignoreUnknownBeanProperties
+ */
+ public ParserGroup setIgnoreUnknownBeanProperties(boolean value) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.setIgnoreUnknownBeanProperties(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Parser#setIgnoreUnknownNullBeanProperties(boolean)} on all parsers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_ignoreUnknownNullBeanProperties
+ */
+ public ParserGroup setIgnoreUnknownNullBeanProperties(boolean value) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.setIgnoreUnknownNullBeanProperties(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Parser#setIgnorePropertiesWithoutSetters(boolean)} on all parsers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_ignorePropertiesWithoutSetters
+ */
+ public ParserGroup setIgnorePropertiesWithoutSetters(boolean value) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.setIgnorePropertiesWithoutSetters(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Parser#setIgnoreInvocationExceptionsOnGetters(boolean)} on all parsers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_ignoreInvocationExceptionsOnGetters
+ */
+ public ParserGroup setIgnoreInvocationExceptionsOnGetters(boolean value) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.setIgnoreInvocationExceptionsOnGetters(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Parser#setIgnoreInvocationExceptionsOnSetters(boolean)} on all parsers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_ignoreInvocationExceptionsOnSetters
+ */
+ public ParserGroup setIgnoreInvocationExceptionsOnSetters(boolean value) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.setIgnoreInvocationExceptionsOnSetters(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Parser#setSortProperties(boolean)} on all parsers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_sortProperties
+ */
+ public ParserGroup setSortProperties(boolean value) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.setSortProperties(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Parser#setNotBeanPackages(String...)} on all parsers in this group.
+ *
+ * @param values The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_notBeanPackages
+ */
+ public ParserGroup setNotBeanPackages(String...values) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.setNotBeanPackages(values);
+ return this;
+ }
+
+ /**
+ * Calls {@link Parser#setNotBeanPackages(Collection)} on all parsers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_notBeanPackages
+ */
+ public ParserGroup setNotBeanPackages(Collection<String> value) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.setNotBeanPackages(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Parser#addNotBeanPackages(String...)} on all parsers in this group.
+ *
+ * @param values The values to remove from this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_notBeanPackages
+ * @see BeanContext#BEAN_notBeanPackages_remove
+ */
+ public ParserGroup addNotBeanPackages(String...values) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.addNotBeanPackages(values);
+ return this;
+ }
+
+ /**
+ * Calls {@link Parser#addNotBeanPackages(Collection)} on all parsers in this group.
+ *
+ * @param values The values to remove from this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_notBeanPackages
+ * @see BeanContext#BEAN_notBeanPackages_remove
+ */
+ public ParserGroup addNotBeanPackages(Collection<String> values) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.addNotBeanPackages(values);
+ return this;
+ }
+
+ /**
+ * Calls {@link Parser#removeNotBeanPackages(String...)} on all parsers in this group.
+ *
+ * @param values The values to remove from this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_notBeanPackages
+ * @see BeanContext#BEAN_notBeanPackages_remove
+ */
+ public ParserGroup removeNotBeanPackages(String...values) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.removeNotBeanPackages(values);
+ return this;
+ }
+
+ /**
+ * Calls {@link Parser#removeNotBeanPackages(Collection)} on all parsers in this group.
+ *
+ * @param values The values to remove from this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_notBeanPackages
+ * @see BeanContext#BEAN_notBeanPackages_remove
+ */
+ public ParserGroup removeNotBeanPackages(Collection<String> values) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.removeNotBeanPackages(values);
+ return this;
+ }
+
+ /**
+ * Calls {@link Parser#setNotBeanClasses(Class...)} on all parsers in this group.
+ *
+ * @param values The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_notBeanClasses
+ */
+ public ParserGroup setNotBeanClasses(Class<?>...values) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.setNotBeanClasses(values);
+ return this;
+ }
+
+ /**
+ * Calls {@link Parser#setNotBeanClasses(Collection)} on all parsers in this group.
+ *
+ * @param values The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_notBeanPackages
+ */
+ public ParserGroup setNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.setNotBeanClasses(values);
+ return this;
+ }
+
+ /**
+ * Calls {@link Parser#addNotBeanClasses(Class...)} on all parsers in this group.
+ *
+ * @param values The values to add to this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_notBeanClasses
+ * @see BeanContext#BEAN_notBeanClasses_add
+ */
+ public ParserGroup addNotBeanClasses(Class<?>...values) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.addNotBeanClasses(values);
+ return this;
+ }
+
+ /**
+ * Calls {@link Parser#addNotBeanClasses(Collection)} on all parsers in this group.
+ *
+ * @param values The values to add to this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_notBeanClasses
+ * @see BeanContext#BEAN_notBeanClasses_add
+ */
+ public ParserGroup addNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.addNotBeanClasses(values);
+ return this;
+ }
+
+ /**
+ * Calls {@link Parser#removeNotBeanClasses(Class...)} on all parsers in this group.
*
- * @param property The property name.
- * @param value The property value.
- * @throws LockedException If {@link #lock()} was called on this object.
+ * @param values The values to remove from this property.
* @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_notBeanClasses
+ * @see BeanContext#BEAN_notBeanClasses_remove
*/
- public ParserGroup setProperty(String property, Object value) throws LockedException {
+ public ParserGroup removeNotBeanClasses(Class<?>...values) throws LockedException {
checkLock();
for (Parser p : parsers)
- p.setProperty(property, value);
+ p.removeNotBeanClasses(values);
return this;
}
/**
- * Shortcut for calling {@link Parser#setProperties(ObjectMap)} on all parsers in this group.
+ * Calls {@link Parser#removeNotBeanClasses(Collection)} on all parsers in this group.
*
- * @param properties The properties to set. Ignored if <jk>null</jk>.
- * @throws LockedException If {@link #lock()} was called on this object.
+ * @param values The values to remove from this property.
* @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_notBeanClasses
+ * @see BeanContext#BEAN_notBeanClasses_remove
*/
- public ParserGroup setProperties(ObjectMap properties) {
+ public ParserGroup removeNotBeanClasses(Collection<Class<?>> values) throws LockedException {
checkLock();
for (Parser p : parsers)
- p.setProperties(properties);
+ p.removeNotBeanClasses(values);
+ return this;
+ }
+
+ /**
+ * Calls {@link Parser#setBeanFilters(Class...)} on all parsers in this group.
+ *
+ * @param values The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beanFilters
+ */
+ public ParserGroup setBeanFilters(Class<?>...values) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.setBeanFilters(values);
+ return this;
+ }
+
+ /**
+ * Calls {@link Parser#setBeanFilters(Collection)} on all parsers in this group.
+ *
+ * @param values The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beanFilters
+ */
+ public ParserGroup setBeanFilters(Collection<Class<?>> values) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.setBeanFilters(values);
+ return this;
+ }
+
+ /**
+ * Calls {@link Parser#addBeanFilters(Class...)} on all parsers in this group.
+ *
+ * @param values The values to add to this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beanFilters
+ * @see BeanContext#BEAN_beanFilters_add
+ */
+ public ParserGroup addBeanFilters(Class<?>...values) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.addBeanFilters(values);
+ return this;
+ }
+
+ /**
+ * Calls {@link Parser#addBeanFilters(Collection)} on all parsers in this group.
+ *
+ * @param values The values to add to this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beanFilters
+ * @see BeanContext#BEAN_beanFilters_add
+ */
+ public ParserGroup addBeanFilters(Collection<Class<?>> values) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.addBeanFilters(values);
+ return this;
+ }
+
+ /**
+ * Calls {@link Parser#removeBeanFilters(Class...)} on all parsers in this group.
+ *
+ * @param values The values to remove from this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beanFilters
+ * @see BeanContext#BEAN_beanFilters_remove
+ */
+ public ParserGroup removeBeanFilters(Class<?>...values) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.removeBeanFilters(values);
+ return this;
+ }
+
+ /**
+ * Calls {@link Parser#removeBeanFilters(Collection)} on all parsers in this group.
+ *
+ * @param values The values to remove from this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beanFilters
+ * @see BeanContext#BEAN_beanFilters_remove
+ */
+ public ParserGroup removeBeanFilters(Collection<Class<?>> values) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.removeBeanFilters(values);
+ return this;
+ }
+
+ /**
+ * Calls {@link Parser#setPojoSwaps(Class...)} on all parsers in this group.
+ *
+ * @param values The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_pojoSwaps
+ */
+ public ParserGroup setPojoSwaps(Class<?>...values) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.setPojoSwaps(values);
+ return this;
+ }
+
+ /**
+ * Calls {@link Parser#setPojoSwaps(Collection)} on all parsers in this group.
+ *
+ * @param values The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_pojoSwaps
+ */
+ public ParserGroup setPojoSwaps(Collection<Class<?>> values) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.setPojoSwaps(values);
+ return this;
+ }
+
+ /**
+ * Calls {@link Parser#addPojoSwaps(Class...)} on all parsers in this group.
+ *
+ * @param values The values to add to this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_pojoSwaps
+ * @see BeanContext#BEAN_pojoSwaps_add
+ */
+ public ParserGroup addPojoSwaps(Class<?>...values) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.addPojoSwaps(values);
return this;
}
/**
- * Shortcut for calling {@link Parser#addNotBeanClasses(Class[])} on all parsers in this group.
+ * Calls {@link Parser#addPojoSwaps(Collection)} on all parsers in this group.
*
- * @param classes The classes to specify as not-beans to the underlying bean context of all parsers in this group.
- * @throws LockedException If {@link #lock()} was called on this object.
+ * @param values The values to add to this property.
* @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_pojoSwaps
+ * @see BeanContext#BEAN_pojoSwaps_add
*/
- public ParserGroup addNotBeanClasses(Class<?>...classes) throws LockedException {
+ public ParserGroup addPojoSwaps(Collection<Class<?>> values) throws LockedException {
checkLock();
for (Parser p : parsers)
- p.addNotBeanClasses(classes);
+ p.addPojoSwaps(values);
return this;
}
/**
- * Shortcut for calling {@link Parser#addBeanFilters(Class[])} on all parsers in this group.
+ * Calls {@link Parser#removePojoSwaps(Class...)} on all parsers in this group.
*
- * @param classes The classes to add bean filters for to the underlying bean context of all parsers in this group.
- * @throws LockedException If {@link #lock()} was called on this object.
+ * @param values The values to remove from this property.
* @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_pojoSwaps
+ * @see BeanContext#BEAN_pojoSwaps_remove
*/
- public ParserGroup addBeanFilters(Class<?>...classes) throws LockedException {
+ public ParserGroup removePojoSwaps(Class<?>...values) throws LockedException {
checkLock();
for (Parser p : parsers)
- p.addBeanFilters(classes);
+ p.removePojoSwaps(values);
return this;
}
/**
- * Shortcut for calling {@link Parser#addPojoSwaps(Class[])} on all parsers in this group.
+ * Calls {@link Parser#removePojoSwaps(Collection)} on all parsers in this group.
*
- * @param classes The classes to add POJO swaps for to the underlying bean context of all parsers in this group.
- * @throws LockedException If {@link #lock()} was called on this object.
+ * @param values The values to remove from this property.
* @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_pojoSwaps
+ * @see BeanContext#BEAN_pojoSwaps_remove
*/
- public ParserGroup addPojoSwaps(Class<?>...classes) throws LockedException {
+ public ParserGroup removePojoSwaps(Collection<Class<?>> values) throws LockedException {
checkLock();
for (Parser p : parsers)
- p.addPojoSwaps(classes);
+ p.removePojoSwaps(values);
return this;
}
/**
- * Shortcut for calling {@link Parser#addToDictionary(Class[])} on all parsers in this group.
+ * Calls {@link Parser#setImplClasses(Map)} on all parsers in this group.
*
- * @param classes The classes to add to the bean dictionary on the underlying bean context of all parsers in this group.
- * @throws LockedException If {@link #lock()} was called on this object.
+ * @param values The new value for this property.
* @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_implClasses
*/
- public ParserGroup addToDictionary(Class<?>...classes) throws LockedException {
+ public ParserGroup setImplClasses(Map<Class<?>,Class<?>> values) throws LockedException {
checkLock();
for (Parser p : parsers)
- p.addToDictionary(classes);
+ p.setImplClasses(values);
return this;
}
/**
- * Shortcut for calling {@link Parser#addImplClass(Class, Class)} on all parsers in this group.
+ * Calls {@link Parser#addImplClass(Class,Class)} on all parsers in this group.
*
- * @param <T> The interface or abstract class type.
- * @param interfaceClass The interface or abstract class.
+ * @param interfaceClass The interface class.
* @param implClass The implementation class.
- * @throws LockedException If {@link #lock()} was called on this object.
+ * @param <T> The class type of the interface.
* @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_implClasses
+ * @see BeanContext#BEAN_implClasses_put
*/
public <T> ParserGroup addImplClass(Class<T> interfaceClass, Class<? extends T> implClass) throws LockedException {
checkLock();
@@ -308,11 +932,308 @@ public final class ParserGroup extends Lockable {
return this;
}
+ /**
+ * Calls {@link Parser#setBeanDictionary(Class...)} on all parsers in this group.
+ *
+ * @param values The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beanDictionary
+ */
+ public ParserGroup setBeanDictionary(Class<?>...values) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.setBeanDictionary(values);
+ return this;
+ }
+
+ /**
+ * Calls {@link Parser#setBeanDictionary(Collection)} on all parsers in this group.
+ *
+ * @param values The values to add to this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beanDictionary
+ * @see BeanContext#BEAN_beanDictionary_add
+ */
+ public ParserGroup setBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.setBeanDictionary(values);
+ return this;
+ }
+
+ /**
+ * Calls {@link Parser#addToBeanDictionary(Class...)} on all parsers in this group.
+ *
+ * @param values The values to add to this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beanDictionary
+ * @see BeanContext#BEAN_beanDictionary_add
+ */
+ public ParserGroup addToBeanDictionary(Class<?>...values) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.addToBeanDictionary(values);
+ return this;
+ }
+
+ /**
+ * Calls {@link Parser#addToBeanDictionary(Collection)} on all parsers in this group.
+ *
+ * @param values The values to add to this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beanDictionary
+ * @see BeanContext#BEAN_beanDictionary_add
+ */
+ public ParserGroup addToBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.addToBeanDictionary(values);
+ return this;
+ }
+
+ /**
+ * Calls {@link Parser#removeFromBeanDictionary(Class...)} on all parsers in this group.
+ *
+ * @param values The values to remove from this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beanDictionary
+ * @see BeanContext#BEAN_beanDictionary_remove
+ */
+ public ParserGroup removeFromBeanDictionary(Class<?>...values) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.removeFromBeanDictionary(values);
+ return this;
+ }
+
+ /**
+ * Calls {@link Parser#removeFromBeanDictionary(Collection)} on all parsers in this group.
+ *
+ * @param values The values to remove from this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beanDictionary
+ * @see BeanContext#BEAN_beanDictionary_remove
+ */
+ public ParserGroup removeFromBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.removeFromBeanDictionary(values);
+ return this;
+ }
+
+ /**
+ * Calls {@link Parser#setBeanTypePropertyName(String)} on all parsers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_beanTypePropertyName
+ */
+ public ParserGroup setBeanTypePropertyName(String value) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.setBeanTypePropertyName(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Parser#setDefaultParser(Class)} on all parsers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_defaultParser
+ */
+ public ParserGroup setDefaultParser(Class<?> value) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.setDefaultParser(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Parser#setLocale(Locale)} on all parsers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_locale
+ */
+ public ParserGroup setLocale(Locale value) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.setLocale(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Parser#setTimeZone(TimeZone)} on all parsers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_timeZone
+ */
+ public ParserGroup setTimeZone(TimeZone value) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.setTimeZone(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Parser#setMediaType(MediaType)} on all parsers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_mediaType
+ */
+ public ParserGroup setMediaType(MediaType value) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.setMediaType(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Parser#setDebug(boolean)} on all parsers in this group.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see BeanContext#BEAN_debug
+ */
+ public ParserGroup setDebug(boolean value) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.setDebug(value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Parser#setProperty(String,Object)} on all parsers in this group.
+ *
+ * @param name The property name.
+ * @param value The property value.
+ * @return This class (for method chaining).
+ * @throws LockedException If {@link #lock()} has been called on this object or {@link ContextFactory} object.
+ * @see ContextFactory#setProperty(String, Object)
+ */
+ public ParserGroup setProperty(String name, Object value) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.setProperty(name, value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Parser#setProperties(ObjectMap)} on all parsers in this group.
+ *
+ * @param properties The properties to set on this class.
+ * @return This class (for method chaining).
+ * @throws LockedException If {@link #lock()} has been called on this object.
+ * @see ContextFactory#setProperties(java.util.Map)
+ */
+ public ParserGroup setProperties(ObjectMap properties) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.setProperties(properties);
+ return this;
+ }
+
+ /**
+ * Calls {@link Parser#addToProperty(String,Object)} on all parsers in this group.
+ *
+ * @param name The property name.
+ * @param value The new value to add to the SET property.
+ * @return This object (for method chaining).
+ * @throws ConfigException If property is not a SET property.
+ * @throws LockedException If {@link #lock()} has been called on this object.
+ */
+ public ParserGroup addToProperty(String name, Object value) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.addToProperty(name, value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Parser#putToProperty(String,Object,Object)} on all parsers in this group.
+ *
+ * @param name The property name.
+ * @param key The property value map key.
+ * @param value The property value map value.
+ * @return This object (for method chaining).
+ * @throws ConfigException If property is not a MAP property.
+ * @throws LockedException If {@link #lock()} has been called on this object.
+ */
+ public ParserGroup putToProperty(String name, Object key, Object value) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.putToProperty(name, key, value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Parser#putToProperty(String,Object)} on all parsers in this group.
+ *
+ * @param name The property value.
+ * @param value The property value map value.
+ * @return This object (for method chaining).
+ * @throws ConfigException If property is not a MAP property.
+ * @throws LockedException If {@link #lock()} has been called on this object.
+ */
+ public ParserGroup putToProperty(String name, Object value) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.putToProperty(name, value);
+ return this;
+ }
+
+ /**
+ * Calls {@link Parser#removeFromProperty(String,Object)} on all parsers in this group.
+ *
+ * @param name The property name.
+ * @param value The property value in the SET property.
+ * @return This object (for method chaining).
+ * @throws ConfigException If property is not a SET property.
+ * @throws LockedException If {@link #lock()} has been called on this object.
+ */
+ public ParserGroup removeFromProperty(String name, Object value) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.removeFromProperty(name, value);
+ return this;
+ }
+
+
//--------------------------------------------------------------------------------
// Overridden methods
//--------------------------------------------------------------------------------
/**
+ * Calls {@link Parser#setClassLoader(ClassLoader)} on all parsers in this group.
+ *
+ * @param classLoader The new classloader.
+ * @throws LockedException If {@link ContextFactory#lock()} was called on this class or the bean context.
+ * @return This object (for method chaining).
+ * @see ContextFactory#setClassLoader(ClassLoader)
+ */
+ public ParserGroup setClassLoader(ClassLoader classLoader) throws LockedException {
+ checkLock();
+ for (Parser p : parsers)
+ p.setClassLoader(classLoader);
+ return this;
+ }
+
+ /**
* Locks this group and all parsers in this group.
*/
@Override /* Lockable */
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/parser/ParserMatch.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/parser/ParserMatch.java b/juneau-core/src/main/java/org/apache/juneau/parser/ParserMatch.java
index a7ee50e..a08c07a 100644
--- a/juneau-core/src/main/java/org/apache/juneau/parser/ParserMatch.java
+++ b/juneau-core/src/main/java/org/apache/juneau/parser/ParserMatch.java
@@ -25,8 +25,8 @@ public final class ParserMatch {
/**
* Constructor.
*
- * @param mediaType - The media type of the match.
- * @param parser - The parser that matched.
+ * @param mediaType The media type of the match.
+ * @param parser The parser that matched.
*/
public ParserMatch(MediaType mediaType, Parser parser) {
this.mediaType = mediaType;
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/serializer/OutputStreamSerializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/serializer/OutputStreamSerializer.java b/juneau-core/src/main/java/org/apache/juneau/serializer/OutputStreamSerializer.java
index 9fddf75..0c8f215 100644
--- a/juneau-core/src/main/java/org/apache/juneau/serializer/OutputStreamSerializer.java
+++ b/juneau-core/src/main/java/org/apache/juneau/serializer/OutputStreamSerializer.java
@@ -41,6 +41,7 @@ public abstract class OutputStreamSerializer extends Serializer {
return false;
}
+
//--------------------------------------------------------------------------------
// Other methods
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/serializer/Serializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/serializer/Serializer.java b/juneau-core/src/main/java/org/apache/juneau/serializer/Serializer.java
index ccd0cc8..ac43ecb 100644
--- a/juneau-core/src/main/java/org/apache/juneau/serializer/Serializer.java
+++ b/juneau-core/src/main/java/org/apache/juneau/serializer/Serializer.java
@@ -12,6 +12,8 @@
// ***************************************************************************************************************************
package org.apache.juneau.serializer;
+import static org.apache.juneau.serializer.SerializerContext.*;
+
import java.io.*;
import java.lang.reflect.*;
import java.text.*;
@@ -283,47 +285,849 @@ public abstract class Serializer extends CoreApi {
return contentType;
}
+
//--------------------------------------------------------------------------------
- // Overridden methods
+ // Properties
//--------------------------------------------------------------------------------
+ /**
+ * <b>Configuration property:</b> Max serialization depth.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"Serializer.maxDepth"</js>
+ * <li><b>Data type:</b> <code>Integer</code>
+ * <li><b>Default:</b> <code>100</code>
+ * <li><b>Session-overridable:</b> <jk>true</jk>
+ * </ul>
+ * <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.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>SERIALIZER_maxDepth</jsf>, value)</code>.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see SerializerContext#SERIALIZER_maxDepth
+ */
+ public Serializer setMaxDepth(int value) throws LockedException {
+ return setProperty(SERIALIZER_maxDepth, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> Initial depth.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"Serializer.initialDepth"</js>
+ * <li><b>Data type:</b> <code>Integer</code>
+ * <li><b>Default:</b> <code>0</code>
+ * <li><b>Session-overridable:</b> <jk>true</jk>
+ * </ul>
+ * <p>
+ * The initial indentation level at the root.
+ * Useful when constructing document fragments that need to be indented at a certain level.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>SERIALIZER_initialDepth</jsf>, value)</code>.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see SerializerContext#SERIALIZER_initialDepth
+ */
+ public Serializer setInitialDepth(int value) throws LockedException {
+ return setProperty(SERIALIZER_initialDepth, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> Automatically detect POJO recursions.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"Serializer.detectRecursions"</js>
+ * <li><b>Data type:</b> <code>Boolean</code>
+ * <li><b>Default:</b> <jk>false</jk>
+ * <li><b>Session-overridable:</b> <jk>true</jk>
+ * </ul>
+ * <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.
+ * <p>
+ * The behavior when recursions are detected depends on the value for {@link SerializerContext#SERIALIZER_ignoreRecursions}.
+ * <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><br>
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>SERIALIZER_detectRecursions</jsf>, value)</code>.
+ * <li>Checking for recursion can cause a small performance penalty.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see SerializerContext#SERIALIZER_detectRecursions
+ */
+ public Serializer setDetectRecursions(boolean value) throws LockedException {
+ return setProperty(SERIALIZER_detectRecursions, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> Ignore recursion errors.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"Serializer.ignoreRecursions"</js>
+ * <li><b>Data type:</b> <code>Boolean</code>
+ * <li><b>Default:</b> <jk>false</jk>
+ * <li><b>Session-overridable:</b> <jk>true</jk>
+ * </ul>
+ * <p>
+ * Used in conjunction with {@link SerializerContext#SERIALIZER_detectRecursions}.
+ * 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.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>SERIALIZER_ignoreRecursions</jsf>, value)</code>.
+ * <li>Checking for recursion can cause a small performance penalty.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see SerializerContext#SERIALIZER_ignoreRecursions
+ */
+ public Serializer setIgnoreRecursions(boolean value) throws LockedException {
+ return setProperty(SERIALIZER_ignoreRecursions, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> Use indentation.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"Serializer.useIndentation"</js>
+ * <li><b>Data type:</b> <code>Boolean</code>
+ * <li><b>Default:</b> <jk>false</jk>
+ * <li><b>Session-overridable:</b> <jk>true</jk>
+ * </ul>
+ * <p>
+ * If <jk>true</jk>, newlines and indentation is added to the output to improve readability.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>SERIALIZER_useIndentation</jsf>, value)</code>.
+ * <li>Checking for recursion can cause a small performance penalty.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see SerializerContext#SERIALIZER_useIndentation
+ */
+ public Serializer setUseIndentation(boolean value) throws LockedException {
+ return setProperty(SERIALIZER_useIndentation, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> Add <js>"_type"</js> properties when needed.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"Serializer.addBeanTypeProperties"</js>
+ * <li><b>Data type:</b> <code>Boolean</code>
+ * <li><b>Default:</b> <jk>false</jk>
+ * <li><b>Session-overridable:</b> <jk>true</jk>
+ * </ul>
+ * <p>
+ * If <jk>true</jk>, then <js>"_type"</js> properties will be added to beans if their type cannot be inferred through reflection.
+ * 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.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>SERIALIZER_addBeanTypeProperties</jsf>, value)</code>.
+ * <li>Checking for recursion can cause a small performance penalty.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see SerializerContext#SERIALIZER_addBeanTypeProperties
+ */
+ public Serializer setAddBeanTypeProperties(boolean value) throws LockedException {
+ return setProperty(SERIALIZER_addBeanTypeProperties, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> Quote character.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"Serializer.quoteChar"</js>
+ * <li><b>Data type:</b> <code>Character</code>
+ * <li><b>Default:</b> <js>'"'</js>
+ * <li><b>Session-overridable:</b> <jk>true</jk>
+ * </ul>
+ * <p>
+ * This is the character used for quoting attributes and values.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>SERIALIZER_quoteChar</jsf>, value)</code>.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see SerializerContext#SERIALIZER_quoteChar
+ */
+ public Serializer setQuoteChar(char value) throws LockedException {
+ return setProperty(SERIALIZER_quoteChar, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> Trim null bean property values.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"Serializer.trimNullProperties"</js>
+ * <li><b>Data type:</b> <code>Boolean</code>
+ * <li><b>Default:</b> <jk>true</jk>
+ * <li><b>Session-overridable:</b> <jk>true</jk>
+ * </ul>
+ * <p>
+ * If <jk>true</jk>, null bean values will not be serialized to the output.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>SERIALIZER_trimNullProperties</jsf>, value)</code>.
+ * <li>Enabling this setting has the following effects on parsing:
+ * <ul>
+ * <li>Map entries with <jk>null</jk> values will be lost.
+ * </ul>
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see SerializerContext#SERIALIZER_trimNullProperties
+ */
+ public Serializer setTrimNullProperties(boolean value) throws LockedException {
+ return setProperty(SERIALIZER_trimNullProperties, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> Trim empty lists and arrays.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"Serializer.trimEmptyLists"</js>
+ * <li><b>Data type:</b> <code>Boolean</code>
+ * <li><b>Default:</b> <jk>false</jk>
+ * <li><b>Session-overridable:</b> <jk>true</jk>
+ * </ul>
+ * <p>
+ * If <jk>true</jk>, empty list values will not be serialized to the output.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>SERIALIZER_trimEmptyCollections</jsf>, value)</code>.
+ * <li>Enabling this setting has the following effects on parsing:
+ * <ul>
+ * <li>Map entries with empty list values will be lost.
+ * <li>Bean properties with empty list values will not be set.
+ * </ul>
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see SerializerContext#SERIALIZER_trimEmptyCollections
+ */
+ public Serializer setTrimEmptyCollections(boolean value) throws LockedException {
+ return setProperty(SERIALIZER_trimEmptyCollections, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> Trim empty maps.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"Serializer.trimEmptyMaps"</js>
+ * <li><b>Data type:</b> <code>Boolean</code>
+ * <li><b>Default:</b> <jk>false</jk>
+ * <li><b>Session-overridable:</b> <jk>true</jk>
+ * </ul>
+ * <p>
+ * If <jk>true</jk>, empty map values will not be serialized to the output.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>SERIALIZER_trimEmptyMaps</jsf>, value)</code>.
+ * <li>Enabling this setting has the following effects on parsing:
+ * <ul>
+ * <li>Bean properties with empty map values will not be set.
+ * </ul>
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see SerializerContext#SERIALIZER_trimEmptyMaps
+ */
+ public Serializer setTrimEmptyMaps(boolean value) throws LockedException {
+ return setProperty(SERIALIZER_trimEmptyMaps, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> Trim strings.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"Serializer.trimStrings"</js>
+ * <li><b>Data type:</b> <code>Boolean</code>
+ * <li><b>Default:</b> <jk>false</jk>
+ * <li><b>Session-overridable:</b> <jk>true</jk>
+ * </ul>
+ * <p>
+ * If <jk>true</jk>, string values will be trimmed of whitespace using {@link String#trim()} before being serialized.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>SERIALIZER_trimStrings</jsf>, value)</code>.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see SerializerContext#SERIALIZER_trimStrings
+ */
+ public Serializer setTrimStrings(boolean value) throws LockedException {
+ return setProperty(SERIALIZER_trimStrings, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> URI base for relative URIs.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"Serializer.relativeUriBase"</js>
+ * <li><b>Data type:</b> <code>String</code>
+ * <li><b>Default:</b> <js>""</js>
+ * <li><b>Session-overridable:</b> <jk>true</jk>
+ * </ul>
+ * <p>
+ * Prepended to relative URIs during serialization (along with the {@link SerializerContext#SERIALIZER_absolutePathUriBase} if specified.
+ * (i.e. URIs not containing a schema and not starting with <js>'/'</js>).
+ * (e.g. <js>"foo/bar"</js>)
+ *
+ * <h5 class='section'>Example:</h5>
+ * <table class='styled'>
+ * <tr><th>SERIALIZER_relativeUriBase</th><th>URI</th><th>Serialized URI</th></tr>
+ * <tr>
+ * <td><code>http://foo:9080/bar/baz</code></td>
+ * <td><code>mywebapp</code></td>
+ * <td><code>http://foo:9080/bar/baz/mywebapp</code></td>
+ * </tr>
+ * <tr>
+ * <td><code>http://foo:9080/bar/baz</code></td>
+ * <td><code>/mywebapp</code></td>
+ * <td><code>/mywebapp</code></td>
+ * </tr>
+ * <tr>
+ * <td><code>http://foo:9080/bar/baz</code></td>
+ * <td><code>http://mywebapp</code></td>
+ * <td><code>http://mywebapp</code></td>
+ * </tr>
+ * </table>
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>SERIALIZER_relativeUriBase</jsf>, value)</code>.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see SerializerContext#SERIALIZER_relativeUriBase
+ */
+ public Serializer setRelativeUriBase(String value) throws LockedException {
+ return setProperty(SERIALIZER_relativeUriBase, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> URI base for relative URIs with absolute paths.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"Serializer.absolutePathUriBase"</js>
+ * <li><b>Data type:</b> <code>String</code>
+ * <li><b>Default:</b> <js>""</js>
+ * <li><b>Session-overridable:</b> <jk>true</jk>
+ * </ul>
+ * <p>
+ * Prepended to relative absolute-path URIs during serialization.
+ * (i.e. URIs starting with <js>'/'</js>).
+ * (e.g. <js>"/foo/bar"</js>)
+ *
+ * <h5 class='section'>Examples:</h5>
+ * <table class='styled'>
+ * <tr><th>SERIALIZER_absolutePathUriBase</th><th>URI</th><th>Serialized URI</th></tr>
+ * <tr>
+ * <td><code>http://foo:9080/bar/baz</code></td>
+ * <td><code>mywebapp</code></td>
+ * <td><code>mywebapp</code></td>
+ * </tr>
+ * <tr>
+ * <td><code>http://foo:9080/bar/baz</code></td>
+ * <td><code>/mywebapp</code></td>
+ * <td><code>http://foo:9080/bar/baz/mywebapp</code></td>
+ * </tr>
+ * <tr>
+ * <td><code>http://foo:9080/bar/baz</code></td>
+ * <td><code>http://mywebapp</code></td>
+ * <td><code>http://mywebapp</code></td>
+ * </tr>
+ * </table>
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>SERIALIZER_absolutePathUriBase</jsf>, value)</code>.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see SerializerContext#SERIALIZER_absolutePathUriBase
+ */
+ public Serializer setAbsolutePathUriBase(String value) throws LockedException {
+ return setProperty(SERIALIZER_absolutePathUriBase, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> Sort arrays and collections alphabetically.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"Serializer.sortCollections"</js>
+ * <li><b>Data type:</b> <code>Boolean</code>
+ * <li><b>Default:</b> <jk>false</jk>
+ * <li><b>Session-overridable:</b> <jk>true</jk>
+ * </ul>
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>SERIALIZER_sortCollections</jsf>, value)</code>.
+ * <li>This introduces a slight performance penalty.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see SerializerContext#SERIALIZER_sortCollections
+ */
+ public Serializer setSortCollections(boolean value) throws LockedException {
+ return setProperty(SERIALIZER_sortCollections, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> Sort maps alphabetically.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"Serializer.sortMaps"</js>
+ * <li><b>Data type:</b> <code>Boolean</code>
+ * <li><b>Default:</b> <jk>false</jk>
+ * <li><b>Session-overridable:</b> <jk>true</jk>
+ * </ul>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>SERIALIZER_sortMaps</jsf>, value)</code>.
+ * <li>This introduces a slight performance penalty.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see SerializerContext#SERIALIZER_sortMaps
+ */
+ public Serializer setSortMaps(boolean value) throws LockedException {
+ return setProperty(SERIALIZER_sortMaps, value);
+ }
+
+ @Override /* CoreApi */
+ public Serializer setBeansRequireDefaultConstructor(boolean value) throws LockedException {
+ super.setBeansRequireDefaultConstructor(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Serializer setBeansRequireSerializable(boolean value) throws LockedException {
+ super.setBeansRequireSerializable(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Serializer setBeansRequireSettersForGetters(boolean value) throws LockedException {
+ super.setBeansRequireSettersForGetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Serializer setBeansRequireSomeProperties(boolean value) throws LockedException {
+ super.setBeansRequireSomeProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Serializer setBeanMapPutReturnsOldValue(boolean value) throws LockedException {
+ super.setBeanMapPutReturnsOldValue(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Serializer setBeanConstructorVisibility(Visibility value) throws LockedException {
+ super.setBeanConstructorVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Serializer setBeanClassVisibility(Visibility value) throws LockedException {
+ super.setBeanClassVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Serializer setBeanFieldVisibility(Visibility value) throws LockedException {
+ super.setBeanFieldVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Serializer setMethodVisibility(Visibility value) throws LockedException {
+ super.setMethodVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Serializer setUseJavaBeanIntrospector(boolean value) throws LockedException {
+ super.setUseJavaBeanIntrospector(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Serializer setUseInterfaceProxies(boolean value) throws LockedException {
+ super.setUseInterfaceProxies(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Serializer setIgnoreUnknownBeanProperties(boolean value) throws LockedException {
+ super.setIgnoreUnknownBeanProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Serializer setIgnoreUnknownNullBeanProperties(boolean value) throws LockedException {
+ super.setIgnoreUnknownNullBeanProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Serializer setIgnorePropertiesWithoutSetters(boolean value) throws LockedException {
+ super.setIgnorePropertiesWithoutSetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Serializer setIgnoreInvocationExceptionsOnGetters(boolean value) throws LockedException {
+ super.setIgnoreInvocationExceptionsOnGetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Serializer setIgnoreInvocationExceptionsOnSetters(boolean value) throws LockedException {
+ super.setIgnoreInvocationExceptionsOnSetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Serializer setSortProperties(boolean value) throws LockedException {
+ super.setSortProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Serializer setNotBeanPackages(String...values) throws LockedException {
+ super.setNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Serializer setNotBeanPackages(Collection<String> values) throws LockedException {
+ super.setNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Serializer addNotBeanPackages(String...values) throws LockedException {
+ super.addNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Serializer addNotBeanPackages(Collection<String> values) throws LockedException {
+ super.addNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Serializer removeNotBeanPackages(String...values) throws LockedException {
+ super.removeNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Serializer removeNotBeanPackages(Collection<String> values) throws LockedException {
+ super.removeNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Serializer setNotBeanClasses(Class<?>...values) throws LockedException {
+ super.setNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Serializer setNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ super.setNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Serializer addNotBeanClasses(Class<?>...values) throws LockedException {
+ super.addNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Serializer addNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ super.addNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Serializer removeNotBeanClasses(Class<?>...values) throws LockedException {
+ super.removeNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Serializer removeNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ super.removeNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Serializer setBeanFilters(Class<?>...values) throws LockedException {
+ super.setBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Serializer setBeanFilters(Collection<Class<?>> values) throws LockedException {
+ super.setBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Serializer addBeanFilters(Class<?>...values) throws LockedException {
+ super.addBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Serializer addBeanFilters(Collection<Class<?>> values) throws LockedException {
+ super.addBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Serializer removeBeanFilters(Class<?>...values) throws LockedException {
+ super.removeBeanFilters(values);
+ return this;
+ }
+
@Override /* CoreApi */
- public Serializer setProperty(String property, Object value) throws LockedException {
- super.setProperty(property, value);
+ public Serializer removeBeanFilters(Collection<Class<?>> values) throws LockedException {
+ super.removeBeanFilters(values);
return this;
}
@Override /* CoreApi */
- public Serializer addNotBeanClasses(Class<?>...classes) throws LockedException {
- super.addNotBeanClasses(classes);
+ public Serializer setPojoSwaps(Class<?>...values) throws LockedException {
+ super.setPojoSwaps(values);
return this;
}
@Override /* CoreApi */
- public Serializer addBeanFilters(Class<?>...classes) throws LockedException {
- super.addBeanFilters(classes);
+ public Serializer setPojoSwaps(Collection<Class<?>> values) throws LockedException {
+ super.setPojoSwaps(values);
return this;
}
@Override /* CoreApi */
- public Serializer addPojoSwaps(Class<?>...classes) throws LockedException {
- super.addPojoSwaps(classes);
+ public Serializer addPojoSwaps(Class<?>...values) throws LockedException {
+ super.addPojoSwaps(values);
return this;
}
@Override /* CoreApi */
- public Serializer addToDictionary(Class<?>...classes) throws LockedException {
- super.addToDictionary(classes);
+ public Serializer addPojoSwaps(Collection<Class<?>> values) throws LockedException {
+ super.addPojoSwaps(values);
return this;
}
@Override /* CoreApi */
- public <T> Serializer addImplClass(Class<T> interfaceClass, Class<? extends T> implClass) throws LockedException {
+ public Serializer removePojoSwaps(Class<?>...values) throws LockedException {
+ super.removePojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Serializer removePojoSwaps(Collection<Class<?>> values) throws LockedException {
+ super.removePojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Serializer setImplClasses(Map<Class<?>,Class<?>> values) throws LockedException {
+ super.setImplClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public <T> CoreApi addImplClass(Class<T> interfaceClass, Class<? extends T> implClass) throws LockedException {
super.addImplClass(interfaceClass, implClass);
return this;
}
@Override /* CoreApi */
+ public Serializer setBeanDictionary(Class<?>...values) throws LockedException {
+ super.setBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Serializer setBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ super.setBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Serializer addToBeanDictionary(Class<?>...values) throws LockedException {
+ super.addToBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Serializer addToBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ super.addToBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Serializer removeFromBeanDictionary(Class<?>...values) throws LockedException {
+ super.removeFromBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Serializer removeFromBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ super.removeFromBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Serializer setBeanTypePropertyName(String value) throws LockedException {
+ super.setBeanTypePropertyName(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Serializer setDefaultParser(Class<?> value) throws LockedException {
+ super.setDefaultParser(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Serializer setLocale(Locale value) throws LockedException {
+ super.setLocale(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Serializer setTimeZone(TimeZone value) throws LockedException {
+ super.setTimeZone(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Serializer setMediaType(MediaType value) throws LockedException {
+ super.setMediaType(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Serializer setDebug(boolean value) throws LockedException {
+ super.setDebug(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Serializer setProperty(String name, Object value) throws LockedException {
+ super.setProperty(name, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Serializer setProperties(ObjectMap properties) throws LockedException {
+ super.setProperties(properties);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Serializer addToProperty(String name, Object value) throws LockedException {
+ super.addToProperty(name, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Serializer putToProperty(String name, Object key, Object value) throws LockedException {
+ super.putToProperty(name, key, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Serializer putToProperty(String name, Object value) throws LockedException {
+ super.putToProperty(name, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Serializer removeFromProperty(String name, Object value) throws LockedException {
+ super.removeFromProperty(name, value);
+ return this;
+ }
+
+
+ //--------------------------------------------------------------------------------
+ // Overridden methods
+ //--------------------------------------------------------------------------------
+
+ @Override /* CoreApi */
public Serializer setClassLoader(ClassLoader classLoader) throws LockedException {
super.setClassLoader(classLoader);
return this;
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/serializer/SerializerContext.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/serializer/SerializerContext.java b/juneau-core/src/main/java/org/apache/juneau/serializer/SerializerContext.java
index 7031b12..7abdd45 100644
--- a/juneau-core/src/main/java/org/apache/juneau/serializer/SerializerContext.java
+++ b/juneau-core/src/main/java/org/apache/juneau/serializer/SerializerContext.java
@@ -17,116 +17,6 @@ import org.apache.juneau.internal.*;
/**
* Configurable properties common to all serializers.
- *
- * <h6 class='topic' id='ConfigProperties'>Configurable properties common to all serializers</h6>
- * <table class='styled' style='border-collapse: collapse;'>
- * <tr><th>Setting name</th><th>Description</th><th>Data type</th><th>Default value</th><th>Session overridable</th></tr>
- * <tr>
- * <td>{@link #SERIALIZER_maxDepth}</td>
- * <td>Max serialization depth.</td>
- * <td><code>Integer</code></td>
- * <td><code>100</code></td>
- * <td><jk>true</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #SERIALIZER_initialDepth}</td>
- * <td>Initial depth.</td>
- * <td><code>Integer</code></td>
- * <td><code>0</code></td>
- * <td><jk>true</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #SERIALIZER_detectRecursions}</td>
- * <td>Automatically detect POJO recursions.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>false</jk></td>
- * <td><jk>true</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #SERIALIZER_ignoreRecursions}</td>
- * <td>Ignore recursion errors.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>false</jk></td>
- * <td><jk>true</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #SERIALIZER_useIndentation}</td>
- * <td>Use indentation.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>false</jk></td>
- * <td><jk>true</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #SERIALIZER_addBeanTypeProperties}</td>
- * <td>Add <js>"_type"</js> properties when needed.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>false</jk></td>
- * <td><jk>true</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #SERIALIZER_quoteChar}</td>
- * <td>Quote character.</td>
- * <td><code>Character</code></td>
- * <td><js>'"'</js></td>
- * <td><jk>true</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #SERIALIZER_trimNullProperties}</td>
- * <td>Trim null bean property values.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>true</jk></td>
- * <td><jk>true</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #SERIALIZER_trimEmptyCollections}</td>
- * <td>Trim empty lists and arrays.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>false</jk></td>
- * <td><jk>true</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #SERIALIZER_trimEmptyMaps}</td>
- * <td>Trim empty maps.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>false</jk></td>
- * <td><jk>true</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #SERIALIZER_trimStrings}</td>
- * <td>Trim strings.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>false</jk></td>
- * <td><jk>true</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #SERIALIZER_relativeUriBase}</td>
- * <td>URI base for relative URIs.</td>
- * <td><code>String</code></td>
- * <td><js>""</js></td>
- * <td><jk>true</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #SERIALIZER_absolutePathUriBase}</td>
- * <td>URI base for relative URIs with absolute paths.</td>
- * <td><code>String</code></td>
- * <td><js>""</js></td>
- * <td><jk>true</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #SERIALIZER_sortCollections}</td>
- * <td>Sort arrays and collections alphabetically.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>false</jk></td>
- * <td><jk>true</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #SERIALIZER_sortMaps}</td>
- * <td>Sort maps alphabetically.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>false</jk></td>
- * <td><jk>true</jk></td>
- * </tr>
- * </table>
*/
public class SerializerContext extends BeanContext {
[13/14] incubator-juneau git commit: Add convenience property setters
to serializers and parsers.
Posted by ja...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core-test/src/test/java/org/apache/juneau/BeanConfigTest.java
----------------------------------------------------------------------
diff --git a/juneau-core-test/src/test/java/org/apache/juneau/BeanConfigTest.java b/juneau-core-test/src/test/java/org/apache/juneau/BeanConfigTest.java
index 24fe4a1..3757598 100755
--- a/juneau-core-test/src/test/java/org/apache/juneau/BeanConfigTest.java
+++ b/juneau-core-test/src/test/java/org/apache/juneau/BeanConfigTest.java
@@ -12,7 +12,6 @@
// ***************************************************************************************************************************
package org.apache.juneau;
-import static org.apache.juneau.BeanContext.*;
import static org.junit.Assert.*;
import java.io.*;
@@ -458,7 +457,7 @@ public class BeanConfigTest {
//====================================================================================================
@Test
public void testProxyHandler() throws Exception {
- BeanSession session = ContextFactory.create().setClassLoader(A.class.getClassLoader()).getBeanContext().createSession();
+ BeanSession session = ContextFactory.create().getBeanContext().createSession();
A f1 = (A) Proxy.newProxyInstance(this.getClass()
.getClassLoader(), new Class[] { A.class },
@@ -571,152 +570,152 @@ public class BeanConfigTest {
p2 = new JsonParser();
assertSameCache(p1, p2);
- p1.setProperty(BEAN_beansRequireDefaultConstructor, true);
+ p1.setBeansRequireDefaultConstructor(true);
assertDifferentCache(p1, p2);
- p2.setProperty(BEAN_beansRequireDefaultConstructor, true);
+ p2.setBeansRequireDefaultConstructor(true);
assertSameCache(p1, p2);
- p1.setProperty(BEAN_beansRequireSerializable, true);
+ p1.setBeansRequireSerializable(true);
assertDifferentCache(p1, p2);
- p2.setProperty(BEAN_beansRequireSerializable, true);
+ p2.setBeansRequireSerializable(true);
assertSameCache(p1, p2);
- p1.setProperty(BEAN_beansRequireSettersForGetters, true);
+ p1.setBeansRequireSettersForGetters(true);
assertDifferentCache(p1, p2);
- p2.setProperty(BEAN_beansRequireSettersForGetters, true);
+ p2.setBeansRequireSettersForGetters(true);
assertSameCache(p1, p2);
- p1.setProperty(BEAN_beansRequireSomeProperties, false);
+ p1.setBeansRequireSomeProperties(false);
assertDifferentCache(p1, p2);
- p2.setProperty(BEAN_beansRequireSomeProperties, false);
+ p2.setBeansRequireSomeProperties(false);
assertSameCache(p1, p2);
- p1.setProperty(BEAN_beanMapPutReturnsOldValue, true);
+ p1.setBeanMapPutReturnsOldValue(true);
assertDifferentCache(p1, p2);
- p2.setProperty(BEAN_beanMapPutReturnsOldValue, true);
+ p2.setBeanMapPutReturnsOldValue(true);
assertSameCache(p1, p2);
- p1.setProperty(BEAN_beanConstructorVisibility, Visibility.DEFAULT);
+ p1.setBeanConstructorVisibility(Visibility.DEFAULT);
assertDifferentCache(p1, p2);
- p2.setProperty(BEAN_beanConstructorVisibility, Visibility.DEFAULT);
+ p2.setBeanConstructorVisibility(Visibility.DEFAULT);
assertSameCache(p1, p2);
- p1.setProperty(BEAN_beanConstructorVisibility, Visibility.NONE);
+ p1.setBeanConstructorVisibility(Visibility.NONE);
assertDifferentCache(p1, p2);
- p2.setProperty(BEAN_beanConstructorVisibility, Visibility.NONE);
+ p2.setBeanConstructorVisibility(Visibility.NONE);
assertSameCache(p1, p2);
- p1.setProperty(BEAN_beanConstructorVisibility, Visibility.PRIVATE);
+ p1.setBeanConstructorVisibility(Visibility.PRIVATE);
assertDifferentCache(p1, p2);
- p2.setProperty(BEAN_beanConstructorVisibility, Visibility.PRIVATE);
+ p2.setBeanConstructorVisibility(Visibility.PRIVATE);
assertSameCache(p1, p2);
- p1.setProperty(BEAN_beanConstructorVisibility, Visibility.PROTECTED);
+ p1.setBeanConstructorVisibility(Visibility.PROTECTED);
assertDifferentCache(p1, p2);
- p2.setProperty(BEAN_beanConstructorVisibility, Visibility.PROTECTED);
+ p2.setBeanConstructorVisibility(Visibility.PROTECTED);
assertSameCache(p1, p2);
- p1.setProperty(BEAN_beanClassVisibility, Visibility.DEFAULT);
+ p1.setBeanClassVisibility(Visibility.DEFAULT);
assertDifferentCache(p1, p2);
- p2.setProperty(BEAN_beanClassVisibility, Visibility.DEFAULT);
+ p2.setBeanClassVisibility(Visibility.DEFAULT);
assertSameCache(p1, p2);
- p1.setProperty(BEAN_beanClassVisibility, Visibility.NONE);
+ p1.setBeanClassVisibility(Visibility.NONE);
assertDifferentCache(p1, p2);
- p2.setProperty(BEAN_beanClassVisibility, Visibility.NONE);
+ p2.setBeanClassVisibility(Visibility.NONE);
assertSameCache(p1, p2);
- p1.setProperty(BEAN_beanClassVisibility, Visibility.PRIVATE);
+ p1.setBeanClassVisibility(Visibility.PRIVATE);
assertDifferentCache(p1, p2);
- p2.setProperty(BEAN_beanClassVisibility, Visibility.PRIVATE);
+ p2.setBeanClassVisibility(Visibility.PRIVATE);
assertSameCache(p1, p2);
- p1.setProperty(BEAN_beanClassVisibility, Visibility.PROTECTED);
+ p1.setBeanClassVisibility(Visibility.PROTECTED);
assertDifferentCache(p1, p2);
- p2.setProperty(BEAN_beanClassVisibility, Visibility.PROTECTED);
+ p2.setBeanClassVisibility(Visibility.PROTECTED);
assertSameCache(p1, p2);
- p1.setProperty(BEAN_beanFieldVisibility, Visibility.DEFAULT);
+ p1.setBeanFieldVisibility(Visibility.DEFAULT);
assertDifferentCache(p1, p2);
- p2.setProperty(BEAN_beanFieldVisibility, Visibility.DEFAULT);
+ p2.setBeanFieldVisibility(Visibility.DEFAULT);
assertSameCache(p1, p2);
- p1.setProperty(BEAN_beanFieldVisibility, Visibility.NONE);
+ p1.setBeanFieldVisibility(Visibility.NONE);
assertDifferentCache(p1, p2);
- p2.setProperty(BEAN_beanFieldVisibility, Visibility.NONE);
+ p2.setBeanFieldVisibility(Visibility.NONE);
assertSameCache(p1, p2);
- p1.setProperty(BEAN_beanFieldVisibility, Visibility.PRIVATE);
+ p1.setBeanFieldVisibility(Visibility.PRIVATE);
assertDifferentCache(p1, p2);
- p2.setProperty(BEAN_beanFieldVisibility, Visibility.PRIVATE);
+ p2.setBeanFieldVisibility(Visibility.PRIVATE);
assertSameCache(p1, p2);
- p1.setProperty(BEAN_beanFieldVisibility, Visibility.PROTECTED);
+ p1.setBeanFieldVisibility(Visibility.PROTECTED);
assertDifferentCache(p1, p2);
- p2.setProperty(BEAN_beanFieldVisibility, Visibility.PROTECTED);
+ p2.setBeanFieldVisibility(Visibility.PROTECTED);
assertSameCache(p1, p2);
- p1.setProperty(BEAN_methodVisibility, Visibility.DEFAULT);
+ p1.setMethodVisibility(Visibility.DEFAULT);
assertDifferentCache(p1, p2);
- p2.setProperty(BEAN_methodVisibility, Visibility.DEFAULT);
+ p2.setMethodVisibility(Visibility.DEFAULT);
assertSameCache(p1, p2);
- p1.setProperty(BEAN_methodVisibility, Visibility.NONE);
+ p1.setMethodVisibility(Visibility.NONE);
assertDifferentCache(p1, p2);
- p2.setProperty(BEAN_methodVisibility, Visibility.NONE);
+ p2.setMethodVisibility(Visibility.NONE);
assertSameCache(p1, p2);
- p1.setProperty(BEAN_methodVisibility, Visibility.PRIVATE);
+ p1.setMethodVisibility(Visibility.PRIVATE);
assertDifferentCache(p1, p2);
- p2.setProperty(BEAN_methodVisibility, Visibility.PRIVATE);
+ p2.setMethodVisibility(Visibility.PRIVATE);
assertSameCache(p1, p2);
- p1.setProperty(BEAN_methodVisibility, Visibility.PROTECTED);
+ p1.setMethodVisibility(Visibility.PROTECTED);
assertDifferentCache(p1, p2);
- p2.setProperty(BEAN_methodVisibility, Visibility.PROTECTED);
+ p2.setMethodVisibility(Visibility.PROTECTED);
assertSameCache(p1, p2);
- p1.setProperty(BEAN_useJavaBeanIntrospector, true);
+ p1.setUseJavaBeanIntrospector(true);
assertDifferentCache(p1, p2);
- p2.setProperty(BEAN_useJavaBeanIntrospector, true);
+ p2.setUseJavaBeanIntrospector(true);
assertSameCache(p1, p2);
- p1.setProperty(BEAN_useInterfaceProxies, false);
+ p1.setUseInterfaceProxies(false);
assertDifferentCache(p1, p2);
- p2.setProperty(BEAN_useInterfaceProxies, false);
+ p2.setUseInterfaceProxies(false);
assertSameCache(p1, p2);
- p1.setProperty(BEAN_ignoreUnknownBeanProperties, true);
+ p1.setIgnoreUnknownBeanProperties(true);
assertDifferentCache(p1, p2);
- p2.setProperty(BEAN_ignoreUnknownBeanProperties, true);
+ p2.setIgnoreUnknownBeanProperties(true);
assertSameCache(p1, p2);
- p1.setProperty(BEAN_ignoreUnknownNullBeanProperties, false);
+ p1.setIgnoreUnknownNullBeanProperties(false);
assertDifferentCache(p1, p2);
- p2.setProperty(BEAN_ignoreUnknownNullBeanProperties, false);
+ p2.setIgnoreUnknownNullBeanProperties(false);
assertSameCache(p1, p2);
- p1.setProperty(BEAN_ignorePropertiesWithoutSetters, false);
+ p1.setIgnorePropertiesWithoutSetters(false);
assertDifferentCache(p1, p2);
- p2.setProperty(BEAN_ignorePropertiesWithoutSetters, false);
+ p2.setIgnorePropertiesWithoutSetters(false);
assertSameCache(p1, p2);
- p1.setProperty(BEAN_ignoreInvocationExceptionsOnGetters, true);
+ p1.setIgnoreInvocationExceptionsOnGetters(true);
assertDifferentCache(p1, p2);
- p2.setProperty(BEAN_ignoreInvocationExceptionsOnGetters, true);
+ p2.setIgnoreInvocationExceptionsOnGetters(true);
assertSameCache(p1, p2);
- p1.setProperty(BEAN_ignoreInvocationExceptionsOnSetters, true);
+ p1.setIgnoreInvocationExceptionsOnSetters(true);
assertDifferentCache(p1, p2);
- p2.setProperty(BEAN_ignoreInvocationExceptionsOnSetters, true);
+ p2.setIgnoreInvocationExceptionsOnSetters(true);
assertSameCache(p1, p2);
- p1.setProperty(BEAN_notBeanPackages_add, "foo");
+ p1.addNotBeanPackages("foo");
assertDifferentCache(p1, p2);
- p2.setProperty(BEAN_notBeanPackages_add, "foo");
+ p2.addNotBeanPackages("foo");
assertSameCache(p1, p2);
- p1.setProperty(BEAN_notBeanPackages_add, "bar");
+ p1.addNotBeanPackages("bar");
assertDifferentCache(p1, p2);
- p2.setProperty(BEAN_notBeanPackages_add, "bar");
+ p2.addNotBeanPackages("bar");
assertSameCache(p1, p2);
- p1.setProperty(BEAN_notBeanPackages_add, "baz");
- p1.setProperty(BEAN_notBeanPackages_add, "bing");
+ p1.addNotBeanPackages("baz");
+ p1.addNotBeanPackages("bing");
assertDifferentCache(p1, p2);
- p2.setProperty(BEAN_notBeanPackages_add, "bing");
- p2.setProperty(BEAN_notBeanPackages_add, "baz");
+ p2.addNotBeanPackages("bing");
+ p2.addNotBeanPackages("baz");
assertSameCache(p1, p2);
- p1.setProperty(BEAN_notBeanPackages_remove, "bar");
+ p1.removeNotBeanPackages("bar");
assertDifferentCache(p1, p2);
- p2.setProperty(BEAN_notBeanPackages_remove, "bar");
+ p2.removeNotBeanPackages("bar");
assertSameCache(p1, p2);
p1.addPojoSwaps(DummyPojoSwapA.class);
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core-test/src/test/java/org/apache/juneau/BeanMapTest.java
----------------------------------------------------------------------
diff --git a/juneau-core-test/src/test/java/org/apache/juneau/BeanMapTest.java b/juneau-core-test/src/test/java/org/apache/juneau/BeanMapTest.java
index 17dfc5e..3343a6d 100755
--- a/juneau-core-test/src/test/java/org/apache/juneau/BeanMapTest.java
+++ b/juneau-core-test/src/test/java/org/apache/juneau/BeanMapTest.java
@@ -12,7 +12,6 @@
// ***************************************************************************************************************************
package org.apache.juneau;
-import static org.apache.juneau.BeanContext.*;
import static org.apache.juneau.TestUtils.*;
import static org.junit.Assert.*;
@@ -31,11 +30,10 @@ import org.junit.*;
@SuppressWarnings({"unchecked","rawtypes","serial","javadoc"})
public class BeanMapTest {
- JsonSerializer serializer = JsonSerializer.DEFAULT_LAX.clone().setClassLoader(BeanMapTest.class.getClassLoader());
+ JsonSerializer serializer = JsonSerializer.DEFAULT_LAX.clone();
BeanContext bc = ContextFactory.create()
- .setClassLoader(this.getClass().getClassLoader())
- .addToDictionary(MyBeanDictionaryMap.class)
+ .addToBeanDictionary(MyBeanDictionaryMap.class)
.addPojoSwaps(CalendarSwap.ISO8601DTZ.class)
.getBeanContext();
BeanSession session = bc.createSession();
@@ -480,7 +478,7 @@ public class BeanMapTest {
m.put("b", new D2());
assertEquals("default", t.b.s);
- JsonParser p = new JsonParser().setClassLoader(BeanMapTest.class.getClassLoader()).addToDictionary(D2.class);
+ JsonParser p = new JsonParser().addToBeanDictionary(D2.class);
m.put("lb1", new ObjectList("[{_type:'D2',s:'foobar'}]", p));
assertEquals(ObjectList.class.getName(), t.lb1.getClass().getName());
assertEquals(D2.class.getName(), t.lb1.get(0).getClass().getName());
@@ -666,7 +664,7 @@ public class BeanMapTest {
assertEquals(HEnum.THREE, t7.getEnum2());
// Create instance directly from JSON.
- JsonParser p = new JsonParser().setClassLoader(BeanMapTest.class.getClassLoader()).addToDictionary(H.class);
+ JsonParser p = new JsonParser().addToBeanDictionary(H.class);
t7 = (H)p.parse("{_type:'H',enum1:'THREE',enum2:'ONE'}", Object.class);
assertEquals("{enum1:'THREE',enum2:'ONE'}", serializer.serialize(t7));
assertEquals(HEnum.THREE, t7.enum1);
@@ -958,7 +956,7 @@ public class BeanMapTest {
// JSON
String json = "{baz:789,foo:123,bar:456}";
- p = new JsonParser().setProperty(BEAN_ignoreUnknownBeanProperties, true);
+ p = new JsonParser().setIgnoreUnknownBeanProperties(true);
t = p.parse(json, O.class);
assertEquals(123, t.foo);
@@ -972,7 +970,7 @@ public class BeanMapTest {
// XML
String xml = "<object><baz type='number'>789</baz><foo type='number'>123</foo><bar type='number'>456</bar></object>";
- p = new XmlParser().setProperty(BEAN_ignoreUnknownBeanProperties, true);
+ p = new XmlParser().setIgnoreUnknownBeanProperties(true);
t = p.parse(xml, O.class);
assertEquals(123, t.foo);
@@ -986,7 +984,7 @@ public class BeanMapTest {
// HTML
String html = "<table _type='object'><tr><th><string>key</string></th><th><string>value</string></th></tr><tr><td><string>baz</string></td><td><number>789</number></td></tr><tr><td><string>foo</string></td><td><number>123</number></td></tr><tr><td><string>bar</string></td><td><number>456</number></td></tr></table>";
- p = new HtmlParser().setProperty(BEAN_ignoreUnknownBeanProperties, true);
+ p = new HtmlParser().setIgnoreUnknownBeanProperties(true);
t = p.parse(html, O.class);
assertEquals(123, t.foo);
@@ -1000,7 +998,7 @@ public class BeanMapTest {
// UON
String uon = "(baz=789,foo=123,bar=456)";
- p = new UonParser().setProperty(BEAN_ignoreUnknownBeanProperties, true);
+ p = new UonParser().setIgnoreUnknownBeanProperties(true);
t = p.parse(uon, O.class);
assertEquals(123, t.foo);
@@ -1014,7 +1012,7 @@ public class BeanMapTest {
// URL-Encoding
String urlencoding = "baz=789&foo=123&bar=456";
- p = new UrlEncodingParser().setProperty(BEAN_ignoreUnknownBeanProperties, true);
+ p = new UrlEncodingParser().setIgnoreUnknownBeanProperties(true);
t = p.parse(urlencoding, O.class);
assertEquals(123, t.foo);
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core-test/src/test/java/org/apache/juneau/IgnoredClassesTest.java
----------------------------------------------------------------------
diff --git a/juneau-core-test/src/test/java/org/apache/juneau/IgnoredClassesTest.java b/juneau-core-test/src/test/java/org/apache/juneau/IgnoredClassesTest.java
index b363231..28674f3 100755
--- a/juneau-core-test/src/test/java/org/apache/juneau/IgnoredClassesTest.java
+++ b/juneau-core-test/src/test/java/org/apache/juneau/IgnoredClassesTest.java
@@ -12,7 +12,6 @@
// ***************************************************************************************************************************
package org.apache.juneau;
-import static org.apache.juneau.BeanContext.*;
import static org.apache.juneau.TestUtils.*;
import static org.junit.Assert.*;
import static org.junit.Assume.*;
@@ -44,21 +43,21 @@ public class IgnoredClassesTest {
A a = new A();
JsonSerializer s = new JsonSerializer.Simple();
assertEquals("{f1:'isBean'}", s.serialize(a));
- s.setProperty(BEAN_notBeanPackages_add, "org.apache.juneau");
+ s.addNotBeanPackages("org.apache.juneau");
assertEquals("'isNotBean'", s.serialize(a));
- s.setProperty(BEAN_notBeanPackages_remove, "org.apache.juneau");
+ s.removeNotBeanPackages("org.apache.juneau");
assertEquals("{f1:'isBean'}", s.serialize(a));
- s.setProperty(BEAN_notBeanPackages_add, "org.apache.juneau.*");
+ s.addNotBeanPackages("org.apache.juneau.*");
assertEquals("'isNotBean'", s.serialize(a));
- s.setProperty(BEAN_notBeanPackages_remove, "org.apache.juneau.*");
+ s.removeNotBeanPackages("org.apache.juneau.*");
assertEquals("{f1:'isBean'}", s.serialize(a));
- s.setProperty(BEAN_notBeanPackages_add, "org.apache.juneau.*");
+ s.addNotBeanPackages("org.apache.juneau.*");
assertEquals("'isNotBean'", s.serialize(a));
- s.setProperty(BEAN_notBeanPackages_remove, "org.apache.juneau.*");
+ s.removeNotBeanPackages("org.apache.juneau.*");
assertEquals("{f1:'isBean'}", s.serialize(a));
- s.setProperty(BEAN_notBeanPackages_add, "org.apache.juneau");
+ s.addNotBeanPackages("org.apache.juneau");
assertEquals("'isNotBean'", s.serialize(a));
- s.setProperty(BEAN_notBeanPackages_add, "org.apache.juneau.x");
+ s.addNotBeanPackages("org.apache.juneau.x");
assertEquals("'isNotBean'", s.serialize(a));
}
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core-test/src/test/java/org/apache/juneau/TestUtils.java
----------------------------------------------------------------------
diff --git a/juneau-core-test/src/test/java/org/apache/juneau/TestUtils.java b/juneau-core-test/src/test/java/org/apache/juneau/TestUtils.java
index bdf0a77..1e278b5 100755
--- a/juneau-core-test/src/test/java/org/apache/juneau/TestUtils.java
+++ b/juneau-core-test/src/test/java/org/apache/juneau/TestUtils.java
@@ -12,9 +12,6 @@
// ***************************************************************************************************************************
package org.apache.juneau;
-import static org.apache.juneau.BeanContext.*;
-import static org.apache.juneau.serializer.SerializerContext.*;
-import static org.apache.juneau.xml.XmlSerializerContext.*;
import static org.junit.Assert.*;
import java.io.*;
@@ -43,12 +40,12 @@ import org.xml.sax.*;
public class TestUtils {
private static JsonSerializer js = new JsonSerializer.Simple()
- .setProperty(SERIALIZER_trimNullProperties, false);
+ .setTrimNullProperties(false);
private static JsonSerializer jsSorted = new JsonSerializer.Simple()
- .setProperty(SERIALIZER_sortCollections, true)
- .setProperty(SERIALIZER_sortMaps, true)
- .setProperty(SERIALIZER_trimNullProperties, false);
+ .setSortCollections(true)
+ .setSortMaps(true)
+ .setTrimNullProperties(false);
private static JsonSerializer js2 = new JsonSerializer.Simple()
@@ -56,7 +53,7 @@ public class TestUtils {
private static JsonSerializer js3 = new JsonSerializer.Simple()
.addPojoSwaps(IteratorSwap.class, EnumerationSwap.class)
- .setProperty(BEAN_sortProperties, true);
+ .setSortProperties(true);
/**
* Verifies that two objects are equivalent.
@@ -224,7 +221,7 @@ public class TestUtils {
* Test whitespace and generated schema.
*/
public static void validateXml(Object o, XmlSerializer s) throws Exception {
- s = s.clone().setProperty(SERIALIZER_useIndentation, true).setProperty(XML_enableNamespaces, true).setProperty(XML_addNamespaceUrisToRoot, true);
+ s = s.clone().setUseIndentation(true).setEnableNamespaces(true).setAddNamespaceUrisToRoot(true);
String xml = s.serialize(o);
String xmlSchema = null;
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core-test/src/test/java/org/apache/juneau/VisibilityTest.java
----------------------------------------------------------------------
diff --git a/juneau-core-test/src/test/java/org/apache/juneau/VisibilityTest.java b/juneau-core-test/src/test/java/org/apache/juneau/VisibilityTest.java
index 953dd45..cff0fcb 100755
--- a/juneau-core-test/src/test/java/org/apache/juneau/VisibilityTest.java
+++ b/juneau-core-test/src/test/java/org/apache/juneau/VisibilityTest.java
@@ -12,7 +12,6 @@
// ***************************************************************************************************************************
package org.apache.juneau;
-import static org.apache.juneau.BeanContext.*;
import static org.apache.juneau.Visibility.*;
import static org.junit.Assert.*;
@@ -28,18 +27,18 @@ public class VisibilityTest {
//====================================================================================================
@Test
public void testClassDefault() throws Exception {
- JsonSerializer s1 = JsonSerializer.DEFAULT_LAX.clone().setProperty(BEAN_beansRequireSomeProperties, "false");
- JsonSerializer s2 = JsonSerializer.DEFAULT_LAX.clone().setProperty(BEAN_beansRequireSomeProperties, "false").setProperty(BEAN_beanClassVisibility, PROTECTED);
- JsonSerializer s3 = JsonSerializer.DEFAULT_LAX.clone().setProperty(BEAN_beansRequireSomeProperties, "false").setProperty(BEAN_beanClassVisibility, Visibility.DEFAULT);
- JsonSerializer s4 = JsonSerializer.DEFAULT_LAX.clone().setProperty(BEAN_beansRequireSomeProperties, "false").setProperty(BEAN_beanClassVisibility, PRIVATE);
+ JsonSerializer s1 = JsonSerializer.DEFAULT_LAX.clone().setBeansRequireSomeProperties(false);
+ JsonSerializer s2 = JsonSerializer.DEFAULT_LAX.clone().setBeansRequireSomeProperties(false).setBeanClassVisibility(PROTECTED);
+ JsonSerializer s3 = JsonSerializer.DEFAULT_LAX.clone().setBeansRequireSomeProperties(false).setBeanClassVisibility(Visibility.DEFAULT);
+ JsonSerializer s4 = JsonSerializer.DEFAULT_LAX.clone().setBeansRequireSomeProperties(false).setBeanClassVisibility(PRIVATE);
A1 a1 = A1.create();
String r;
- s1.setProperty(BEAN_beanFieldVisibility, NONE);
- s2.setProperty(BEAN_beanFieldVisibility, NONE);
- s3.setProperty(BEAN_beanFieldVisibility, NONE);
- s4.setProperty(BEAN_beanFieldVisibility, NONE);
+ s1.setBeanFieldVisibility(NONE);
+ s2.setBeanFieldVisibility(NONE);
+ s3.setBeanFieldVisibility(NONE);
+ s4.setBeanFieldVisibility(NONE);
r = s1.serialize(a1);
assertEquals("{f5:5}", r);
@@ -53,10 +52,10 @@ public class VisibilityTest {
r = s4.serialize(a1);
assertEquals("{f5:5}", r);
- s1.setProperty(BEAN_beanFieldVisibility, PUBLIC);
- s2.setProperty(BEAN_beanFieldVisibility, PUBLIC);
- s3.setProperty(BEAN_beanFieldVisibility, PUBLIC);
- s4.setProperty(BEAN_beanFieldVisibility, PUBLIC);
+ s1.setBeanFieldVisibility(PUBLIC);
+ s2.setBeanFieldVisibility(PUBLIC);
+ s3.setBeanFieldVisibility(PUBLIC);
+ s4.setBeanFieldVisibility(PUBLIC);
r = s1.serialize(a1);
assertEquals("{f1:1,f5:5,g2:{f1:1,f5:5},g3:'A3',g4:'A4',g5:'A5'}", r);
@@ -70,10 +69,10 @@ public class VisibilityTest {
r = s4.serialize(a1);
assertEquals("{f1:1,f5:5,g2:{f1:1,f5:5},g3:{f1:1,f5:5},g4:{f1:1,f5:5},g5:{f1:1,f5:5}}", r);
- s1.setProperty(BEAN_beanFieldVisibility, PROTECTED);
- s2.setProperty(BEAN_beanFieldVisibility, PROTECTED);
- s3.setProperty(BEAN_beanFieldVisibility, PROTECTED);
- s4.setProperty(BEAN_beanFieldVisibility, PROTECTED);
+ s1.setBeanFieldVisibility(PROTECTED);
+ s2.setBeanFieldVisibility(PROTECTED);
+ s3.setBeanFieldVisibility(PROTECTED);
+ s4.setBeanFieldVisibility(PROTECTED);
r = s1.serialize(a1);
assertEquals("{f1:1,f2:2,f5:5,g2:{f1:1,f2:2,f5:5},g3:'A3',g4:'A4',g5:'A5'}", r);
@@ -87,10 +86,10 @@ public class VisibilityTest {
r = s4.serialize(a1);
assertEquals("{f1:1,f2:2,f5:5,g2:{f1:1,f2:2,f5:5},g3:{f1:1,f2:2,f5:5},g4:{f1:1,f2:2,f5:5},g5:{f1:1,f2:2,f5:5}}", r);
- s1.setProperty(BEAN_beanFieldVisibility, Visibility.DEFAULT);
- s2.setProperty(BEAN_beanFieldVisibility, Visibility.DEFAULT);
- s3.setProperty(BEAN_beanFieldVisibility, Visibility.DEFAULT);
- s4.setProperty(BEAN_beanFieldVisibility, Visibility.DEFAULT);
+ s1.setBeanFieldVisibility(Visibility.DEFAULT);
+ s2.setBeanFieldVisibility(Visibility.DEFAULT);
+ s3.setBeanFieldVisibility(Visibility.DEFAULT);
+ s4.setBeanFieldVisibility(Visibility.DEFAULT);
r = s1.serialize(a1);
assertEquals("{f1:1,f2:2,f3:3,f5:5,g2:{f1:1,f2:2,f3:3,f5:5},g3:'A3',g4:'A4',g5:'A5'}", r);
@@ -104,10 +103,10 @@ public class VisibilityTest {
r = s4.serialize(a1);
assertEquals("{f1:1,f2:2,f3:3,f5:5,g2:{f1:1,f2:2,f3:3,f5:5},g3:{f1:1,f2:2,f3:3,f5:5},g4:{f1:1,f2:2,f3:3,f5:5},g5:{f1:1,f2:2,f3:3,f5:5}}", r);
- s1.setProperty(BEAN_beanFieldVisibility, PRIVATE);
- s2.setProperty(BEAN_beanFieldVisibility, PRIVATE);
- s3.setProperty(BEAN_beanFieldVisibility, PRIVATE);
- s4.setProperty(BEAN_beanFieldVisibility, PRIVATE);
+ s1.setBeanFieldVisibility(PRIVATE);
+ s2.setBeanFieldVisibility(PRIVATE);
+ s3.setBeanFieldVisibility(PRIVATE);
+ s4.setBeanFieldVisibility(PRIVATE);
r = s1.serialize(a1);
assertEquals("{f1:1,f2:2,f3:3,f4:4,f5:5,g2:{f1:1,f2:2,f3:3,f4:4,f5:5},g3:'A3',g4:'A4',g5:'A5'}", r);
@@ -121,10 +120,10 @@ public class VisibilityTest {
r = s4.serialize(a1);
assertEquals("{f1:1,f2:2,f3:3,f4:4,f5:5,g2:{f1:1,f2:2,f3:3,f4:4,f5:5},g3:{f1:1,f2:2,f3:3,f4:4,f5:5},g4:{f1:1,f2:2,f3:3,f4:4,f5:5},g5:{f1:1,f2:2,f3:3,f4:4,f5:5}}", r);
- s1.setProperty(BEAN_methodVisibility, NONE);
- s2.setProperty(BEAN_methodVisibility, NONE);
- s3.setProperty(BEAN_methodVisibility, NONE);
- s4.setProperty(BEAN_methodVisibility, NONE);
+ s1.setMethodVisibility(NONE);
+ s2.setMethodVisibility(NONE);
+ s3.setMethodVisibility(NONE);
+ s4.setMethodVisibility(NONE);
r = s1.serialize(a1);
assertEquals("{f1:1,f2:2,f3:3,f4:4,g2:{f1:1,f2:2,f3:3,f4:4},g3:'A3',g4:'A4',g5:'A5'}", r);
@@ -138,10 +137,10 @@ public class VisibilityTest {
r = s4.serialize(a1);
assertEquals("{f1:1,f2:2,f3:3,f4:4,g2:{f1:1,f2:2,f3:3,f4:4},g3:{f1:1,f2:2,f3:3,f4:4},g4:{f1:1,f2:2,f3:3,f4:4},g5:{f1:1,f2:2,f3:3,f4:4}}", r);
- s1.setProperty(BEAN_methodVisibility, PROTECTED);
- s2.setProperty(BEAN_methodVisibility, PROTECTED);
- s3.setProperty(BEAN_methodVisibility, PROTECTED);
- s4.setProperty(BEAN_methodVisibility, PROTECTED);
+ s1.setMethodVisibility(PROTECTED);
+ s2.setMethodVisibility(PROTECTED);
+ s3.setMethodVisibility(PROTECTED);
+ s4.setMethodVisibility(PROTECTED);
r = s1.serialize(a1);
assertEquals("{f1:1,f2:2,f3:3,f4:4,f5:5,f6:6,g2:{f1:1,f2:2,f3:3,f4:4,f5:5,f6:6},g3:'A3',g4:'A4',g5:'A5'}", r);
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core-test/src/test/java/org/apache/juneau/a/rttests/RoundTripAddClassAttrsTest.java
----------------------------------------------------------------------
diff --git a/juneau-core-test/src/test/java/org/apache/juneau/a/rttests/RoundTripAddClassAttrsTest.java b/juneau-core-test/src/test/java/org/apache/juneau/a/rttests/RoundTripAddClassAttrsTest.java
index 1a7fb26..cbf7630 100755
--- a/juneau-core-test/src/test/java/org/apache/juneau/a/rttests/RoundTripAddClassAttrsTest.java
+++ b/juneau-core-test/src/test/java/org/apache/juneau/a/rttests/RoundTripAddClassAttrsTest.java
@@ -12,9 +12,7 @@
// ***************************************************************************************************************************
package org.apache.juneau.a.rttests;
-import static org.apache.juneau.BeanContext.*;
import static org.apache.juneau.a.rttests.RoundTripTest.Flags.*;
-import static org.apache.juneau.serializer.SerializerContext.*;
import static org.junit.Assert.*;
import java.util.*;
@@ -43,62 +41,62 @@ public class RoundTripAddClassAttrsTest extends RoundTripTest {
return Arrays.asList(new Object[][] {
{ /* 0 */
"JsonSerializer.DEFAULT/JsonParser.DEFAULT",
- new JsonSerializer().setProperty(SERIALIZER_addBeanTypeProperties, true).setClassLoader(RoundTripAddClassAttrsTest.class.getClassLoader()),
- new JsonParser().setProperty(BEAN_useInterfaceProxies, false).setClassLoader(RoundTripAddClassAttrsTest.class.getClassLoader()),
+ new JsonSerializer().setAddBeanTypeProperties(true),
+ new JsonParser().setUseInterfaceProxies(false),
0
},
{ /* 1 */
"JsonSerializer.DEFAULT_LAX/JsonParser.DEFAULT",
- new JsonSerializer.Simple().setProperty(SERIALIZER_addBeanTypeProperties, true).setClassLoader(RoundTripAddClassAttrsTest.class.getClassLoader()),
- new JsonParser().setProperty(BEAN_useInterfaceProxies, false).setClassLoader(RoundTripAddClassAttrsTest.class.getClassLoader()),
+ new JsonSerializer.Simple().setAddBeanTypeProperties(true),
+ new JsonParser().setUseInterfaceProxies(false),
0
},
{ /* 2 */
"JsonSerializer.DEFAULT_SQ/JsonParser.DEFAULT",
- new JsonSerializer.Simple().setProperty(SERIALIZER_addBeanTypeProperties, true).setClassLoader(RoundTripAddClassAttrsTest.class.getClassLoader()),
- new JsonParser().setProperty(BEAN_useInterfaceProxies, false).setClassLoader(RoundTripAddClassAttrsTest.class.getClassLoader()),
+ new JsonSerializer.Simple().setAddBeanTypeProperties(true),
+ new JsonParser().setUseInterfaceProxies(false),
0
},
{ /* 3 */
"XmlSerializer.DEFAULT/XmlParser.DEFAULT",
- new XmlSerializer().setProperty(SERIALIZER_addBeanTypeProperties, true).setClassLoader(RoundTripAddClassAttrsTest.class.getClassLoader()),
- new XmlParser().setProperty(BEAN_useInterfaceProxies, false).setClassLoader(RoundTripAddClassAttrsTest.class.getClassLoader()),
+ new XmlSerializer().setAddBeanTypeProperties(true),
+ new XmlParser().setUseInterfaceProxies(false),
CHECK_XML_WHITESPACE | VALIDATE_XML
},
{ /* 4 */
"HtmlSerializer.DEFAULT/HtmlParser.DEFAULT",
- new HtmlSerializer().setProperty(SERIALIZER_addBeanTypeProperties, true).setClassLoader(RoundTripAddClassAttrsTest.class.getClassLoader()),
- new HtmlParser().setProperty(BEAN_useInterfaceProxies, false).setClassLoader(RoundTripAddClassAttrsTest.class.getClassLoader()),
+ new HtmlSerializer().setAddBeanTypeProperties(true),
+ new HtmlParser().setUseInterfaceProxies(false),
CHECK_XML_WHITESPACE
},
{ /* 5 */
"UonSerializer.DEFAULT_ENCODING/UonParser.DEFAULT_DECODING",
- new UonSerializer.Encoding().setProperty(SERIALIZER_addBeanTypeProperties, true).setClassLoader(RoundTripAddClassAttrsTest.class.getClassLoader()),
- new UonParser.Decoding().setProperty(BEAN_useInterfaceProxies, false).setClassLoader(RoundTripAddClassAttrsTest.class.getClassLoader()),
+ new UonSerializer.Encoding().setAddBeanTypeProperties(true),
+ new UonParser.Decoding().setUseInterfaceProxies(false),
0
},
{ /* 6 */
"UonSerializer.DEFAULT/UonParser.DEFAULT",
- new UonSerializer().setProperty(SERIALIZER_addBeanTypeProperties, true).setClassLoader(RoundTripAddClassAttrsTest.class.getClassLoader()),
- new UonParser().setProperty(BEAN_useInterfaceProxies, false).setClassLoader(RoundTripAddClassAttrsTest.class.getClassLoader()),
+ new UonSerializer().setAddBeanTypeProperties(true),
+ new UonParser().setUseInterfaceProxies(false),
0
},
{ /* 7 */
"UrlEncodingSerializer.DEFAULT/UrlEncodingParser.DEFAULT",
- new UrlEncodingSerializer().setProperty(SERIALIZER_addBeanTypeProperties, true).setClassLoader(RoundTripAddClassAttrsTest.class.getClassLoader()),
- new UrlEncodingParser().setProperty(BEAN_useInterfaceProxies, false).setClassLoader(RoundTripAddClassAttrsTest.class.getClassLoader()),
+ new UrlEncodingSerializer().setAddBeanTypeProperties(true),
+ new UrlEncodingParser().setUseInterfaceProxies(false),
0
},
{ /* 8 */
"RdfSerializer.Xml/RdfParser.Xml",
- new RdfSerializer.Xml().setProperty(SERIALIZER_addBeanTypeProperties, true).setClassLoader(RoundTripAddClassAttrsTest.class.getClassLoader()),
- new RdfParser.Xml().setProperty(BEAN_useInterfaceProxies, false).setClassLoader(RoundTripAddClassAttrsTest.class.getClassLoader()),
+ new RdfSerializer.Xml().setAddBeanTypeProperties(true),
+ new RdfParser.Xml().setUseInterfaceProxies(false),
0
},
{ /* 9 */
"MsgPackSerializer.DEFAULT/MsgPackParser.DEFAULT",
- new MsgPackSerializer().setProperty(SERIALIZER_addBeanTypeProperties, true).setClassLoader(RoundTripAddClassAttrsTest.class.getClassLoader()),
- new MsgPackParser().setProperty(BEAN_useInterfaceProxies, false).setClassLoader(RoundTripAddClassAttrsTest.class.getClassLoader()),
+ new MsgPackSerializer().setAddBeanTypeProperties(true),
+ new MsgPackParser().setUseInterfaceProxies(false),
0
}
});
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core-test/src/test/java/org/apache/juneau/a/rttests/RoundTripLargeObjectsTest.java
----------------------------------------------------------------------
diff --git a/juneau-core-test/src/test/java/org/apache/juneau/a/rttests/RoundTripLargeObjectsTest.java b/juneau-core-test/src/test/java/org/apache/juneau/a/rttests/RoundTripLargeObjectsTest.java
index 47d56ed..33b6886 100755
--- a/juneau-core-test/src/test/java/org/apache/juneau/a/rttests/RoundTripLargeObjectsTest.java
+++ b/juneau-core-test/src/test/java/org/apache/juneau/a/rttests/RoundTripLargeObjectsTest.java
@@ -13,9 +13,6 @@
package org.apache.juneau.a.rttests;
import static org.apache.juneau.a.rttests.RoundTripTest.Flags.*;
-import static org.apache.juneau.serializer.SerializerContext.*;
-import static org.apache.juneau.urlencoding.UonSerializerContext.*;
-import static org.apache.juneau.xml.XmlSerializerContext.*;
import java.text.*;
import java.util.*;
@@ -51,85 +48,85 @@ public class RoundTripLargeObjectsTest extends RoundTripTest {
// Full round-trip testing
{ /* 0 */
"Json DEFAULT",
- new JsonSerializer().setProperty(SERIALIZER_trimNullProperties, false),
+ new JsonSerializer().setTrimNullProperties(false),
JsonParser.DEFAULT,
0
},
{ /* 1 */
"Json DEFAULT_LAX",
- new JsonSerializer.Simple().setProperty(SERIALIZER_trimNullProperties, false),
+ new JsonSerializer.Simple().setTrimNullProperties(false),
JsonParser.DEFAULT,
0
},
{ /* 2 */
"Json DEFAULT_SQ",
- new JsonSerializer.Simple().setProperty(SERIALIZER_trimNullProperties, false),
+ new JsonSerializer.Simple().setTrimNullProperties(false),
JsonParser.DEFAULT,
0
},
{ /* 3 */
"Xml DEFAULT w/namespaces,validation",
- new XmlSerializer.NsSq().setProperty(SERIALIZER_trimNullProperties, false).setProperty(XML_addNamespaceUrisToRoot, true).setProperty(SERIALIZER_useIndentation, true),
+ new XmlSerializer.NsSq().setTrimNullProperties(false).setAddNamespaceUrisToRoot(true).setUseIndentation(true),
XmlParser.DEFAULT,
CHECK_XML_WHITESPACE | VALIDATE_XML
},
{ /* 4 */
"Xml DEFAULT wo/namespaces,validation",
- new XmlSerializer.Sq().setProperty(SERIALIZER_trimNullProperties, false),
+ new XmlSerializer.Sq().setTrimNullProperties(false),
XmlParser.DEFAULT,
CHECK_XML_WHITESPACE
},
{ /* 5 */
"Html",
- new HtmlSerializer().setProperty(SERIALIZER_trimNullProperties, false),
+ new HtmlSerializer().setTrimNullProperties(false),
HtmlParser.DEFAULT,
CHECK_XML_WHITESPACE
},
{ /* 6 */
"UrlEncoding",
- new UrlEncodingSerializer().setProperty(SERIALIZER_trimNullProperties, false).setProperty(UON_simpleMode, false),
+ new UrlEncodingSerializer().setTrimNullProperties(false).setSimpleMode(false),
UrlEncodingParser.DEFAULT,
0
},
{ /* 7 */
"Uon",
- new UonSerializer().setProperty(SERIALIZER_trimNullProperties, false).setProperty(UON_simpleMode, false),
+ new UonSerializer().setTrimNullProperties(false).setSimpleMode(false),
UonParser.DEFAULT,
0
},
{ /* 8 */
"MsgPack",
- new MsgPackSerializer().setProperty(SERIALIZER_trimNullProperties, false).setProperty(UON_simpleMode, false),
+ new MsgPackSerializer().setTrimNullProperties(false),
MsgPackParser.DEFAULT,
0
},
// { /* 9 */
// "Rdf.Xml",
-// new RdfSerializer.Xml().setProperty(SERIALIZER_trimNullProperties, false).setProperty(RDF_addLiteralTypes, true),
+// new RdfSerializer.Xml().setTrimNullProperties(false).setAddLiteralTypes(true),
// RdfParser.DEFAULT_XML,
// 0
// },
// { /* 10 */
// "Rdf.XmlAbbrev",
-// new RdfSerializer.XmlAbbrev().setProperty(SERIALIZER_trimNullProperties, false).setProperty(RDF_addLiteralTypes, true),
+// new RdfSerializer.XmlAbbrev().setTrimNullProperties(false).setAddLiteralTypes(true),
// RdfParser.DEFAULT_XML,
// 0
// },
// { /* 11 */
// "Rdf.Turtle",
-// new RdfSerializer.Turtle().setProperty(SERIALIZER_trimNullProperties, false).setProperty(RDF_addLiteralTypes, true),
+// new RdfSerializer.Turtle().setTrimNullProperties(false).setAddLiteralTypes(true),
// RdfParser.DEFAULT_TURTLE,
// 0
// },
// { /* 12 */
// "Rdf.NTriple",
-// new RdfSerializer.NTriple().setProperty(SERIALIZER_trimNullProperties, false).setProperty(RDF_addLiteralTypes, true),
+// new RdfSerializer.NTriple().setTrimNullProperties(false).setAddLiteralTypes(true),
// RdfParser.DEFAULT_NTRIPLE,
// 0
// },
// { /* 13 */
// "Rdf.N3",
-// new RdfSerializer.N3().setProperty(SERIALIZER_trimNullProperties, false).setProperty(RDF_addLiteralTypes, true),
+// new RdfSerializer.N3().setTrimNullProperties(false).setAddLiteralTypes(true),
// RdfParser.DEFAULT_N3,
// 0
// },
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core-test/src/test/java/org/apache/juneau/a/rttests/RoundTripMapsTest.java
----------------------------------------------------------------------
diff --git a/juneau-core-test/src/test/java/org/apache/juneau/a/rttests/RoundTripMapsTest.java b/juneau-core-test/src/test/java/org/apache/juneau/a/rttests/RoundTripMapsTest.java
index 41a3475..a644e85 100755
--- a/juneau-core-test/src/test/java/org/apache/juneau/a/rttests/RoundTripMapsTest.java
+++ b/juneau-core-test/src/test/java/org/apache/juneau/a/rttests/RoundTripMapsTest.java
@@ -12,8 +12,6 @@
// ***************************************************************************************************************************
package org.apache.juneau.a.rttests;
-import static org.apache.juneau.serializer.SerializerContext.*;
-import static org.apache.juneau.html.HtmlSerializerContext.*;
import static org.junit.Assert.*;
import java.util.*;
@@ -107,27 +105,27 @@ public class RoundTripMapsTest extends RoundTripTest {
t.put(new byte[]{4,5,6}, null);
t.put(null, "b");
- s = new JsonSerializer.Simple().addPojoSwaps(getPojoSwaps()).setProperty(SERIALIZER_trimNullProperties, false);
+ s = new JsonSerializer.Simple().addPojoSwaps(getPojoSwaps()).setTrimNullProperties(false);
e = "{AQID:'a',BAUG:null,null:'b'}";
r = s.serialize(t);
assertEquals(e, r);
- s = new XmlSerializer.NsSq().addPojoSwaps(getPojoSwaps()).setProperty(SERIALIZER_trimNullProperties, false);
+ s = new XmlSerializer.NsSq().addPojoSwaps(getPojoSwaps()).setTrimNullProperties(false);
e = "<object><AQID>a</AQID><BAUG _type='null'/><_x0000_>b</_x0000_></object>";
r = s.serialize(t);
assertEquals(e, r);
- s = new HtmlSerializer.Sq().addPojoSwaps(getPojoSwaps()).setProperty(SERIALIZER_trimNullProperties, false).setProperty(HTML_addKeyValueTableHeaders, true);
+ s = new HtmlSerializer.Sq().addPojoSwaps(getPojoSwaps()).setTrimNullProperties(false).setAddKeyValueTableHeaders(true);
e = "<table><tr><th>key</th><th>value</th></tr><tr><td>AQID</td><td>a</td></tr><tr><td>BAUG</td><td><null/></td></tr><tr><td><null/></td><td>b</td></tr></table>";
r = s.serialize(t);
assertEquals(e, r);
- s = new UonSerializer.Encoding().addPojoSwaps(getPojoSwaps()).setProperty(SERIALIZER_trimNullProperties, false);
+ s = new UonSerializer.Encoding().addPojoSwaps(getPojoSwaps()).setTrimNullProperties(false);
e = "$o(AQID=a,BAUG=%00,%00=b)";
r = s.serialize(t);
assertEquals(e, r);
- s = new UrlEncodingSerializer().addPojoSwaps(getPojoSwaps()).setProperty(SERIALIZER_trimNullProperties, false);
+ s = new UrlEncodingSerializer().addPojoSwaps(getPojoSwaps()).setTrimNullProperties(false);
e = "AQID=a&BAUG=%00&%00=b";
r = s.serialize(t);
assertEquals(e, r);
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core-test/src/test/java/org/apache/juneau/a/rttests/RoundTripTest.java
----------------------------------------------------------------------
diff --git a/juneau-core-test/src/test/java/org/apache/juneau/a/rttests/RoundTripTest.java b/juneau-core-test/src/test/java/org/apache/juneau/a/rttests/RoundTripTest.java
index c0e8070..1912417 100755
--- a/juneau-core-test/src/test/java/org/apache/juneau/a/rttests/RoundTripTest.java
+++ b/juneau-core-test/src/test/java/org/apache/juneau/a/rttests/RoundTripTest.java
@@ -13,11 +13,6 @@
package org.apache.juneau.a.rttests;
import static org.apache.juneau.a.rttests.RoundTripTest.Flags.*;
-import static org.apache.juneau.jena.RdfSerializerContext.*;
-import static org.apache.juneau.urlencoding.UonSerializerContext.*;
-import static org.apache.juneau.urlencoding.UrlEncodingContext.*;
-import static org.apache.juneau.xml.XmlSerializerContext.*;
-import static org.apache.juneau.html.HtmlSerializerContext.*;
import java.lang.reflect.Type;
import java.util.*;
@@ -53,121 +48,121 @@ public abstract class RoundTripTest {
// Full round-trip testing
{ /* 0 */
"Json - default",
- new JsonSerializer().setProperty(SERIALIZER_trimNullProperties, false),
+ new JsonSerializer().setTrimNullProperties(false),
JsonParser.DEFAULT,
0
},
{ /* 1 */
"Json - lax",
- new JsonSerializer.Simple().setProperty(SERIALIZER_trimNullProperties, false),
+ new JsonSerializer.Simple().setTrimNullProperties(false),
JsonParser.DEFAULT,
0
},
{ /* 2 */
"Json - lax, readable",
- new JsonSerializer.SimpleReadable().setProperty(SERIALIZER_trimNullProperties, false),
+ new JsonSerializer.SimpleReadable().setTrimNullProperties(false),
JsonParser.DEFAULT,
0
},
{ /* 3 */
"Xml - namespaces, validation, readable",
- new XmlSerializer.NsSq().setProperty(SERIALIZER_trimNullProperties, false).setProperty(XML_addNamespaceUrisToRoot, true).setProperty(SERIALIZER_useIndentation, true),
+ new XmlSerializer.NsSq().setTrimNullProperties(false).setAddNamespaceUrisToRoot(true).setUseIndentation(true),
XmlParser.DEFAULT,
CHECK_XML_WHITESPACE | VALIDATE_XML
},
{ /* 4 */
"Xml - no namespaces, validation",
- new XmlSerializer.Sq().setProperty(SERIALIZER_trimNullProperties, false),
+ new XmlSerializer.Sq().setTrimNullProperties(false),
XmlParser.DEFAULT,
CHECK_XML_WHITESPACE
},
{ /* 5 */
"Html - default",
- new HtmlSerializer().setProperty(SERIALIZER_trimNullProperties, false),
+ new HtmlSerializer().setTrimNullProperties(false),
HtmlParser.DEFAULT,
CHECK_XML_WHITESPACE
},
{ /* 6 */
"Html - readable",
- new HtmlSerializer.SqReadable().setProperty(SERIALIZER_trimNullProperties, false),
+ new HtmlSerializer.SqReadable().setTrimNullProperties(false),
HtmlParser.DEFAULT,
CHECK_XML_WHITESPACE
},
{ /* 7 */
"Html - with key/value headers",
- new HtmlSerializer().setProperty(HTML_addKeyValueTableHeaders, true),
+ new HtmlSerializer().setAddKeyValueTableHeaders(true),
HtmlParser.DEFAULT,
CHECK_XML_WHITESPACE
},
{ /* 8 */
"Uon - default",
- new UonSerializer().setProperty(SERIALIZER_trimNullProperties, false).setProperty(UON_simpleMode, false),
+ new UonSerializer().setTrimNullProperties(false).setSimpleMode(false),
UonParser.DEFAULT,
0
},
{ /* 9 */
"Uon - readable",
- new UonSerializer.Readable().setProperty(SERIALIZER_trimNullProperties, false).setProperty(UON_simpleMode, false),
+ new UonSerializer.Readable().setTrimNullProperties(false).setSimpleMode(false),
UonParser.DEFAULT_WS_AWARE,
0
},
{ /* 10 */
"Uon - encoded",
- new UonSerializer.Encoding().setProperty(SERIALIZER_trimNullProperties, false).setProperty(UON_simpleMode, false),
+ new UonSerializer.Encoding().setTrimNullProperties(false).setSimpleMode(false),
UonParser.DEFAULT_DECODING,
0
},
{ /* 11 */
"UrlEncoding - default",
- new UrlEncodingSerializer().setProperty(SERIALIZER_trimNullProperties, false).setProperty(UON_simpleMode, false),
+ new UrlEncodingSerializer().setTrimNullProperties(false).setSimpleMode(false),
UrlEncodingParser.DEFAULT,
0
},
{ /* 12 */
"UrlEncoding - readable",
- new UrlEncodingSerializer.Readable().setProperty(SERIALIZER_trimNullProperties, false).setProperty(UON_simpleMode, false),
+ new UrlEncodingSerializer.Readable().setTrimNullProperties(false).setSimpleMode(false),
UrlEncodingParser.DEFAULT_WS_AWARE,
0
},
{ /* 13 */
"UrlEncoding - expanded params",
- new UrlEncodingSerializer().setProperty(URLENC_expandedParams, true).setProperty(UON_simpleMode, false),
- new UrlEncodingParser().setProperty(URLENC_expandedParams, true),
+ new UrlEncodingSerializer().setExpandedParams(true).setSimpleMode(false),
+ new UrlEncodingParser().setExpandedParams(true),
0
},
{ /* 14 */
"Rdf.Xml",
- new RdfSerializer.Xml().setProperty(SERIALIZER_trimNullProperties, false).setProperty(RDF_addLiteralTypes, true),
+ new RdfSerializer.Xml().setTrimNullProperties(false).setAddLiteralTypes(true),
RdfParser.DEFAULT_XML,
0
},
{ /* 15 */
"Rdf.XmlAbbrev",
- new RdfSerializer.XmlAbbrev().setProperty(SERIALIZER_trimNullProperties, false).setProperty(RDF_addLiteralTypes, true),
+ new RdfSerializer.XmlAbbrev().setTrimNullProperties(false).setAddLiteralTypes(true),
RdfParser.DEFAULT_XML,
0
},
{ /* 16 */
"Rdf.Turtle",
- new RdfSerializer.Turtle().setProperty(SERIALIZER_trimNullProperties, false).setProperty(RDF_addLiteralTypes, true),
+ new RdfSerializer.Turtle().setTrimNullProperties(false).setAddLiteralTypes(true),
RdfParser.DEFAULT_TURTLE,
0
},
{ /* 17 */
"Rdf.NTriple",
- new RdfSerializer.NTriple().setProperty(SERIALIZER_trimNullProperties, false).setProperty(RDF_addLiteralTypes, true),
+ new RdfSerializer.NTriple().setTrimNullProperties(false).setAddLiteralTypes(true),
RdfParser.DEFAULT_NTRIPLE,
0
},
{ /* 18 */
"Rdf.N3",
- new RdfSerializer.N3().setProperty(SERIALIZER_trimNullProperties, false).setProperty(RDF_addLiteralTypes, true),
+ new RdfSerializer.N3().setTrimNullProperties(false).setAddLiteralTypes(true),
RdfParser.DEFAULT_N3,
0
},
{ /* 19 */
"MsgPack",
- new MsgPackSerializer().setProperty(SERIALIZER_trimNullProperties, false).setProperty(RDF_addLiteralTypes, true),
+ new MsgPackSerializer().setTrimNullProperties(false),
MsgPackParser.DEFAULT,
0
},
@@ -175,13 +170,13 @@ public abstract class RoundTripTest {
// Validation testing only
{ /* 20 */
"Json schema",
- new JsonSchemaSerializer().setProperty(SERIALIZER_trimNullProperties, false),
+ new JsonSchemaSerializer().setTrimNullProperties(false),
null,
RETURN_ORIGINAL_OBJECT
},
{ /* 21 */
"Xml schema",
- new XmlSchemaSerializer().setProperty(SERIALIZER_trimNullProperties, false),
+ new XmlSchemaSerializer().setTrimNullProperties(false),
new XmlValidatorParser(),
RETURN_ORIGINAL_OBJECT | CHECK_XML_WHITESPACE
},
@@ -197,8 +192,8 @@ public abstract class RoundTripTest {
public boolean debug = false;
public RoundTripTest(String label, Serializer s, Parser p, int flags) throws Exception {
- this.s = s.clone().addBeanFilters(getBeanFilters()).addPojoSwaps(getPojoSwaps()).addToDictionary(getDictionary());
- this.p = p == null ? null : p.clone().addBeanFilters(getBeanFilters()).addPojoSwaps(getPojoSwaps()).addToDictionary(getDictionary());
+ this.s = s.clone().addBeanFilters(getBeanFilters()).addPojoSwaps(getPojoSwaps()).addToBeanDictionary(getDictionary());
+ this.p = p == null ? null : p.clone().addBeanFilters(getBeanFilters()).addPojoSwaps(getPojoSwaps()).addToBeanDictionary(getDictionary());
this.label = label;
Map<Class<Object>, Class<? extends Object>> m = getImplClasses();
@@ -271,10 +266,10 @@ public abstract class RoundTripTest {
p.addPojoSwaps(c);
}
- protected void addToDictionary(Class<?>...c) {
- s.addToDictionary(c);
+ protected void addToBeanDictionary(Class<?>...c) {
+ s.addToBeanDictionary(c);
if (p != null)
- p.addToDictionary(c);
+ p.addToBeanDictionary(c);
}
public boolean isValidationOnly() {
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core-test/src/test/java/org/apache/juneau/a/rttests/RoundTripTrimStringsTest.java
----------------------------------------------------------------------
diff --git a/juneau-core-test/src/test/java/org/apache/juneau/a/rttests/RoundTripTrimStringsTest.java b/juneau-core-test/src/test/java/org/apache/juneau/a/rttests/RoundTripTrimStringsTest.java
index 1801f88..37c1d10 100755
--- a/juneau-core-test/src/test/java/org/apache/juneau/a/rttests/RoundTripTrimStringsTest.java
+++ b/juneau-core-test/src/test/java/org/apache/juneau/a/rttests/RoundTripTrimStringsTest.java
@@ -40,8 +40,8 @@ public class RoundTripTrimStringsTest extends RoundTripTest {
Parser p = getParser();
Object in, a, e;
- Serializer s2 = s.clone().setProperty(SerializerContext.SERIALIZER_trimStrings, true);
- Parser p2 = p.clone().setProperty(ParserContext.PARSER_trimStrings, true);
+ Serializer s2 = s.clone().setTrimStrings(true);
+ Parser p2 = p.clone().setTrimStrings(true);
in = " foo bar ";
e = "foo bar";
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core-test/src/test/java/org/apache/juneau/dto/atom/AtomTest.java
----------------------------------------------------------------------
diff --git a/juneau-core-test/src/test/java/org/apache/juneau/dto/atom/AtomTest.java b/juneau-core-test/src/test/java/org/apache/juneau/dto/atom/AtomTest.java
index aadc082..362aa8a 100755
--- a/juneau-core-test/src/test/java/org/apache/juneau/dto/atom/AtomTest.java
+++ b/juneau-core-test/src/test/java/org/apache/juneau/dto/atom/AtomTest.java
@@ -12,9 +12,7 @@
// ***************************************************************************************************************************
package org.apache.juneau.dto.atom;
-import static org.apache.juneau.BeanContext.*;
import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.xml.XmlSerializerContext.*;
import static org.junit.Assert.*;
import static org.apache.juneau.dto.atom.AtomBuilder.*;
@@ -100,7 +98,7 @@ public class AtomTest {
+" <updated>2016-12-31T01:02:03-04:00</updated>\n"
+"</feed>\n";
- s = new XmlSerializer.SqReadable().setProperty(XML_enableNamespaces, false).setProperty(BEAN_sortProperties, true);
+ s = new XmlSerializer.SqReadable().setEnableNamespaces(false).setSortProperties(true);
r = s.serialize(f);
assertEquals(expected, r);
f2 = p.parse(r, Feed.class);
@@ -146,7 +144,7 @@ public class AtomTest {
+" <atom:updated>2016-12-31T01:02:03-04:00</atom:updated>\n"
+"</atom:feed>\n";
- s = new XmlSerializer.SqReadable().setProperty(XML_enableNamespaces, true).setProperty(XML_addNamespaceUrisToRoot, true).setProperty(BEAN_sortProperties, true);
+ s = new XmlSerializer.SqReadable().setEnableNamespaces(true).setAddNamespaceUrisToRoot(true).setSortProperties(true);
r = s.serialize(f);
assertEquals(expected, r);
f2 = p.parse(r, Feed.class);
@@ -192,7 +190,7 @@ public class AtomTest {
+" <updated>2016-12-31T01:02:03-04:00</updated>\n"
+"</feed>\n";
- s = new XmlSerializer.SqReadable().setProperty(XML_defaultNamespace, "atom").setProperty(XML_enableNamespaces, true).setProperty(XML_addNamespaceUrisToRoot, true).setProperty(BEAN_sortProperties, true);
+ s = new XmlSerializer.SqReadable().setDefaultNamespace("atom").setEnableNamespaces(true).setAddNamespaceUrisToRoot(true).setSortProperties(true);
r = s.serialize(f);
assertEquals(expected, r);
f2 = p.parse(r, Feed.class);
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core-test/src/test/java/org/apache/juneau/dto/cognos/CognosXmlTest.java
----------------------------------------------------------------------
diff --git a/juneau-core-test/src/test/java/org/apache/juneau/dto/cognos/CognosXmlTest.java b/juneau-core-test/src/test/java/org/apache/juneau/dto/cognos/CognosXmlTest.java
index 90db605..bd98a6d 100755
--- a/juneau-core-test/src/test/java/org/apache/juneau/dto/cognos/CognosXmlTest.java
+++ b/juneau-core-test/src/test/java/org/apache/juneau/dto/cognos/CognosXmlTest.java
@@ -13,8 +13,6 @@
package org.apache.juneau.dto.cognos;
import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.serializer.SerializerContext.*;
-import static org.apache.juneau.xml.XmlSerializerContext.*;
import static org.junit.Assert.*;
import java.util.*;
@@ -75,11 +73,11 @@ public class CognosXmlTest {
};
XmlSerializer s = new XmlSerializer()
- .setProperty(SERIALIZER_useIndentation, true)
- .setProperty(SERIALIZER_quoteChar, '\'')
- .setProperty(XML_defaultNamespace, "cognos")
- .setProperty(XML_enableNamespaces, true)
- .setProperty(XML_addNamespaceUrisToRoot, true);
+ .setUseIndentation(true)
+ .setQuoteChar('\'')
+ .setDefaultNamespace("cognos")
+ .setEnableNamespaces(true)
+ .setAddNamespaceUrisToRoot(true);
DataSet ds = new DataSet(c, rows, BeanContext.DEFAULT.createSession());
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core-test/src/test/java/org/apache/juneau/html/CommonParserTest.java
----------------------------------------------------------------------
diff --git a/juneau-core-test/src/test/java/org/apache/juneau/html/CommonParserTest.java b/juneau-core-test/src/test/java/org/apache/juneau/html/CommonParserTest.java
index abc948f..b03bd57 100755
--- a/juneau-core-test/src/test/java/org/apache/juneau/html/CommonParserTest.java
+++ b/juneau-core-test/src/test/java/org/apache/juneau/html/CommonParserTest.java
@@ -12,8 +12,6 @@
// ***************************************************************************************************************************
package org.apache.juneau.html;
-import static org.apache.juneau.BeanContext.*;
-import static org.apache.juneau.serializer.SerializerContext.*;
import static org.junit.Assert.*;
import java.util.*;
@@ -31,7 +29,7 @@ public class CommonParserTest {
//====================================================================================================
@Test
public void testFromSerializer() throws Exception {
- ReaderParser p = HtmlParser.DEFAULT.clone().setClassLoader(getClass().getClassLoader()).addToDictionary(A1.class);
+ ReaderParser p = HtmlParser.DEFAULT.clone().addToBeanDictionary(A1.class);
Map m = null;
String in;
@@ -65,7 +63,7 @@ public class CommonParserTest {
t2.add(new A3("name0","value0"));
t2.add(new A3("name1","value1"));
t1.list = t2;
- in = new HtmlSerializer().setProperty(SERIALIZER_addBeanTypeProperties, true).serialize(t1);
+ in = new HtmlSerializer().setAddBeanTypeProperties(true).serialize(t1);
t1 = (A1)p.parse(in, Object.class);
assertEquals("value1", t1.list.get(1).value);
@@ -96,7 +94,7 @@ public class CommonParserTest {
//====================================================================================================
@Test
public void testCorrectHandlingOfUnknownProperties() throws Exception {
- ReaderParser p = new HtmlParser().setProperty(BEAN_ignoreUnknownBeanProperties, true);
+ ReaderParser p = new HtmlParser().setIgnoreUnknownBeanProperties(true);
B t;
String in = "<table _type='object'><tr><th><string>key</string></th><th><string>value</string></th></tr><tr><td><string>a</string></td><td><number>1</number></td></tr><tr><td><string>unknown</string></td><td><number>1</number></td></tr><tr><td><string>b</string></td><td><number>2</number></td></tr></table>";
@@ -145,7 +143,7 @@ public class CommonParserTest {
@Test
public void testParserListeners() throws Exception {
final List<String> events = new LinkedList<String>();
- HtmlParser p = new HtmlParser().setProperty(BEAN_ignoreUnknownBeanProperties, true);
+ HtmlParser p = new HtmlParser().setIgnoreUnknownBeanProperties(true);
p.addListener(
new ParserListener() {
@Override /* ParserListener */
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core-test/src/test/java/org/apache/juneau/html/CommonTest.java
----------------------------------------------------------------------
diff --git a/juneau-core-test/src/test/java/org/apache/juneau/html/CommonTest.java b/juneau-core-test/src/test/java/org/apache/juneau/html/CommonTest.java
index e5f316d..0109e44 100755
--- a/juneau-core-test/src/test/java/org/apache/juneau/html/CommonTest.java
+++ b/juneau-core-test/src/test/java/org/apache/juneau/html/CommonTest.java
@@ -12,7 +12,6 @@
// ***************************************************************************************************************************
package org.apache.juneau.html;
-import static org.apache.juneau.BeanContext.*;
import static org.apache.juneau.TestUtils.*;
import static org.apache.juneau.html.HtmlSerializerContext.*;
import static org.junit.Assert.*;
@@ -25,7 +24,6 @@ import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
import org.apache.juneau.serializer.*;
import org.apache.juneau.testbeans.*;
-import org.apache.juneau.xml.*;
import org.junit.*;
@SuppressWarnings({"serial","javadoc"})
@@ -36,17 +34,17 @@ public class CommonTest {
//====================================================================================================
@Test
public void testTrimNullsFromBeans() throws Exception {
- HtmlSerializer s = new HtmlSerializer.Sq().setProperty(HTML_addKeyValueTableHeaders, true);
+ HtmlSerializer s = new HtmlSerializer.Sq().setAddKeyValueTableHeaders(true);
HtmlParser p = HtmlParser.DEFAULT;
A t1 = A.create(), t2;
- s.setProperty(SERIALIZER_trimNullProperties, false);
+ s.setTrimNullProperties(false);
String r = s.serialize(t1);
assertEquals("<table><tr><th>key</th><th>value</th></tr><tr><td>s1</td><td><null/></td></tr><tr><td>s2</td><td>s2</td></tr></table>", r);
t2 = p.parse(r, A.class);
assertEqualObjects(t1, t2);
- s.setProperty(SERIALIZER_trimNullProperties, true);
+ s.setTrimNullProperties(true);
r = s.serialize(t1);
assertEquals("<table><tr><th>key</th><th>value</th></tr><tr><td>s2</td><td>s2</td></tr></table>", r);
t2 = p.parse(r, A.class);
@@ -68,18 +66,18 @@ public class CommonTest {
//====================================================================================================
@Test
public void testTrimEmptyMaps() throws Exception {
- HtmlSerializer s = new HtmlSerializer.Sq().setProperty(HTML_addKeyValueTableHeaders, true);
+ HtmlSerializer s = new HtmlSerializer.Sq().setAddKeyValueTableHeaders(true);
HtmlParser p = HtmlParser.DEFAULT;
B t1 = B.create(), t2;
String r;
- s.setProperty(SERIALIZER_trimEmptyMaps, false);
+ s.setTrimEmptyMaps(false);
r = s.serialize(t1);
assertEquals("<table><tr><th>key</th><th>value</th></tr><tr><td>f1</td><td><table><tr><th>key</th><th>value</th></tr></table></td></tr><tr><td>f2</td><td><table><tr><th>key</th><th>value</th></tr><tr><td>f2a</td><td><null/></td></tr><tr><td>f2b</td><td><table><tr><th>key</th><th>value</th></tr><tr><td>s2</td><td>s2</td></tr></table></td></tr></table></td></tr></table>", r);
t2 = p.parse(r, B.class);
assertEqualObjects(t1, t2);
- s.setProperty(SERIALIZER_trimEmptyMaps, true);
+ s.setTrimEmptyMaps(true);
r = s.serialize(t1);
assertEquals("<table><tr><th>key</th><th>value</th></tr><tr><td>f2</td><td><table><tr><th>key</th><th>value</th></tr><tr><td>f2a</td><td><null/></td></tr><tr><td>f2b</td><td><table><tr><th>key</th><th>value</th></tr><tr><td>s2</td><td>s2</td></tr></table></td></tr></table></td></tr></table>", r);
t2 = p.parse(r, B.class);
@@ -102,18 +100,18 @@ public class CommonTest {
//====================================================================================================
@Test
public void testTrimEmptyLists() throws Exception {
- HtmlSerializer s = new HtmlSerializer.Sq().setProperty(HTML_addKeyValueTableHeaders, true);
+ HtmlSerializer s = new HtmlSerializer.Sq().setAddKeyValueTableHeaders(true);
HtmlParser p = HtmlParser.DEFAULT;
C t1 = C.create(), t2;
String r;
- s.setProperty(SERIALIZER_trimEmptyCollections, false);
+ s.setTrimEmptyCollections(false);
r = s.serialize(t1);
assertEquals("<table><tr><th>key</th><th>value</th></tr><tr><td>f1</td><td><ul></ul></td></tr><tr><td>f2</td><td><table _type='array'><tr><th>s2</th></tr><tr><null/></tr><tr><td>s2</td></tr></table></td></tr></table>", r);
t2 = p.parse(r, C.class);
assertEqualObjects(t1, t2);
- s.setProperty(SERIALIZER_trimEmptyCollections, true);
+ s.setTrimEmptyCollections(true);
r = s.serialize(t1);
assertEquals("<table><tr><th>key</th><th>value</th></tr><tr><td>f2</td><td><table _type='array'><tr><th>s2</th></tr><tr><null/></tr><tr><td>s2</td></tr></table></td></tr></table>", r);
t2 = p.parse(r, C.class);
@@ -136,12 +134,12 @@ public class CommonTest {
//====================================================================================================
@Test
public void testTrimEmptyArrays() throws Exception {
- HtmlSerializer s = new HtmlSerializer.Sq().setProperty(HTML_addKeyValueTableHeaders, true);
+ HtmlSerializer s = new HtmlSerializer.Sq().setAddKeyValueTableHeaders(true);
HtmlParser p = HtmlParser.DEFAULT;
D t1 = D.create(), t2;
String r;
- s.setProperty(SERIALIZER_trimEmptyCollections, false);
+ s.setTrimEmptyCollections(false);
r = s.serialize(t1);
assertEquals(
"<table>"
@@ -165,7 +163,7 @@ public class CommonTest {
t2 = p.parse(r, D.class);
assertEqualObjects(t1, t2);
- s.setProperty(SERIALIZER_trimEmptyCollections, true);
+ s.setTrimEmptyCollections(true);
r = s.serialize(t1);
assertEquals(
"<table>"
@@ -202,7 +200,7 @@ public class CommonTest {
//====================================================================================================
@Test
public void testBeanPropertyProperties() throws Exception {
- HtmlSerializer s = HtmlSerializer.DEFAULT_SQ.clone().setProperty(HTML_addKeyValueTableHeaders, true);
+ HtmlSerializer s = HtmlSerializer.DEFAULT_SQ.clone().setAddKeyValueTableHeaders(true);
E1 t = new E1();
String r;
@@ -355,12 +353,12 @@ public class CommonTest {
//====================================================================================================
@Test
public void testUris() throws Exception {
- HtmlSerializer s = new HtmlSerializer.Sq().setProperty(HTML_uriAnchorText, PROPERTY_NAME).setProperty(SERIALIZER_useIndentation, false).setProperty(HTML_addKeyValueTableHeaders, true);
+ HtmlSerializer s = new HtmlSerializer.Sq().setUriAnchorText(PROPERTY_NAME).setUseIndentation(false).setAddKeyValueTableHeaders(true);
TestURI t = new TestURI();
String r;
String expected;
- s.setProperty(SERIALIZER_relativeUriBase, null);
+ s.setRelativeUriBase(null);
r = strip(s.serialize(t));
expected = ""
+"\n[f0]=<a href='f0/x0'>f0</a>"
@@ -381,7 +379,7 @@ public class CommonTest {
;
assertEquals(expected, r);
- s.setProperty(SERIALIZER_relativeUriBase, ""); // Same as null.
+ s.setRelativeUriBase(""); // Same as null.
r = strip(s.serialize(t));
expected = ""
+"\n[f0]=<a href='f0/x0'>f0</a>"
@@ -402,7 +400,7 @@ public class CommonTest {
;
assertEquals(expected, r);
- s.setProperty(SERIALIZER_relativeUriBase, "/cr");
+ s.setRelativeUriBase("/cr");
r = strip(s.serialize(t));
expected = ""
+"\n[f0]=<a href='/cr/f0/x0'>f0</a>"
@@ -423,7 +421,7 @@ public class CommonTest {
;
assertEquals(expected, r);
- s.setProperty(SERIALIZER_relativeUriBase, "/cr/"); // Same as above
+ s.setRelativeUriBase("/cr/"); // Same as above
r = strip(s.serialize(t));
expected = ""
+"\n[f0]=<a href='/cr/f0/x0'>f0</a>"
@@ -444,7 +442,7 @@ public class CommonTest {
;
assertEquals(expected, r);
- s.setProperty(SERIALIZER_relativeUriBase, "/");
+ s.setRelativeUriBase("/");
r = strip(s.serialize(t));
expected = ""
+"\n[f0]=<a href='/f0/x0'>f0</a>"
@@ -465,9 +463,9 @@ public class CommonTest {
;
assertEquals(expected, r);
- s.setProperty(SERIALIZER_relativeUriBase, null);
+ s.setRelativeUriBase(null);
- s.setProperty(SERIALIZER_absolutePathUriBase, "http://foo");
+ s.setAbsolutePathUriBase("http://foo");
r = strip(s.serialize(t));
expected = ""
+"\n[f0]=<a href='f0/x0'>f0</a>"
@@ -488,7 +486,7 @@ public class CommonTest {
;
assertEquals(expected, r);
- s.setProperty(SERIALIZER_absolutePathUriBase, "http://foo/");
+ s.setAbsolutePathUriBase("http://foo/");
r = strip(s.serialize(t));
expected = ""
+"\n[f0]=<a href='f0/x0'>f0</a>"
@@ -509,7 +507,7 @@ public class CommonTest {
;
assertEquals(expected, r);
- s.setProperty(SERIALIZER_absolutePathUriBase, ""); // Same as null.
+ s.setAbsolutePathUriBase(""); // Same as null.
r = strip(s.serialize(t));
expected = ""
+"\n[f0]=<a href='f0/x0'>f0</a>"
@@ -547,15 +545,15 @@ public class CommonTest {
public void testLockedSerializer() throws Exception {
HtmlSerializer s = new HtmlSerializer().lock();
try {
- s.setProperty(XmlSerializerContext.XML_enableNamespaces, true);
+ s.setEnableNamespaces(true);
fail("Locked exception not thrown");
} catch (LockedException e) {}
try {
- s.setProperty(SerializerContext.SERIALIZER_addBeanTypeProperties, true);
+ s.setAddBeanTypeProperties(true);
fail("Locked exception not thrown");
} catch (LockedException e) {}
try {
- s.setProperty(BeanContext.BEAN_beanMapPutReturnsOldValue, true);
+ s.setBeanMapPutReturnsOldValue(true);
fail("Locked exception not thrown");
} catch (LockedException e) {}
}
@@ -565,7 +563,7 @@ public class CommonTest {
//====================================================================================================
@Test
public void testRecursion() throws Exception {
- HtmlSerializer s = new HtmlSerializer.Sq().setProperty(HTML_addKeyValueTableHeaders, true);
+ HtmlSerializer s = new HtmlSerializer.Sq().setAddKeyValueTableHeaders(true);
R1 r1 = new R1();
R2 r2 = new R2();
@@ -584,7 +582,7 @@ public class CommonTest {
}
// Recursion detection, no ignore
- s.setProperty(SERIALIZER_detectRecursions, true);
+ s.setDetectRecursions(true);
try {
s.serialize(r1);
fail("Exception expected!");
@@ -596,7 +594,7 @@ public class CommonTest {
assertTrue(msg.contains("->[3]r1:org.apache.juneau.html.CommonTest$R1"));
}
- s.setProperty(SERIALIZER_ignoreRecursions, true);
+ s.setIgnoreRecursions(true);
assertEquals("<table><tr><th>key</th><th>value</th></tr><tr><td>name</td><td>foo</td></tr><tr><td>r2</td><td><table><tr><th>key</th><th>value</th></tr><tr><td>name</td><td>bar</td></tr><tr><td>r3</td><td><table><tr><th>key</th><th>value</th></tr><tr><td>name</td><td>baz</td></tr></table></td></tr></table></td></tr></table>",
s.serialize(r1));
@@ -622,7 +620,7 @@ public class CommonTest {
//====================================================================================================
@Test
public void testBasicBean() throws Exception {
- WriterSerializer s = new HtmlSerializer.Sq().setProperty(SERIALIZER_trimNullProperties, false).setProperty(BEAN_sortProperties, true).setProperty(HTML_addKeyValueTableHeaders, true);
+ WriterSerializer s = new HtmlSerializer.Sq().setTrimNullProperties(false).setSortProperties(true).setAddKeyValueTableHeaders(true);
J a = new J();
a.setF1("J");
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core-test/src/test/java/org/apache/juneau/html/HtmlTest.java
----------------------------------------------------------------------
diff --git a/juneau-core-test/src/test/java/org/apache/juneau/html/HtmlTest.java b/juneau-core-test/src/test/java/org/apache/juneau/html/HtmlTest.java
index 435f85f..2025430 100755
--- a/juneau-core-test/src/test/java/org/apache/juneau/html/HtmlTest.java
+++ b/juneau-core-test/src/test/java/org/apache/juneau/html/HtmlTest.java
@@ -49,12 +49,12 @@ public class HtmlTest {
//====================================================================================================
@Test
public void testAnchorTextOptions() throws Exception {
- HtmlSerializer s = new HtmlSerializer.Sq().setProperty(HTML_addKeyValueTableHeaders, true);
+ HtmlSerializer s = new HtmlSerializer.Sq().setAddKeyValueTableHeaders(true);
TestURI t = new TestURI();
String r;
String expected = null;
- s.setProperty(HTML_uriAnchorText, TO_STRING);
+ s.setUriAnchorText(TO_STRING);
r = strip(s.serialize(t));
expected = ""
+"\n[f0]=<a href='f0/x0'>f0/x0</a>"
@@ -74,9 +74,9 @@ public class HtmlTest {
+"\n[fe]=<a href='http://www.apache.org/fe/xe?foo=bar&label2=MY_LABEL'>http://www.apache.org/fe/xe?foo=bar&label2=MY_LABEL</a>";
assertEquals(expected, r);
- s.setProperty(SERIALIZER_absolutePathUriBase, "http://myhost");
- s.setProperty(SERIALIZER_relativeUriBase, "/cr");
- s.setProperty(HTML_uriAnchorText, TO_STRING);
+ s.setAbsolutePathUriBase("http://myhost");
+ s.setRelativeUriBase("/cr");
+ s.setUriAnchorText(TO_STRING);
r = strip(s.serialize(t));
expected = ""
+"\n[f0]=<a href='/cr/f0/x0'>f0/x0</a>"
@@ -96,7 +96,7 @@ public class HtmlTest {
+"\n[fe]=<a href='http://www.apache.org/fe/xe?foo=bar&label2=MY_LABEL'>http://www.apache.org/fe/xe?foo=bar&label2=MY_LABEL</a>";
assertEquals(expected, r);
- s.setProperty(HTML_uriAnchorText, URI);
+ s.setUriAnchorText(URI);
r = strip(s.serialize(t));
expected = ""
+"\n[f0]=<a href='/cr/f0/x0'>/cr/f0/x0</a>"
@@ -116,7 +116,7 @@ public class HtmlTest {
+"\n[fe]=<a href='http://www.apache.org/fe/xe?foo=bar&label2=MY_LABEL'>http://www.apache.org/fe/xe?foo=bar&label2=MY_LABEL</a>";
assertEquals(expected, r);
- s.setProperty(HTML_uriAnchorText, LAST_TOKEN);
+ s.setUriAnchorText(LAST_TOKEN);
r = strip(s.serialize(t));
expected = ""
+"\n[f0]=<a href='/cr/f0/x0'>x0</a>"
@@ -136,7 +136,7 @@ public class HtmlTest {
+"\n[fe]=<a href='http://www.apache.org/fe/xe?foo=bar&label2=MY_LABEL'>xe</a>";
assertEquals(expected, r);
- s.setProperty(HTML_uriAnchorText, URI_ANCHOR);
+ s.setUriAnchorText(URI_ANCHOR);
r = strip(s.serialize(t));
expected = ""
+"\n[f0]=<a href='/cr/f0/x0'>f0/x0</a>"
@@ -156,7 +156,7 @@ public class HtmlTest {
+"\n[fe]=<a href='http://www.apache.org/fe/xe?foo=bar&label2=MY_LABEL'>http://www.apache.org/fe/xe?foo=bar&label2=MY_LABEL</a>";
assertEquals(expected, r);
- s.setProperty(HTML_labelParameter, "label2");
+ s.setLabelParameter("label2");
r = strip(s.serialize(t));
expected = ""
+"\n[f0]=<a href='/cr/f0/x0'>f0/x0</a>"
@@ -176,7 +176,7 @@ public class HtmlTest {
+"\n[fe]=<a href='http://www.apache.org/fe/xe?foo=bar&label2=MY_LABEL'>MY_LABEL</a>";
assertEquals(expected, r);
- s.setProperty(HTML_detectLinksInStrings, false);
+ s.setDetectLinksInStrings(false);
r = strip(s.serialize(t));
expected = ""
+"\n[f0]=<a href='/cr/f0/x0'>f0/x0</a>"
@@ -196,8 +196,8 @@ public class HtmlTest {
+"\n[fe]=http://www.apache.org/fe/xe?foo=bar&label2=MY_LABEL";
assertEquals(expected, r);
- s.setProperty(HTML_detectLinksInStrings, true);
- s.setProperty(HTML_lookForLabelParameters, false);
+ s.setDetectLinksInStrings(true);
+ s.setLookForLabelParameters(false);
r = strip(s.serialize(t));
expected = ""
+"\n[f0]=<a href='/cr/f0/x0'>f0/x0</a>"
@@ -232,7 +232,7 @@ public class HtmlTest {
//====================================================================================================
@Test
public void testHtmlAnnotationAsPlainText() throws Exception {
- HtmlSerializer s = new HtmlSerializer.Sq().setProperty(HTML_addKeyValueTableHeaders, true);
+ HtmlSerializer s = new HtmlSerializer.Sq().setAddKeyValueTableHeaders(true);
Object o = null;
String r;
@@ -264,7 +264,7 @@ public class HtmlTest {
//====================================================================================================
@Test
public void testHtmlAnnotationAsXml() throws Exception {
- HtmlSerializer s = new HtmlSerializer.Sq().setProperty(HTML_addKeyValueTableHeaders, true);
+ HtmlSerializer s = new HtmlSerializer.Sq().setAddKeyValueTableHeaders(true);
Object o = null;
String r;
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core-test/src/test/java/org/apache/juneau/jena/CommonParserTest.java
----------------------------------------------------------------------
diff --git a/juneau-core-test/src/test/java/org/apache/juneau/jena/CommonParserTest.java b/juneau-core-test/src/test/java/org/apache/juneau/jena/CommonParserTest.java
index 5bd851f..7d034cd 100755
--- a/juneau-core-test/src/test/java/org/apache/juneau/jena/CommonParserTest.java
+++ b/juneau-core-test/src/test/java/org/apache/juneau/jena/CommonParserTest.java
@@ -12,9 +12,7 @@
// ***************************************************************************************************************************
package org.apache.juneau.jena;
-import static org.apache.juneau.BeanContext.*;
import static org.apache.juneau.jena.RdfCommonContext.*;
-import static org.apache.juneau.jena.RdfSerializerContext.*;
import static org.junit.Assert.*;
import java.util.*;
@@ -44,9 +42,9 @@ public class CommonParserTest {
private RdfSerializer getBasicSerializer() {
return new RdfSerializer()
- .setProperty(SERIALIZER_quoteChar, '\'')
- .setProperty(RDF_addLiteralTypes, true)
- .setProperty(SERIALIZER_useIndentation, false)
+ .setQuoteChar('\'')
+ .setAddLiteralTypes(true)
+ .setUseIndentation(false)
.setProperty(RDF_rdfxml_allowBadUris, true)
.setProperty(RDF_rdfxml_showDoctypeDeclaration, false)
.setProperty(RDF_rdfxml_showXmlDeclaration, false);
@@ -58,7 +56,7 @@ public class CommonParserTest {
@Test
public void testFromSerializer() throws Exception {
WriterSerializer s = getBasicSerializer();
- ReaderParser p = new RdfParser.Xml().setProperty(RdfParserContext.RDF_trimWhitespace, true).setClassLoader(getClass().getClassLoader());
+ ReaderParser p = new RdfParser.Xml().setTrimWhitespace(true);
Map m = null;
String in;
Integer one = Integer.valueOf(1);
@@ -111,7 +109,7 @@ public class CommonParserTest {
t2.add(new A3("name1","value1"));
t1.list = t2;
- s.setProperty(SERIALIZER_addBeanTypeProperties, true);
+ s.setAddBeanTypeProperties(true);
in = strip(s.serialize(t1));
assertEquals("<rdf:Description><j:_type>A1</j:_type><jp:list><rdf:Seq><rdf:li rdf:parseType='Resource'><jp:name>name0</jp:name><jp:value>value0</jp:value></rdf:li><rdf:li rdf:parseType='Resource'><jp:name>name1</jp:name><jp:value>value1</jp:value></rdf:li></rdf:Seq></jp:list></rdf:Description>", in);
in = wrap(in);
@@ -141,7 +139,7 @@ public class CommonParserTest {
//====================================================================================================
@Test
public void testCorrectHandlingOfUnknownProperties() throws Exception {
- ReaderParser p = new RdfParser.Xml().setProperty(BEAN_ignoreUnknownBeanProperties, true);
+ ReaderParser p = new RdfParser.Xml().setIgnoreUnknownBeanProperties(true);
B t;
String in = wrap("<rdf:Description><jp:a rdf:datatype='http://www.w3.org/2001/XMLSchema#int'>1</jp:a><jp:unknownProperty>foo</jp:unknownProperty><jp:b rdf:datatype='http://www.w3.org/2001/XMLSchema#int'>2</jp:b></rdf:Description>");
@@ -189,7 +187,7 @@ public class CommonParserTest {
@Test
public void testParserListeners() throws Exception {
final List<String> events = new LinkedList<String>();
- RdfParser p = new RdfParser.Xml().setProperty(BEAN_ignoreUnknownBeanProperties, true);
+ RdfParser p = new RdfParser.Xml().setIgnoreUnknownBeanProperties(true);
p.addListener(
new ParserListener() {
@Override /* ParserListener */
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core-test/src/test/java/org/apache/juneau/jena/CommonTest.java
----------------------------------------------------------------------
diff --git a/juneau-core-test/src/test/java/org/apache/juneau/jena/CommonTest.java b/juneau-core-test/src/test/java/org/apache/juneau/jena/CommonTest.java
index 1e8daff..1c603ae 100755
--- a/juneau-core-test/src/test/java/org/apache/juneau/jena/CommonTest.java
+++ b/juneau-core-test/src/test/java/org/apache/juneau/jena/CommonTest.java
@@ -14,7 +14,6 @@ package org.apache.juneau.jena;
import static org.apache.juneau.TestUtils.*;
import static org.apache.juneau.jena.RdfCommonContext.*;
-import static org.apache.juneau.serializer.SerializerContext.*;
import static org.junit.Assert.*;
import java.net.*;
@@ -27,7 +26,6 @@ import org.apache.juneau.internal.*;
import org.apache.juneau.jena.annotation.*;
import org.apache.juneau.serializer.*;
import org.apache.juneau.testbeans.*;
-import org.apache.juneau.xml.*;
import org.junit.*;
@SuppressWarnings({"serial","javadoc"})
@@ -35,8 +33,8 @@ public class CommonTest {
private RdfSerializer getBasicSerializer() {
return new RdfSerializer()
- .setProperty(SERIALIZER_quoteChar, '\'')
- .setProperty(SERIALIZER_useIndentation, false)
+ .setQuoteChar('\'')
+ .setUseIndentation(false)
.setProperty(RDF_rdfxml_allowBadUris, true)
.setProperty(RDF_rdfxml_showDoctypeDeclaration, false)
.setProperty(RDF_rdfxml_showXmlDeclaration, false);
@@ -55,13 +53,13 @@ public class CommonTest {
RdfParser p = RdfParser.DEFAULT_XML;
A t1 = A.create(), t2;
- s.setProperty(SERIALIZER_trimNullProperties, false);
+ s.setTrimNullProperties(false);
String r = s.serialize(t1);
assertEquals("<rdf:Description><jp:s1 rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/><jp:s2>s2</jp:s2></rdf:Description>", strip(r));
t2 = p.parse(r, A.class);
assertEqualObjects(t1, t2);
- s.setProperty(SERIALIZER_trimNullProperties, true);
+ s.setTrimNullProperties(true);
r = s.serialize(t1);
assertEquals("<rdf:Description><jp:s2>s2</jp:s2></rdf:Description>", strip(r));
t2 = p.parse(r, A.class);
@@ -88,13 +86,13 @@ public class CommonTest {
B t1 = B.create(), t2;
String r;
- s.setProperty(SERIALIZER_trimEmptyMaps, false);
+ s.setTrimEmptyMaps(false);
r = s.serialize(t1);
assertEquals("<rdf:Description><jp:f1 rdf:parseType='Resource'></jp:f1><jp:f2 rdf:parseType='Resource'><jp:f2a rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/><jp:f2b rdf:parseType='Resource'><jp:s2>s2</jp:s2></jp:f2b></jp:f2></rdf:Description>", strip(r));
t2 = p.parse(r, B.class);
assertEqualObjects(t1, t2);
- s.setProperty(SERIALIZER_trimEmptyMaps, true);
+ s.setTrimEmptyMaps(true);
r = s.serialize(t1);
assertEquals("<rdf:Description><jp:f2 rdf:parseType='Resource'><jp:f2a rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/><jp:f2b rdf:parseType='Resource'><jp:s2>s2</jp:s2></jp:f2b></jp:f2></rdf:Description>", strip(r));
t2 = p.parse(r, B.class);
@@ -122,13 +120,13 @@ public class CommonTest {
C t1 = C.create(), t2;
String r;
- s.setProperty(SERIALIZER_trimEmptyCollections, false);
+ s.setTrimEmptyCollections(false);
r = s.serialize(t1);
assertEquals("<rdf:Description><jp:f1><rdf:Seq/></jp:f1><jp:f2><rdf:Seq><rdf:li rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/><rdf:li rdf:parseType='Resource'><jp:s2>s2</jp:s2></rdf:li></rdf:Seq></jp:f2></rdf:Description>", strip(r));
t2 = p.parse(r, C.class);
assertEqualObjects(t1, t2);
- s.setProperty(SERIALIZER_trimEmptyCollections, true);
+ s.setTrimEmptyCollections(true);
r = s.serialize(t1);
assertEquals("<rdf:Description><jp:f2><rdf:Seq><rdf:li rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/><rdf:li rdf:parseType='Resource'><jp:s2>s2</jp:s2></rdf:li></rdf:Seq></jp:f2></rdf:Description>", strip(r));
t2 = p.parse(r, C.class);
@@ -157,13 +155,13 @@ public class CommonTest {
D t1 = D.create(), t2;
String r;
- s.setProperty(SERIALIZER_trimEmptyCollections, false);
+ s.setTrimEmptyCollections(false);
r = s.serialize(t1);
assertEquals("<rdf:Description><jp:f1><rdf:Seq/></jp:f1><jp:f2><rdf:Seq><rdf:li rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/><rdf:li rdf:parseType='Resource'><jp:s2>s2</jp:s2></rdf:li></rdf:Seq></jp:f2></rdf:Description>", strip(r));
t2 = p.parse(r, D.class);
assertEqualObjects(t1, t2);
- s.setProperty(SERIALIZER_trimEmptyCollections, true);
+ s.setTrimEmptyCollections(true);
r = s.serialize(t1);
assertEquals("<rdf:Description><jp:f2><rdf:Seq><rdf:li rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/><rdf:li rdf:parseType='Resource'><jp:s2>s2</jp:s2></rdf:li></rdf:Seq></jp:f2></rdf:Description>", strip(r));
t2 = p.parse(r, D.class);
@@ -288,7 +286,7 @@ public class CommonTest {
String r;
String expected = "";
- s.setProperty(SERIALIZER_relativeUriBase, null);
+ s.setRelativeUriBase(null);
r = stripAndSort(s.serialize(t));
expected = ""
+"</rdf:Description>>"
@@ -310,11 +308,11 @@ public class CommonTest {
;
assertEquals(expected, r);
- s.setProperty(SERIALIZER_relativeUriBase, ""); // Same as null.
+ s.setRelativeUriBase(""); // Same as null.
r = stripAndSort(s.serialize(t));
assertEquals(expected, r);
- s.setProperty(SERIALIZER_relativeUriBase, "/cr");
+ s.setRelativeUriBase("/cr");
r = stripAndSort(s.serialize(t));
expected = ""
+"</rdf:Description>>"
@@ -336,11 +334,11 @@ public class CommonTest {
;
assertEquals(expected, r);
- s.setProperty(SERIALIZER_relativeUriBase, "/cr/"); // Same as above
+ s.setRelativeUriBase("/cr/"); // Same as above
r = stripAndSort(s.serialize(t));
assertEquals(expected, r);
- s.setProperty(SERIALIZER_relativeUriBase, "/");
+ s.setRelativeUriBase("/");
r = stripAndSort(s.serialize(t));
expected = ""
+"</rdf:Description>>"
@@ -362,9 +360,9 @@ public class CommonTest {
;
assertEquals(expected, r);
- s.setProperty(SERIALIZER_relativeUriBase, null);
+ s.setRelativeUriBase(null);
- s.setProperty(SERIALIZER_absolutePathUriBase, "http://foo");
+ s.setAbsolutePathUriBase("http://foo");
r = stripAndSort(s.serialize(t));
expected = ""
+"</rdf:Description>>"
@@ -386,11 +384,11 @@ public class CommonTest {
;
assertEquals(expected, r);
- s.setProperty(SERIALIZER_absolutePathUriBase, "http://foo/");
+ s.setAbsolutePathUriBase("http://foo/");
r = stripAndSort(s.serialize(t));
assertEquals(expected, r);
- s.setProperty(SERIALIZER_absolutePathUriBase, ""); // Same as null.
+ s.setAbsolutePathUriBase(""); // Same as null.
r = stripAndSort(s.serialize(t));
expected = ""
+"</rdf:Description>>"
@@ -428,15 +426,11 @@ public class CommonTest {
public void testLockedSerializer() throws Exception {
RdfSerializer s = getBasicSerializer().lock();
try {
- s.setProperty(XmlSerializerContext.XML_enableNamespaces, true);
+ s.setAddBeanTypeProperties(true);
fail("Locked exception not thrown");
} catch (LockedException e) {}
try {
- s.setProperty(SerializerContext.SERIALIZER_addBeanTypeProperties, true);
- fail("Locked exception not thrown");
- } catch (LockedException e) {}
- try {
- s.setProperty(BeanContext.BEAN_beanMapPutReturnsOldValue, true);
+ s.setBeanMapPutReturnsOldValue(true);
fail("Locked exception not thrown");
} catch (LockedException e) {}
}
@@ -446,7 +440,7 @@ public class CommonTest {
//====================================================================================================
@Test
public void testRecursion() throws Exception {
- WriterSerializer s = new RdfSerializer.XmlAbbrev().setProperty(SERIALIZER_quoteChar, '\'');
+ WriterSerializer s = new RdfSerializer.XmlAbbrev().setQuoteChar('\'');
R1 r1 = new R1();
R2 r2 = new R2();
@@ -465,7 +459,7 @@ public class CommonTest {
}
// Recursion detection, no ignore
- s.setProperty(SERIALIZER_detectRecursions, true);
+ s.setDetectRecursions(true);
try {
s.serialize(r1);
fail("Exception expected!");
@@ -477,7 +471,7 @@ public class CommonTest {
assertTrue(msg.contains("->[3]r1:org.apache.juneau.jena.CommonTest$R1"));
}
- s.setProperty(SERIALIZER_ignoreRecursions, true);
+ s.setIgnoreRecursions(true);
String r = s.serialize(r1).replace("\r", "");
// Note...the order of the namespaces is not always the same depending on the JVM.
// The Jena libraries appear to use a hashmap for these.
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core-test/src/test/java/org/apache/juneau/jena/CommonXmlTest.java
----------------------------------------------------------------------
diff --git a/juneau-core-test/src/test/java/org/apache/juneau/jena/CommonXmlTest.java b/juneau-core-test/src/test/java/org/apache/juneau/jena/CommonXmlTest.java
index 90c9966..81e43cb 100755
--- a/juneau-core-test/src/test/java/org/apache/juneau/jena/CommonXmlTest.java
+++ b/juneau-core-test/src/test/java/org/apache/juneau/jena/CommonXmlTest.java
@@ -14,7 +14,6 @@ package org.apache.juneau.jena;
import static org.apache.juneau.TestUtils.*;
import static org.apache.juneau.jena.RdfCommonContext.*;
-import static org.apache.juneau.serializer.SerializerContext.*;
import static org.junit.Assert.*;
import java.net.*;
@@ -28,8 +27,8 @@ public class CommonXmlTest {
private RdfSerializer getBasicSerializer() {
return new RdfSerializer()
- .setProperty(SERIALIZER_quoteChar, '\'')
- .setProperty(SERIALIZER_useIndentation, false)
+ .setQuoteChar('\'')
+ .setUseIndentation(false)
.setProperty(RDF_rdfxml_allowBadUris, true)
.setProperty(RDF_rdfxml_showDoctypeDeclaration, false)
.setProperty(RDF_rdfxml_showXmlDeclaration, false);
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core-test/src/test/java/org/apache/juneau/jena/RdfParserTest.java
----------------------------------------------------------------------
diff --git a/juneau-core-test/src/test/java/org/apache/juneau/jena/RdfParserTest.java b/juneau-core-test/src/test/java/org/apache/juneau/jena/RdfParserTest.java
index 8eaef41..404c3e9 100755
--- a/juneau-core-test/src/test/java/org/apache/juneau/jena/RdfParserTest.java
+++ b/juneau-core-test/src/test/java/org/apache/juneau/jena/RdfParserTest.java
@@ -14,7 +14,6 @@ package org.apache.juneau.jena;
import static org.apache.juneau.TestUtils.*;
import static org.apache.juneau.jena.RdfCommonContext.*;
-import static org.apache.juneau.jena.RdfSerializerContext.*;
import static org.junit.Assert.*;
import java.net.URI;
@@ -48,8 +47,8 @@ public class RdfParserTest {
// Create a new serializer with readable output.
RdfSerializer s = new RdfSerializer.XmlAbbrev()
.setProperty(RDF_rdfxml_tab, 3)
- .setProperty(SERIALIZER_quoteChar, '\'')
- .setProperty(RDF_addRootProperty, true);
+ .setQuoteChar('\'')
+ .setAddRootProperty(true);
String expected =
"<rdf:RDF a='http://ns/' a1='http://ns2/' j='http://www.apache.org/juneau/' jp='http://www.apache.org/juneaubp/' rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'>"
[14/14] incubator-juneau git commit: Add convenience property setters
to serializers and parsers.
Posted by ja...@apache.org.
Add convenience property setters to serializers and parsers.
Project: http://git-wip-us.apache.org/repos/asf/incubator-juneau/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-juneau/commit/68dffad1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-juneau/tree/68dffad1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-juneau/diff/68dffad1
Branch: refs/heads/master
Commit: 68dffad1d3b26a7d021e5a67a78bf29cbdebbfd7
Parents: 30dd3b9
Author: JamesBognar <ja...@apache.org>
Authored: Thu Feb 9 12:31:15 2017 -0500
Committer: JamesBognar <ja...@apache.org>
Committed: Thu Feb 9 12:31:15 2017 -0500
----------------------------------------------------------------------
.../apache/juneau/jena/RdfCommonContext.java | 195 +--
.../java/org/apache/juneau/jena/RdfParser.java | 631 +++++++-
.../apache/juneau/jena/RdfParserContext.java | 23 -
.../org/apache/juneau/jena/RdfSerializer.java | 792 +++++++++-
.../juneau/jena/RdfSerializerContext.java | 44 -
.../java/org/apache/juneau/BeanConfigTest.java | 135 +-
.../java/org/apache/juneau/BeanMapTest.java | 20 +-
.../org/apache/juneau/IgnoredClassesTest.java | 17 +-
.../test/java/org/apache/juneau/TestUtils.java | 15 +-
.../java/org/apache/juneau/VisibilityTest.java | 65 +-
.../a/rttests/RoundTripAddClassAttrsTest.java | 42 +-
.../a/rttests/RoundTripLargeObjectsTest.java | 31 +-
.../juneau/a/rttests/RoundTripMapsTest.java | 12 +-
.../apache/juneau/a/rttests/RoundTripTest.java | 61 +-
.../a/rttests/RoundTripTrimStringsTest.java | 4 +-
.../org/apache/juneau/dto/atom/AtomTest.java | 8 +-
.../apache/juneau/dto/cognos/CognosXmlTest.java | 12 +-
.../apache/juneau/html/CommonParserTest.java | 10 +-
.../java/org/apache/juneau/html/CommonTest.java | 62 +-
.../java/org/apache/juneau/html/HtmlTest.java | 28 +-
.../apache/juneau/jena/CommonParserTest.java | 16 +-
.../java/org/apache/juneau/jena/CommonTest.java | 54 +-
.../org/apache/juneau/jena/CommonXmlTest.java | 5 +-
.../org/apache/juneau/jena/RdfParserTest.java | 5 +-
.../java/org/apache/juneau/jena/RdfTest.java | 31 +-
.../apache/juneau/json/CommonParserTest.java | 10 +-
.../java/org/apache/juneau/json/CommonTest.java | 48 +-
.../juneau/json/JsonParserEdgeCasesTest.java | 8 +-
.../java/org/apache/juneau/json/JsonTest.java | 11 +-
.../transforms/ByteArrayBase64SwapTest.java | 3 +-
.../juneau/transforms/CalendarSwapTest.java | 16 +-
.../urlencoding/CommonParser_UonTest.java | 12 +-
.../CommonParser_UrlEncodingTest.java | 12 +-
.../juneau/urlencoding/Common_UonTest.java | 46 +-
.../urlencoding/Common_UrlEncodingTest.java | 46 +-
.../urlencoding/UrlEncodingParserTest.java | 2 +-
.../urlencoding/UrlEncodingSerializerTest.java | 4 +-
.../org/apache/juneau/utils/PojoRestTest.java | 5 +-
.../apache/juneau/utils/StringUtilsTest.java | 3 +-
.../org/apache/juneau/xml/CommonParserTest.java | 5 +-
.../java/org/apache/juneau/xml/CommonTest.java | 48 +-
.../org/apache/juneau/xml/CommonXmlTest.java | 3 +-
.../org/apache/juneau/xml/XmlContentTest.java | 5 +-
.../org/apache/juneau/xml/XmlParserTest.java | 3 +-
.../java/org/apache/juneau/xml/XmlTest.java | 216 ++-
.../java/org/apache/juneau/BeanContext.java | 354 -----
.../java/org/apache/juneau/ConfigException.java | 13 +-
.../java/org/apache/juneau/ContextFactory.java | 8 +-
.../main/java/org/apache/juneau/CoreApi.java | 1445 +++++++++++++++++-
.../main/java/org/apache/juneau/Lockable.java | 4 +-
.../main/java/org/apache/juneau/MediaType.java | 2 +-
.../org/apache/juneau/annotation/BeanParam.java | 26 +
.../org/apache/juneau/csv/CsvSerializer.java | 7 +-
.../main/java/org/apache/juneau/dto/Link.java | 1 +
.../org/apache/juneau/dto/atom/Content.java | 1 +
.../java/org/apache/juneau/dto/atom/Entry.java | 1 +
.../java/org/apache/juneau/dto/atom/Icon.java | 1 +
.../java/org/apache/juneau/dto/atom/Source.java | 1 +
.../org/apache/juneau/dto/atom/package.html | 6 +-
.../org/apache/juneau/dto/cognos/Column.java | 1 +
.../java/org/apache/juneau/dto/html5/A.java | 13 +-
.../java/org/apache/juneau/dto/html5/Area.java | 19 +-
.../org/apache/juneau/dto/html5/Article.java | 1 +
.../java/org/apache/juneau/dto/html5/Audio.java | 17 +-
.../java/org/apache/juneau/dto/html5/Base.java | 5 +-
.../org/apache/juneau/dto/html5/Blockquote.java | 3 +-
.../java/org/apache/juneau/dto/html5/Body.java | 13 +-
.../org/apache/juneau/dto/html5/Button.java | 25 +-
.../org/apache/juneau/dto/html5/Canvas.java | 5 +-
.../java/org/apache/juneau/dto/html5/Col.java | 3 +-
.../org/apache/juneau/dto/html5/Colgroup.java | 3 +-
.../java/org/apache/juneau/dto/html5/Data.java | 3 +-
.../java/org/apache/juneau/dto/html5/Del.java | 5 +-
.../java/org/apache/juneau/dto/html5/Embed.java | 9 +-
.../org/apache/juneau/dto/html5/Fieldset.java | 7 +-
.../java/org/apache/juneau/dto/html5/Form.java | 17 +-
.../java/org/apache/juneau/dto/html5/Html.java | 3 +-
.../apache/juneau/dto/html5/HtmlElement.java | 124 +-
.../juneau/dto/html5/HtmlElementText.java | 2 +-
.../org/apache/juneau/dto/html5/Iframe.java | 13 +-
.../java/org/apache/juneau/dto/html5/Img.java | 15 +-
.../java/org/apache/juneau/dto/html5/Input.java | 65 +-
.../java/org/apache/juneau/dto/html5/Ins.java | 5 +-
.../org/apache/juneau/dto/html5/Keygen.java | 13 +-
.../java/org/apache/juneau/dto/html5/Label.java | 5 +-
.../java/org/apache/juneau/dto/html5/Link.java | 15 +-
.../java/org/apache/juneau/dto/html5/Map.java | 3 +-
.../java/org/apache/juneau/dto/html5/Meta.java | 9 +-
.../java/org/apache/juneau/dto/html5/Meter.java | 13 +-
.../org/apache/juneau/dto/html5/Object2.java | 17 +-
.../java/org/apache/juneau/dto/html5/Ol.java | 7 +-
.../org/apache/juneau/dto/html5/Optgroup.java | 5 +-
.../org/apache/juneau/dto/html5/Option.java | 9 +-
.../org/apache/juneau/dto/html5/Output.java | 7 +-
.../java/org/apache/juneau/dto/html5/Param.java | 5 +-
.../org/apache/juneau/dto/html5/Progress.java | 5 +-
.../java/org/apache/juneau/dto/html5/Q.java | 3 +-
.../org/apache/juneau/dto/html5/Script.java | 13 +-
.../org/apache/juneau/dto/html5/Select.java | 15 +-
.../org/apache/juneau/dto/html5/Source.java | 5 +-
.../java/org/apache/juneau/dto/html5/Style.java | 5 +-
.../java/org/apache/juneau/dto/html5/Table.java | 3 +-
.../java/org/apache/juneau/dto/html5/Td.java | 7 +-
.../org/apache/juneau/dto/html5/Textarea.java | 31 +-
.../java/org/apache/juneau/dto/html5/Th.java | 13 +-
.../java/org/apache/juneau/dto/html5/Time.java | 3 +-
.../java/org/apache/juneau/dto/html5/Track.java | 11 +-
.../java/org/apache/juneau/dto/html5/Video.java | 23 +-
.../apache/juneau/dto/jsonschema/Schema.java | 1 +
.../apache/juneau/encoders/EncoderGroup.java | 2 +-
.../apache/juneau/html/HtmlDocSerializer.java | 477 +++++-
.../juneau/html/HtmlDocSerializerContext.java | 47 -
.../java/org/apache/juneau/html/HtmlParser.java | 412 ++++-
.../apache/juneau/html/HtmlParserContext.java | 15 -
.../juneau/html/HtmlSchemaDocSerializer.java | 9 +-
.../org/apache/juneau/html/HtmlSerializer.java | 607 +++++++-
.../juneau/html/HtmlSerializerContext.java | 44 -
.../org/apache/juneau/ini/ConfigFileImpl.java | 2 +
.../java/org/apache/juneau/ini/Section.java | 4 +
.../org/apache/juneau/internal/ClassUtils.java | 109 ++
.../org/apache/juneau/internal/Version.java | 2 +-
.../java/org/apache/juneau/json/JsonParser.java | 389 ++++-
.../apache/juneau/json/JsonParserContext.java | 15 -
.../juneau/json/JsonSchemaSerializer.java | 16 +-
.../org/apache/juneau/json/JsonSerializer.java | 554 ++++++-
.../juneau/json/JsonSerializerContext.java | 37 -
.../java/org/apache/juneau/json/JsonWriter.java | 1 +
.../java/org/apache/juneau/json/package.html | 10 +-
.../apache/juneau/msgpack/MsgPackParser.java | 390 ++++-
.../juneau/msgpack/MsgPackParserContext.java | 15 -
.../juneau/msgpack/MsgPackSerializer.java | 452 +++++-
.../msgpack/MsgPackSerializerContext.java | 15 -
.../java/org/apache/juneau/parser/Parser.java | 503 +++++-
.../org/apache/juneau/parser/ParserContext.java | 33 -
.../org/apache/juneau/parser/ParserGroup.java | 995 +++++++++++-
.../org/apache/juneau/parser/ParserMatch.java | 4 +-
.../serializer/OutputStreamSerializer.java | 1 +
.../apache/juneau/serializer/Serializer.java | 828 +++++++++-
.../juneau/serializer/SerializerContext.java | 110 --
.../juneau/serializer/SerializerGroup.java | 1159 +++++++++++++-
.../juneau/serializer/WriterSerializer.java | 1 +
.../java/org/apache/juneau/svl/VarResolver.java | 1 +
.../org/apache/juneau/transform/PojoSwap.java | 1 +
.../apache/juneau/urlencoding/UonParser.java | 445 +++++-
.../juneau/urlencoding/UonParserContext.java | 30 -
.../juneau/urlencoding/UonSerializer.java | 605 +++++++-
.../urlencoding/UonSerializerContext.java | 37 -
.../apache/juneau/urlencoding/UonWriter.java | 1 +
.../juneau/urlencoding/UrlEncodingContext.java | 2 +-
.../juneau/urlencoding/UrlEncodingParser.java | 455 +++++-
.../urlencoding/UrlEncodingParserContext.java | 25 +-
.../urlencoding/UrlEncodingSerializer.java | 537 ++++++-
.../UrlEncodingSerializerContext.java | 24 -
.../org/apache/juneau/urlencoding/package.html | 2 +-
.../org/apache/juneau/xml/XmlDocSerializer.java | 7 +-
.../java/org/apache/juneau/xml/XmlParser.java | 548 ++++++-
.../org/apache/juneau/xml/XmlParserContext.java | 75 -
.../org/apache/juneau/xml/XmlParserSession.java | 12 -
.../org/apache/juneau/xml/XmlSerializer.java | 646 +++++++-
.../apache/juneau/xml/XmlSerializerContext.java | 58 -
.../java/org/apache/juneau/xml/XmlUtils.java | 1 +
.../java/org/apache/juneau/xml/package.html | 56 +-
juneau-core/src/main/javadoc/overview.html | 63 +-
.../examples/rest/AddressBookResourceTest.java | 3 +-
.../SampleRemoteableServicesResourceTest.java | 3 +-
.../apache/juneau/examples/rest/TestUtils.java | 15 +-
.../juneau/microservice/Microservice.java | 2 +
.../juneau/microservice/RestMicroservice.java | 4 +
.../resources/DirectoryResource.java | 10 +-
.../apache/juneau/rest/client/RestClient.java | 10 +-
.../org/apache/juneau/rest/ResponseHandler.java | 4 +-
.../org/apache/juneau/rest/RestRequest.java | 16 +-
.../org/apache/juneau/rest/RestServlet.java | 1 +
.../apache/juneau/rest/RestServletContext.java | 47 -
.../rest/remoteable/RemoteableServlet.java | 1 +
175 files changed, 13630 insertions(+), 2691 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfCommonContext.java
----------------------------------------------------------------------
diff --git a/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfCommonContext.java b/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfCommonContext.java
index 548dce5..eb61785 100644
--- a/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfCommonContext.java
+++ b/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfCommonContext.java
@@ -20,197 +20,6 @@ import org.apache.juneau.xml.annotation.*;
/**
* Configurable properties common to both the {@link RdfSerializer} and {@link RdfParser} classes.
- *
- * <h6 class='topic' id='ConfigProperties'>Configurable properties common to the RDF serializers and parsers</h6>
- * <table class='styled' style='border-collapse: collapse;'>
- * <tr><th>Setting name</th><th>Description</th><th>Data type</th><th>Default value</th></tr>
- * <tr>
- * <td>{@link #RDF_language}</td>
- * <td>RDF language.</td>
- * <td><code>String</code></td>
- * <td><js>"RDF/XML-ABBREV"</js></td>
- * </tr>
- * <tr>
- * <td>{@link #RDF_juneauNs}</td>
- * <td>XML namespace for Juneau properties.</td>
- * <td>{@link Namespace}</td>
- * <td><code>{j:<js>'http://www.apache.org/juneau/'</js>}</code></td>
- * </tr>
- * <tr>
- * <td>{@link #RDF_juneauBpNs}</td>
- * <td>Default XML namespace for bean properties.</td>
- * <td>{@link Namespace}</td>
- * <td><code>{j:<js>'http://www.apache.org/juneaubp/'</js>}</code></td>
- * </tr>
- * <tr>
- * <td>{@link #RDF_useXmlNamespaces}</td>
- * <td>Reuse XML namespaces when RDF namespaces not specified.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>true</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #RDF_arp_iriRules}</td>
- * <td>RDF/XML property: <code>iri_rules</code>.</td>
- * <td><code>String</code></td>
- * <td><js>"lax"</js></td>
- * </tr>
- * <tr>
- * <td>{@link #RDF_arp_errorMode}</td>
- * <td>RDF/XML ARP property: <code>error-mode</code>.</td>
- * <td><code>String</code></td>
- * <td><js>"lax"</js></td>
- * </tr>
- * <tr>
- * <td>{@link #RDF_arp_embedding}</td>
- * <td>RDF/XML ARP property: <code>embedding</code>.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>false</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #RDF_arp_err_}</td>
- * <td>RDF/XML ARP property: <code>ERR_xxx</code>.</td>
- * <td><code>String</code></td>
- * <td></td>
- * </tr>
- * <tr>
- * <td>{@link #RDF_arp_warn_}</td>
- * <td>RDF/XML ARP property: <code>WARN_xxx</code>.</td>
- * <td><code>String</code></td>
- * <td></td>
- * </tr>
- * <tr>
- * <td>{@link #RDF_arp_ign_}</td>
- * <td>RDF/XML ARP property: <code>IGN_xxx</code>.</td>
- * <td><code>String</code></td>
- * <td></td>
- * </tr>
- * <tr>
- * <td>{@link #RDF_rdfxml_xmlBase}</td>
- * <td>RDF/XML property: <code>xmlbase</code>.</td>
- * <td><code>String</code></td>
- * <td><jk>null</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #RDF_rdfxml_longId}</td>
- * <td>RDF/XML property: <code>longId</code>.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>false</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #RDF_rdfxml_allowBadUris}</td>
- * <td>RDF/XML property: <code>allowBadURIs</code>.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>false</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #RDF_rdfxml_relativeUris}</td>
- * <td>RDF/XML property: <code>relativeURIs</code>.</td>
- * <td><code>String</code></td>
- * <td><js>"same-document, absolute, relative, parent"</js></td>
- * </tr>
- * <tr>
- * <td>{@link #RDF_rdfxml_showXmlDeclaration}</td>
- * <td>RDF/XML property: <code>showXmlDeclaration</code>.</td>
- * <td><code>String</code></td>
- * <td><js>"default"</js></td>
- * </tr>
- * <tr>
- * <td>{@link #RDF_rdfxml_showDoctypeDeclaration}</td>
- * <td>RDF/XML property: <code>showDoctypeDeclaration</code>.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>true</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #RDF_rdfxml_tab}</td>
- * <td>RDF/XML property: <code>tab</code>.</td>
- * <td><code>Integer</code></td>
- * <td><code>2</code></td>
- * </tr>
- * <tr>
- * <td>{@link #RDF_rdfxml_attributeQuoteChar}</td>
- * <td>RDF/XML property: <code>attributeQuoteChar</code>.</td>
- * <td><code>Character</code></td>
- * <td><js>'"'</js></td>
- * </tr>
- * <tr>
- * <td>{@link #RDF_rdfxml_blockRules}</td>
- * <td>RDF/XML property: <code>blockRules</code>.</td>
- * <td><code>String</code></td>
- * <td><js>""</js></td>
- * </tr>
- * <tr>
- * <td>{@link #RDF_n3_minGap}</td>
- * <td>N3/Turtle property: <code>minGap</code>.</td>
- * <td><code>Integer</code></td>
- * <td><code>1</code></td>
- * </tr>
- * <tr>
- * <td>{@link #RDF_n3_objectLists}</td>
- * <td>N3/Turtle property: <code>objectLists</code>.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>true</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #RDF_n3_subjectColumn}</td>
- * <td>N3/Turtle property: <code>subjectColumn</code>.</td>
- * <td><code>Integer</code></td>
- * <td>indent column</td>
- * </tr>
- * <tr>
- * <td>{@link #RDF_n3_propertyColumn}</td>
- * <td>N3/Turtle property: <code>propertyColumn</code>.</td>
- * <td><code>Integer</code></td>
- * <td><code>8</code></td>
- * </tr>
- * <tr>
- * <td>{@link #RDF_n3_indentProperty}</td>
- * <td>N3/Turtle property: <code>indentProperty</code>.</td>
- * <td><code>Integer</code></td>
- * <td><code>6</code></td>
- * </tr>
- * <tr>
- * <td>{@link #RDF_n3_widePropertyLen}</td>
- * <td>N3/Turtle property: <code>widePropertyLen</code>.</td>
- * <td><code>Integer</code></td>
- * <td><code>20</code></td>
- * </tr>
- * <tr>
- * <td>{@link #RDF_n3_abbrevBaseUri}</td>
- * <td>N3/Turtle property: <code>abbrevBaseURI</code>.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>true</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #RDF_n3_usePropertySymbols}</td>
- * <td>N3/Turtle property: <code>usePropertySymbols</code>.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>true</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #RDF_n3_useTripleQuotedStrings}</td>
- * <td>N3/Turtle property: <code>useTripleQuotedStrings</code>.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>true</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #RDF_n3_useDoubles}</td>
- * <td>N3/Turtle property: <code>useDoubles</code>.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>true</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #RDF_collectionFormat}</td>
- * <td>RDF format for representing collections and arrays.</td>
- * <td><code>String</code></td>
- * <td><js>"DEFAULT"</js></td>
- * </tr>
- * <tr>
- * <td>{@link #RDF_looseCollections}</td>
- * <td>Collections should be serialized and parsed as loose collections.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>false</jk></td>
- * </tr>
- * </table>
*/
@SuppressWarnings("serial")
public interface RdfCommonContext {
@@ -730,8 +539,8 @@ public interface RdfCommonContext {
*
* <h5 class='section'>Example:</h5>
* <p class='bcode'>
- * WriterSerializer s = <jk>new</jk> RdfSerializer.XmlAbbrev().setProperty(<jsf>RDF_looseCollection</jsf>, <jk>true</jk>);
- * ReaderParser p = <jk>new</jk> RdfParser.Xml().setProperty(<jsf>RDF_looseCollection</jsf>, <jk>true</jk>);
+ * WriterSerializer s = <jk>new</jk> RdfSerializer.XmlAbbrev().setLooseCollections(<jk>true</jk>);
+ * ReaderParser p = <jk>new</jk> RdfParser.Xml().setLooseCollections(<jk>true</jk>);
*
* List<MyBean> l = createListOfMyBeans();
*
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfParser.java
----------------------------------------------------------------------
diff --git a/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfParser.java b/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfParser.java
index 9ac292f..468afc0 100644
--- a/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfParser.java
+++ b/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfParser.java
@@ -15,14 +15,18 @@ package org.apache.juneau.jena;
import static org.apache.juneau.internal.StringUtils.*;
import static org.apache.juneau.jena.Constants.*;
import static org.apache.juneau.jena.RdfCommonContext.*;
+import static org.apache.juneau.jena.RdfParserContext.*;
import java.lang.reflect.*;
import java.util.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.jena.annotation.*;
import org.apache.juneau.parser.*;
import org.apache.juneau.transform.*;
+import org.apache.juneau.xml.*;
+import org.apache.juneau.xml.annotation.*;
import com.hp.hpl.jena.rdf.model.*;
import com.hp.hpl.jena.util.iterator.*;
@@ -70,7 +74,7 @@ public class RdfParser extends ReaderParser {
public static class Xml extends RdfParser {
/** Constructor */
public Xml() {
- setProperty(RDF_language, LANG_RDF_XML);
+ setLanguage(LANG_RDF_XML);
}
}
@@ -79,7 +83,7 @@ public class RdfParser extends ReaderParser {
public static class NTriple extends RdfParser {
/** Constructor */
public NTriple() {
- setProperty(RDF_language, LANG_NTRIPLE);
+ setLanguage(LANG_NTRIPLE);
}
}
@@ -88,7 +92,7 @@ public class RdfParser extends ReaderParser {
public static class Turtle extends RdfParser {
/** Constructor */
public Turtle() {
- setProperty(RDF_language, LANG_TURTLE);
+ setLanguage(LANG_TURTLE);
}
}
@@ -97,7 +101,7 @@ public class RdfParser extends ReaderParser {
public static class N3 extends RdfParser {
/** Constructor */
public N3() {
- setProperty(RDF_language, LANG_N3);
+ setLanguage(LANG_N3);
}
}
@@ -420,58 +424,649 @@ public class RdfParser extends ReaderParser {
return l;
}
+
//--------------------------------------------------------------------------------
- // Overridden methods
+ // Entry point methods
//--------------------------------------------------------------------------------
@Override /* Parser */
public RdfParserSession createSession(Object input, ObjectMap op, Method javaMethod, Object outer, Locale locale, TimeZone timeZone, MediaType mediaType) {
return new RdfParserSession(getContext(RdfParserContext.class), op, input, javaMethod, outer, locale, timeZone, mediaType);
}
+
+
+ //--------------------------------------------------------------------------------
+ // Properties
+ //--------------------------------------------------------------------------------
+
+ /**
+ * <b>Configuration property:</b> Trim whitespace from text elements.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"RdfParser.trimWhitespace"</js>
+ * <li><b>Data type:</b> <code>Boolean</code>
+ * <li><b>Default:</b> <jk>false</jk>
+ * <li><b>Session-overridable:</b> <jk>true</jk>
+ * </ul>
+ * <p>
+ * If <jk>true</jk>, whitespace in text elements will be automatically trimmed.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>RDF_trimWhitespace</jsf>, value)</code>.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see RdfParserContext#RDF_trimWhitespace
+ */
+ public RdfParser setTrimWhitespace(boolean value) throws LockedException {
+ return setProperty(RDF_trimWhitespace, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> RDF language.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"Rdf.language"</js>
+ * <li><b>Data type:</b> <code>String</code>
+ * <li><b>Default:</b> <js>"RDF/XML-ABBREV"</js>
+ * </ul>
+ * <p>
+ * Can be any of the following:
+ * <ul class='spaced-list'>
+ * <li><js>"RDF/XML"</js>
+ * <li><js>"RDF/XML-ABBREV"</js>
+ * <li><js>"N-TRIPLE"</js>
+ * <li><js>"N3"</js> - General name for the N3 writer.
+ * Will make a decision on exactly which writer to use (pretty writer, plain writer or simple writer) when created.
+ * Default is the pretty writer but can be overridden with system property <code>com.hp.hpl.jena.n3.N3JenaWriter.writer</code>.
+ * <li><js>"N3-PP"</js> - Name of the N3 pretty writer.
+ * The pretty writer uses a frame-like layout, with prefixing, clustering like properties and embedding one-referenced bNodes.
+ * <li><js>"N3-PLAIN"</js> - Name of the N3 plain writer.
+ * The plain writer writes records by subject.
+ * <li><js>"N3-TRIPLES"</js> - Name of the N3 triples writer.
+ * This writer writes one line per statement, like N-Triples, but does N3-style prefixing.
+ * <li><js>"TURTLE"</js> - Turtle writer.
+ * http://www.dajobe.org/2004/01/turtle/
+ * </ul>
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>RDF_language</jsf>, value)</code>.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see RdfParserContext#RDF_language
+ */
+ public RdfParser setLanguage(String value) throws LockedException {
+ return setProperty(RDF_language, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> XML namespace for Juneau properties.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"Rdf.juneauNs"</js>
+ * <li><b>Data type:</b> {@link Namespace}
+ * <li><b>Default:</b> <code>{j:<js>'http://www.apache.org/juneau/'</js>}</code>
+ * </ul>
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>RDF_juneauNs</jsf>, value)</code>.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see RdfParserContext#RDF_juneauNs
+ */
+ public RdfParser setJuneauNs(Namespace value) throws LockedException {
+ return setProperty(RDF_juneauNs, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> Default XML namespace for bean properties.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"Rdf.juneauBpNs"</js>
+ * <li><b>Data type:</b> {@link Namespace}
+ * <li><b>Default:</b> <code>{j:<js>'http://www.apache.org/juneaubp/'</js>}</code>
+ * </ul>
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>RDF_juneauBpNs</jsf>, value)</code>.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see RdfParserContext#RDF_juneauBpNs
+ */
+ public RdfParser setJuneauBpNs(Namespace value) throws LockedException {
+ return setProperty(RDF_juneauBpNs, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> Reuse XML namespaces when RDF namespaces not specified.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"Rdf.useXmlNamespaces"</js>
+ * <li><b>Data type:</b> <code>Boolean</code>
+ * <li><b>Default:</b> <jk>true</jk>
+ * </ul>
+ * <p>
+ * When specified, namespaces defined using {@link XmlNs} and {@link Xml} will be inherited by the RDF serializers.
+ * Otherwise, namespaces will be defined using {@link RdfNs} and {@link Rdf}.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>RDF_useXmlNamespaces</jsf>, value)</code>.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see RdfParserContext#RDF_useXmlNamespaces
+ */
+ public RdfParser setUseXmlNamespaces(boolean value) throws LockedException {
+ return setProperty(RDF_useXmlNamespaces, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> RDF format for representing collections and arrays.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"Rdf.collectionFormat"</js>
+ * <li><b>Data type:</b> <code>RdfCollectionFormat</code>
+ * <li><b>Default:</b> <js>"DEFAULT"</js>
+ * </ul>
+ * <p>
+ * Possible values:
+ * <ul class='spaced-list'>
+ * <li><js>"DEFAULT"</js> - Default format. The default is an RDF Sequence container.
+ * <li><js>"SEQ"</js> - RDF Sequence container.
+ * <li><js>"BAG"</js> - RDF Bag container.
+ * <li><js>"LIST"</js> - RDF List container.
+ * <li><js>"MULTI_VALUED"</js> - Multi-valued properties.
+ * </ul>
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>If you use <js>"BAG"</js> or <js>"MULTI_VALUED"</js>, the order of the elements in the collection will get lost.
+ * </ul>
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>RDF_collectionFormat</jsf>, value)</code>.
+ * <li>This introduces a slight performance penalty.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see RdfCommonContext#RDF_collectionFormat
+ */
+ public RdfParser setCollectionFormat(RdfCollectionFormat value) throws LockedException {
+ return setProperty(RDF_collectionFormat, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> Collections should be serialized and parsed as loose collections.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"Rdf.looseCollections"</js>
+ * <li><b>Data type:</b> <code>Boolean</code>
+ * <li><b>Default:</b> <jk>false</jk>
+ * </ul>
+ * <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).
+ * <p>
+ * Note that this setting is specialized for RDF syntax, and is incompatible with the concept of
+ * losslessly representing POJO models, since the tree structure of these POJO models are lost
+ * when serialized as loose collections.
+ * <p>
+ * This setting is typically only useful if the beans being parsed into do not have a bean property
+ * annotated with {@link Rdf#beanUri @Rdf(beanUri=true)}.
+ *
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode'>
+ * WriterSerializer s = <jk>new</jk> RdfSerializer.XmlAbbrev().setLooseCollections(<jk>true</jk>);
+ * ReaderParser p = <jk>new</jk> RdfParser.Xml().setLooseCollections(<jk>true</jk>);
+ *
+ * List<MyBean> l = createListOfMyBeans();
+ *
+ * <jc>// Serialize to RDF/XML as loose resources</jc>
+ * String rdfXml = s.serialize(l);
+ *
+ * <jc>// Parse back into a Java collection</jc>
+ * l = p.parse(rdfXml, LinkedList.<jk>class</jk>, MyBean.<jk>class</jk>);
+ *
+ * MyBean[] b = createArrayOfMyBeans();
+ *
+ * <jc>// Serialize to RDF/XML as loose resources</jc>
+ * String rdfXml = s.serialize(b);
+ *
+ * <jc>// Parse back into a bean array</jc>
+ * b = p.parse(rdfXml, MyBean[].<jk>class</jk>);
+ * </p>
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>RDF_looseCollections</jsf>, value)</code>.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see RdfCommonContext#RDF_looseCollections
+ */
+ public RdfParser setLooseCollections(boolean value) throws LockedException {
+ return setProperty(RDF_looseCollections, value);
+ }
+
+ @Override /* Parser */
+ public RdfParser setTrimStrings(boolean value) throws LockedException {
+ super.setTrimStrings(value);
+ return this;
+ }
+
+ @Override /* Parser */
+ public RdfParser setStrict(boolean value) throws LockedException {
+ super.setStrict(value);
+ return this;
+ }
+
+ @Override /* Parser */
+ public RdfParser setInputStreamCharset(String value) throws LockedException {
+ super.setInputStreamCharset(value);
+ return this;
+ }
+
+ @Override /* Parser */
+ public RdfParser setFileCharset(String value) throws LockedException {
+ super.setFileCharset(value);
+ return this;
+ }
@Override /* CoreApi */
- public RdfParser setProperty(String property, Object value) throws LockedException {
- super.setProperty(property, value);
+ public RdfParser setBeansRequireDefaultConstructor(boolean value) throws LockedException {
+ super.setBeansRequireDefaultConstructor(value);
return this;
}
@Override /* CoreApi */
- public RdfParser setProperties(ObjectMap properties) throws LockedException {
- super.setProperties(properties);
+ public RdfParser setBeansRequireSerializable(boolean value) throws LockedException {
+ super.setBeansRequireSerializable(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfParser setBeansRequireSettersForGetters(boolean value) throws LockedException {
+ super.setBeansRequireSettersForGetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfParser setBeansRequireSomeProperties(boolean value) throws LockedException {
+ super.setBeansRequireSomeProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfParser setBeanMapPutReturnsOldValue(boolean value) throws LockedException {
+ super.setBeanMapPutReturnsOldValue(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfParser setBeanConstructorVisibility(Visibility value) throws LockedException {
+ super.setBeanConstructorVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfParser setBeanClassVisibility(Visibility value) throws LockedException {
+ super.setBeanClassVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfParser setBeanFieldVisibility(Visibility value) throws LockedException {
+ super.setBeanFieldVisibility(value);
return this;
}
@Override /* CoreApi */
- public RdfParser addNotBeanClasses(Class<?>...classes) throws LockedException {
- super.addNotBeanClasses(classes);
+ public RdfParser setMethodVisibility(Visibility value) throws LockedException {
+ super.setMethodVisibility(value);
return this;
}
@Override /* CoreApi */
- public RdfParser addBeanFilters(Class<?>...classes) throws LockedException {
- super.addBeanFilters(classes);
+ public RdfParser setUseJavaBeanIntrospector(boolean value) throws LockedException {
+ super.setUseJavaBeanIntrospector(value);
return this;
}
@Override /* CoreApi */
- public RdfParser addPojoSwaps(Class<?>...classes) throws LockedException {
- super.addPojoSwaps(classes);
+ public RdfParser setUseInterfaceProxies(boolean value) throws LockedException {
+ super.setUseInterfaceProxies(value);
return this;
}
@Override /* CoreApi */
- public RdfParser addToDictionary(Class<?>...classes) throws LockedException {
- super.addToDictionary(classes);
+ public RdfParser setIgnoreUnknownBeanProperties(boolean value) throws LockedException {
+ super.setIgnoreUnknownBeanProperties(value);
return this;
}
@Override /* CoreApi */
- public <T> RdfParser addImplClass(Class<T> interfaceClass, Class<? extends T> implClass) throws LockedException {
+ public RdfParser setIgnoreUnknownNullBeanProperties(boolean value) throws LockedException {
+ super.setIgnoreUnknownNullBeanProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfParser setIgnorePropertiesWithoutSetters(boolean value) throws LockedException {
+ super.setIgnorePropertiesWithoutSetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfParser setIgnoreInvocationExceptionsOnGetters(boolean value) throws LockedException {
+ super.setIgnoreInvocationExceptionsOnGetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfParser setIgnoreInvocationExceptionsOnSetters(boolean value) throws LockedException {
+ super.setIgnoreInvocationExceptionsOnSetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfParser setSortProperties(boolean value) throws LockedException {
+ super.setSortProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfParser setNotBeanPackages(String...values) throws LockedException {
+ super.setNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfParser setNotBeanPackages(Collection<String> values) throws LockedException {
+ super.setNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfParser addNotBeanPackages(String...values) throws LockedException {
+ super.addNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfParser addNotBeanPackages(Collection<String> values) throws LockedException {
+ super.addNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfParser removeNotBeanPackages(String...values) throws LockedException {
+ super.removeNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfParser removeNotBeanPackages(Collection<String> values) throws LockedException {
+ super.removeNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfParser setNotBeanClasses(Class<?>...values) throws LockedException {
+ super.setNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfParser setNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ super.setNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfParser addNotBeanClasses(Class<?>...values) throws LockedException {
+ super.addNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfParser addNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ super.addNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfParser removeNotBeanClasses(Class<?>...values) throws LockedException {
+ super.removeNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfParser removeNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ super.removeNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfParser setBeanFilters(Class<?>...values) throws LockedException {
+ super.setBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfParser setBeanFilters(Collection<Class<?>> values) throws LockedException {
+ super.setBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfParser addBeanFilters(Class<?>...values) throws LockedException {
+ super.addBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfParser addBeanFilters(Collection<Class<?>> values) throws LockedException {
+ super.addBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfParser removeBeanFilters(Class<?>...values) throws LockedException {
+ super.removeBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfParser removeBeanFilters(Collection<Class<?>> values) throws LockedException {
+ super.removeBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfParser setPojoSwaps(Class<?>...values) throws LockedException {
+ super.setPojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfParser setPojoSwaps(Collection<Class<?>> values) throws LockedException {
+ super.setPojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfParser addPojoSwaps(Class<?>...values) throws LockedException {
+ super.addPojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfParser addPojoSwaps(Collection<Class<?>> values) throws LockedException {
+ super.addPojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfParser removePojoSwaps(Class<?>...values) throws LockedException {
+ super.removePojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfParser removePojoSwaps(Collection<Class<?>> values) throws LockedException {
+ super.removePojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfParser setImplClasses(Map<Class<?>,Class<?>> values) throws LockedException {
+ super.setImplClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public <T> CoreApi addImplClass(Class<T> interfaceClass, Class<? extends T> implClass) throws LockedException {
super.addImplClass(interfaceClass, implClass);
return this;
}
@Override /* CoreApi */
+ public RdfParser setBeanDictionary(Class<?>...values) throws LockedException {
+ super.setBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfParser setBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ super.setBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfParser addToBeanDictionary(Class<?>...values) throws LockedException {
+ super.addToBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfParser addToBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ super.addToBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfParser removeFromBeanDictionary(Class<?>...values) throws LockedException {
+ super.removeFromBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfParser removeFromBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ super.removeFromBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfParser setBeanTypePropertyName(String value) throws LockedException {
+ super.setBeanTypePropertyName(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfParser setDefaultParser(Class<?> value) throws LockedException {
+ super.setDefaultParser(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfParser setLocale(Locale value) throws LockedException {
+ super.setLocale(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfParser setTimeZone(TimeZone value) throws LockedException {
+ super.setTimeZone(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfParser setMediaType(MediaType value) throws LockedException {
+ super.setMediaType(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfParser setDebug(boolean value) throws LockedException {
+ super.setDebug(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfParser setProperty(String name, Object value) throws LockedException {
+ super.setProperty(name, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfParser setProperties(ObjectMap properties) throws LockedException {
+ super.setProperties(properties);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfParser addToProperty(String name, Object value) throws LockedException {
+ super.addToProperty(name, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfParser putToProperty(String name, Object key, Object value) throws LockedException {
+ super.putToProperty(name, key, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfParser putToProperty(String name, Object value) throws LockedException {
+ super.putToProperty(name, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfParser removeFromProperty(String name, Object value) throws LockedException {
+ super.removeFromProperty(name, value);
+ return this;
+ }
+
+
+ //--------------------------------------------------------------------------------
+ // Overridden methods
+ //--------------------------------------------------------------------------------
+
+ @Override /* CoreApi */
public RdfParser setClassLoader(ClassLoader classLoader) throws LockedException {
super.setClassLoader(classLoader);
return this;
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfParserContext.java
----------------------------------------------------------------------
diff --git a/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfParserContext.java b/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfParserContext.java
index 224dc13..0161f11 100644
--- a/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfParserContext.java
+++ b/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfParserContext.java
@@ -24,31 +24,8 @@ import org.apache.juneau.xml.*;
* Context properties are set by calling {@link ContextFactory#setProperty(String, Object)} on the context factory
* returned {@link CoreApi#getContextFactory()}.
* <p>
- * The following convenience methods are also provided for setting context properties:
- * <ul>
- * <li>{@link RdfParser#setProperty(String,Object)}
- * <li>{@link RdfParser#setProperties(ObjectMap)}
- * <li>{@link RdfParser#addNotBeanClasses(Class[])}
- * <li>{@link RdfParser#addBeanFilters(Class[])}
- * <li>{@link RdfParser#addPojoSwaps(Class[])}
- * <li>{@link RdfParser#addToDictionary(Class[])}
- * <li>{@link RdfParser#addImplClass(Class,Class)}
- * </ul>
- * <p>
* See {@link ContextFactory} for more information about context properties.
*
- * <h6 class='topic' id='ConfigProperties'>Configurable properties on the RDF parsers</h6>
- * <table class='styled' style='border-collapse: collapse;'>
- * <tr><th>Setting name</th><th>Description</th><th>Data type</th><th>Default value</th><th>Session overridable</th></tr>
- * <tr>
- * <td>{@link #RDF_trimWhitespace}</td>
- * <td>Trim whitespace from text elements.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>false</jk></td>
- * <td><jk>true</jk></td>
- * </tr>
- * </table>
- *
* <h6 class='topic' id='ConfigProperties'>Configurable properties inherited by the RDF parsers</h6>
* <ul class='javahierarchy'>
* <li class='c'><a class="doclink" href="../BeanContext.html#ConfigProperties">BeanContext</a> - Properties associated with handling beans on serializers and parsers.
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfSerializer.java
----------------------------------------------------------------------
diff --git a/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfSerializer.java b/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfSerializer.java
index f296666..9bb6d94 100644
--- a/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfSerializer.java
+++ b/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfSerializer.java
@@ -14,6 +14,7 @@ package org.apache.juneau.jena;
import static org.apache.juneau.jena.Constants.*;
import static org.apache.juneau.jena.RdfCommonContext.*;
+import static org.apache.juneau.jena.RdfSerializerContext.*;
import java.lang.reflect.*;
import java.util.*;
@@ -21,9 +22,11 @@ import java.util.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
import org.apache.juneau.internal.*;
+import org.apache.juneau.jena.annotation.*;
import org.apache.juneau.serializer.*;
import org.apache.juneau.transform.*;
import org.apache.juneau.xml.*;
+import org.apache.juneau.xml.annotation.*;
import com.hp.hpl.jena.rdf.model.*;
@@ -75,7 +78,7 @@ public class RdfSerializer extends WriterSerializer {
public static class Xml extends RdfSerializer {
/** Constructor */
public Xml() {
- setProperty(RDF_language, LANG_RDF_XML);
+ setLanguage(LANG_RDF_XML);
}
}
@@ -84,7 +87,7 @@ public class RdfSerializer extends WriterSerializer {
public static class XmlAbbrev extends RdfSerializer {
/** Constructor */
public XmlAbbrev() {
- setProperty(RDF_language, LANG_RDF_XML_ABBREV);
+ setLanguage(LANG_RDF_XML_ABBREV);
}
}
@@ -93,7 +96,7 @@ public class RdfSerializer extends WriterSerializer {
public static class NTriple extends RdfSerializer {
/** Constructor */
public NTriple() {
- setProperty(RDF_language, LANG_NTRIPLE);
+ setLanguage(LANG_NTRIPLE);
}
}
@@ -102,7 +105,7 @@ public class RdfSerializer extends WriterSerializer {
public static class Turtle extends RdfSerializer {
/** Constructor */
public Turtle() {
- setProperty(RDF_language, LANG_TURTLE);
+ setLanguage(LANG_TURTLE);
}
}
@@ -111,7 +114,7 @@ public class RdfSerializer extends WriterSerializer {
public static class N3 extends RdfSerializer {
/** Constructor */
public N3() {
- setProperty(RDF_language, LANG_N3);
+ setLanguage(LANG_N3);
}
}
@@ -387,8 +390,9 @@ public class RdfSerializer extends WriterSerializer {
}
+
//--------------------------------------------------------------------------------
- // Overridden methods
+ // Entry point methods
//--------------------------------------------------------------------------------
@Override /* Serializer */
@@ -396,49 +400,799 @@ public class RdfSerializer extends WriterSerializer {
return new RdfSerializerSession(getContext(RdfSerializerContext.class), op, output, javaMethod, locale, timeZone, mediaType);
}
+
+ //--------------------------------------------------------------------------------
+ // Properties
+ //--------------------------------------------------------------------------------
+
+ /**
+ * <b>Configuration property:</b> RDF language.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"Rdf.language"</js>
+ * <li><b>Data type:</b> <code>String</code>
+ * <li><b>Default:</b> <js>"RDF/XML-ABBREV"</js>
+ * </ul>
+ * <p>
+ * Can be any of the following:
+ * <ul class='spaced-list'>
+ * <li><js>"RDF/XML"</js>
+ * <li><js>"RDF/XML-ABBREV"</js>
+ * <li><js>"N-TRIPLE"</js>
+ * <li><js>"N3"</js> - General name for the N3 writer.
+ * Will make a decision on exactly which writer to use (pretty writer, plain writer or simple writer) when created.
+ * Default is the pretty writer but can be overridden with system property <code>com.hp.hpl.jena.n3.N3JenaWriter.writer</code>.
+ * <li><js>"N3-PP"</js> - Name of the N3 pretty writer.
+ * The pretty writer uses a frame-like layout, with prefixing, clustering like properties and embedding one-referenced bNodes.
+ * <li><js>"N3-PLAIN"</js> - Name of the N3 plain writer.
+ * The plain writer writes records by subject.
+ * <li><js>"N3-TRIPLES"</js> - Name of the N3 triples writer.
+ * This writer writes one line per statement, like N-Triples, but does N3-style prefixing.
+ * <li><js>"TURTLE"</js> - Turtle writer.
+ * http://www.dajobe.org/2004/01/turtle/
+ * </ul>
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>RDF_language</jsf>, value)</code>.
+ * <li>This introduces a slight performance penalty.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see RdfCommonContext#RDF_language
+ */
+ public RdfSerializer setLanguage(String value) throws LockedException {
+ return setProperty(RDF_language, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> XML namespace for Juneau properties.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"Rdf.juneauNs"</js>
+ * <li><b>Data type:</b> {@link Namespace}
+ * <li><b>Default:</b> <code>{j:<js>'http://www.apache.org/juneau/'</js>}</code>
+ * </ul>
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>RDF_juneauNs</jsf>, value)</code>.
+ * <li>This introduces a slight performance penalty.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see RdfSerializerContext#RDF_juneauNs
+ */
+ public RdfSerializer setJuneauNs(Namespace value) throws LockedException {
+ return setProperty(RDF_juneauNs, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> Default XML namespace for bean properties.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"Rdf.juneauBpNs"</js>
+ * <li><b>Data type:</b> {@link Namespace}
+ * <li><b>Default:</b> <code>{j:<js>'http://www.apache.org/juneaubp/'</js>}</code>
+ * </ul>
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>RDF_juneauBpNs</jsf>, value)</code>.
+ * <li>This introduces a slight performance penalty.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see RdfSerializerContext#RDF_juneauBpNs
+ */
+ public RdfSerializer setJuneauBpNs(Namespace value) throws LockedException {
+ return setProperty(RDF_juneauBpNs, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> Reuse XML namespaces when RDF namespaces not specified.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"Rdf.useXmlNamespaces"</js>
+ * <li><b>Data type:</b> <code>Boolean</code>
+ * <li><b>Default:</b> <jk>true</jk>
+ * </ul>
+ * <p>
+ * When specified, namespaces defined using {@link XmlNs} and {@link Xml} will be inherited by the RDF serializers.
+ * Otherwise, namespaces will be defined using {@link RdfNs} and {@link Rdf}.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>RDF_useXmlNamespaces</jsf>, value)</code>.
+ * <li>This introduces a slight performance penalty.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see SerializerContext#SERIALIZER_sortMaps
+ */
+ public RdfSerializer setUseXmlNamespaces(boolean value) throws LockedException {
+ return setProperty(RDF_useXmlNamespaces, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> Add XSI data types to non-<code>String</code> literals.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"RdfSerializer.addLiteralTypes"</js>
+ * <li><b>Data type:</b> <code>Boolean</code>
+ * <li><b>Default:</b> <jk>false</jk>
+ * <li><b>Session-overridable:</b> <jk>true</jk>
+ * </ul>
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>RDF_addLiteralTypes</jsf>, value)</code>.
+ * <li>This introduces a slight performance penalty.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see RdfSerializerContext#RDF_addLiteralTypes
+ */
+ public RdfSerializer setAddLiteralTypes(boolean value) throws LockedException {
+ return setProperty(RDF_addLiteralTypes, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> Add RDF root identifier property to root node.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"RdfSerializer.addRootProperty"</js>
+ * <li><b>Data type:</b> <code>Boolean</code>
+ * <li><b>Default:</b> <jk>false</jk>
+ * <li><b>Session-overridable:</b> <jk>true</jk>
+ * </ul>
+ * <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.
+ * This helps locate the root node during parsing.
+ * <p>
+ * If disabled, the parser has to search through the model to find any resources without
+ * incoming predicates to identify root notes, which can introduce a considerable performance
+ * degradation.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>RDF_addRootProperty</jsf>, value)</code>.
+ * <li>This introduces a slight performance penalty.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see RdfSerializerContext#RDF_addRootProperty
+ */
+ public RdfSerializer setAddRootProperty(boolean value) throws LockedException {
+ return setProperty(RDF_addRootProperty, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> Auto-detect namespace usage.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"RdfSerializer.autoDetectNamespaces"</js>
+ * <li><b>Data type:</b> <code>Boolean</code>
+ * <li><b>Default:</b> <jk>true</jk>
+ * <li><b>Session-overridable:</b> <jk>true</jk>
+ * </ul>
+ * <p>
+ * Detect namespace usage before serialization.
+ * <p>
+ * If enabled, then the data structure will first be crawled looking for
+ * namespaces that will be encountered before the root element is
+ * serialized.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>RDF_autoDetectNamespaces</jsf>, value)</code>.
+ * <li>This introduces a slight performance penalty.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see RdfSerializerContext#RDF_autoDetectNamespaces
+ */
+ public RdfSerializer setAutoDetectNamespaces(boolean value) throws LockedException {
+ return setProperty(RDF_autoDetectNamespaces, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> Default namespaces.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"RdfSerializer.namespaces.list"</js>
+ * <li><b>Data type:</b> <code>List<{@link Namespace}></code>
+ * <li><b>Default:</b> empty list
+ * <li><b>Session-overridable:</b> <jk>true</jk>
+ * </ul>
+ * <p>
+ * The default list of namespaces associated with this serializer.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>RDF_namespaces</jsf>, values)</code>.
+ * <li>This introduces a slight performance penalty.
+ * </ul>
+ *
+ * @param values The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see RdfSerializerContext#RDF_namespaces
+ */
+ public RdfSerializer setNamespaces(Namespace...values) throws LockedException {
+ return setProperty(RDF_namespaces, values);
+ }
+
+ /**
+ * <b>Configuration property:</b> RDF format for representing collections and arrays.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"Rdf.collectionFormat"</js>
+ * <li><b>Data type:</b> <code>RdfCollectionFormat</code>
+ * <li><b>Default:</b> <js>"DEFAULT"</js>
+ * </ul>
+ * <p>
+ * Possible values:
+ * <ul class='spaced-list'>
+ * <li><js>"DEFAULT"</js> - Default format. The default is an RDF Sequence container.
+ * <li><js>"SEQ"</js> - RDF Sequence container.
+ * <li><js>"BAG"</js> - RDF Bag container.
+ * <li><js>"LIST"</js> - RDF List container.
+ * <li><js>"MULTI_VALUED"</js> - Multi-valued properties.
+ * </ul>
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>If you use <js>"BAG"</js> or <js>"MULTI_VALUED"</js>, the order of the elements in the collection will get lost.
+ * </ul>
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>RDF_collectionFormat</jsf>, value)</code>.
+ * <li>This introduces a slight performance penalty.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see RdfCommonContext#RDF_collectionFormat
+ */
+ public RdfSerializer setCollectionFormat(RdfCollectionFormat value) throws LockedException {
+ return setProperty(RDF_collectionFormat, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> Collections should be serialized and parsed as loose collections.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"Rdf.looseCollections"</js>
+ * <li><b>Data type:</b> <code>Boolean</code>
+ * <li><b>Default:</b> <jk>false</jk>
+ * </ul>
+ * <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).
+ * <p>
+ * Note that this setting is specialized for RDF syntax, and is incompatible with the concept of
+ * losslessly representing POJO models, since the tree structure of these POJO models are lost
+ * when serialized as loose collections.
+ * <p>
+ * This setting is typically only useful if the beans being parsed into do not have a bean property
+ * annotated with {@link Rdf#beanUri @Rdf(beanUri=true)}.
+ *
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode'>
+ * WriterSerializer s = <jk>new</jk> RdfSerializer.XmlAbbrev().setLooseCollections(<jk>true</jk>);
+ * ReaderParser p = <jk>new</jk> RdfParser.Xml().setLooseCollections(<jk>true</jk>);
+ *
+ * List<MyBean> l = createListOfMyBeans();
+ *
+ * <jc>// Serialize to RDF/XML as loose resources</jc>
+ * String rdfXml = s.serialize(l);
+ *
+ * <jc>// Parse back into a Java collection</jc>
+ * l = p.parse(rdfXml, LinkedList.<jk>class</jk>, MyBean.<jk>class</jk>);
+ *
+ * MyBean[] b = createArrayOfMyBeans();
+ *
+ * <jc>// Serialize to RDF/XML as loose resources</jc>
+ * String rdfXml = s.serialize(b);
+ *
+ * <jc>// Parse back into a bean array</jc>
+ * b = p.parse(rdfXml, MyBean[].<jk>class</jk>);
+ * </p>
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>RDF_looseCollections</jsf>, value)</code>.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see RdfCommonContext#RDF_looseCollections
+ */
+ public RdfSerializer setLooseCollections(boolean value) throws LockedException {
+ return setProperty(RDF_looseCollections, value);
+ }
+
+ @Override /* Serializer */
+ public RdfSerializer setMaxDepth(int value) throws LockedException {
+ super.setMaxDepth(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public RdfSerializer setInitialDepth(int value) throws LockedException {
+ super.setInitialDepth(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public RdfSerializer setDetectRecursions(boolean value) throws LockedException {
+ super.setDetectRecursions(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public RdfSerializer setIgnoreRecursions(boolean value) throws LockedException {
+ super.setIgnoreRecursions(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public RdfSerializer setUseIndentation(boolean value) throws LockedException {
+ super.setUseIndentation(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public RdfSerializer setAddBeanTypeProperties(boolean value) throws LockedException {
+ super.setAddBeanTypeProperties(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public RdfSerializer setQuoteChar(char value) throws LockedException {
+ super.setQuoteChar(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public RdfSerializer setTrimNullProperties(boolean value) throws LockedException {
+ super.setTrimNullProperties(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public RdfSerializer setTrimEmptyCollections(boolean value) throws LockedException {
+ super.setTrimEmptyCollections(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public RdfSerializer setTrimEmptyMaps(boolean value) throws LockedException {
+ super.setTrimEmptyMaps(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public RdfSerializer setTrimStrings(boolean value) throws LockedException {
+ super.setTrimStrings(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public RdfSerializer setRelativeUriBase(String value) throws LockedException {
+ super.setRelativeUriBase(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public RdfSerializer setAbsolutePathUriBase(String value) throws LockedException {
+ super.setAbsolutePathUriBase(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public RdfSerializer setSortCollections(boolean value) throws LockedException {
+ super.setSortCollections(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public RdfSerializer setSortMaps(boolean value) throws LockedException {
+ super.setSortMaps(value);
+ return this;
+ }
+
@Override /* CoreApi */
- public RdfSerializer setProperty(String property, Object value) throws LockedException {
- super.setProperty(property, value);
+ public RdfSerializer setBeansRequireDefaultConstructor(boolean value) throws LockedException {
+ super.setBeansRequireDefaultConstructor(value);
return this;
}
@Override /* CoreApi */
- public RdfSerializer setProperties(ObjectMap properties) throws LockedException {
- super.setProperties(properties);
+ public RdfSerializer setBeansRequireSerializable(boolean value) throws LockedException {
+ super.setBeansRequireSerializable(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfSerializer setBeansRequireSettersForGetters(boolean value) throws LockedException {
+ super.setBeansRequireSettersForGetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfSerializer setBeansRequireSomeProperties(boolean value) throws LockedException {
+ super.setBeansRequireSomeProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfSerializer setBeanMapPutReturnsOldValue(boolean value) throws LockedException {
+ super.setBeanMapPutReturnsOldValue(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfSerializer setBeanConstructorVisibility(Visibility value) throws LockedException {
+ super.setBeanConstructorVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfSerializer setBeanClassVisibility(Visibility value) throws LockedException {
+ super.setBeanClassVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfSerializer setBeanFieldVisibility(Visibility value) throws LockedException {
+ super.setBeanFieldVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfSerializer setMethodVisibility(Visibility value) throws LockedException {
+ super.setMethodVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfSerializer setUseJavaBeanIntrospector(boolean value) throws LockedException {
+ super.setUseJavaBeanIntrospector(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfSerializer setUseInterfaceProxies(boolean value) throws LockedException {
+ super.setUseInterfaceProxies(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfSerializer setIgnoreUnknownBeanProperties(boolean value) throws LockedException {
+ super.setIgnoreUnknownBeanProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfSerializer setIgnoreUnknownNullBeanProperties(boolean value) throws LockedException {
+ super.setIgnoreUnknownNullBeanProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfSerializer setIgnorePropertiesWithoutSetters(boolean value) throws LockedException {
+ super.setIgnorePropertiesWithoutSetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfSerializer setIgnoreInvocationExceptionsOnGetters(boolean value) throws LockedException {
+ super.setIgnoreInvocationExceptionsOnGetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfSerializer setIgnoreInvocationExceptionsOnSetters(boolean value) throws LockedException {
+ super.setIgnoreInvocationExceptionsOnSetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfSerializer setSortProperties(boolean value) throws LockedException {
+ super.setSortProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfSerializer setNotBeanPackages(String...values) throws LockedException {
+ super.setNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfSerializer setNotBeanPackages(Collection<String> values) throws LockedException {
+ super.setNotBeanPackages(values);
return this;
}
@Override /* CoreApi */
- public RdfSerializer addNotBeanClasses(Class<?>...classes) throws LockedException {
- super.addNotBeanClasses(classes);
+ public RdfSerializer addNotBeanPackages(String...values) throws LockedException {
+ super.addNotBeanPackages(values);
return this;
}
@Override /* CoreApi */
- public RdfSerializer addBeanFilters(Class<?>...classes) throws LockedException {
- super.addBeanFilters(classes);
+ public RdfSerializer addNotBeanPackages(Collection<String> values) throws LockedException {
+ super.addNotBeanPackages(values);
return this;
}
@Override /* CoreApi */
- public RdfSerializer addPojoSwaps(Class<?>...classes) throws LockedException {
- super.addPojoSwaps(classes);
+ public RdfSerializer removeNotBeanPackages(String...values) throws LockedException {
+ super.removeNotBeanPackages(values);
return this;
}
@Override /* CoreApi */
- public RdfSerializer addToDictionary(Class<?>...classes) throws LockedException {
- super.addToDictionary(classes);
+ public RdfSerializer removeNotBeanPackages(Collection<String> values) throws LockedException {
+ super.removeNotBeanPackages(values);
return this;
}
@Override /* CoreApi */
- public <T> RdfSerializer addImplClass(Class<T> interfaceClass, Class<? extends T> implClass) throws LockedException {
+ public RdfSerializer setNotBeanClasses(Class<?>...values) throws LockedException {
+ super.setNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfSerializer setNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ super.setNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfSerializer addNotBeanClasses(Class<?>...values) throws LockedException {
+ super.addNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfSerializer addNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ super.addNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfSerializer removeNotBeanClasses(Class<?>...values) throws LockedException {
+ super.removeNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfSerializer removeNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ super.removeNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfSerializer setBeanFilters(Class<?>...values) throws LockedException {
+ super.setBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfSerializer setBeanFilters(Collection<Class<?>> values) throws LockedException {
+ super.setBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfSerializer addBeanFilters(Class<?>...values) throws LockedException {
+ super.addBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfSerializer addBeanFilters(Collection<Class<?>> values) throws LockedException {
+ super.addBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfSerializer removeBeanFilters(Class<?>...values) throws LockedException {
+ super.removeBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfSerializer removeBeanFilters(Collection<Class<?>> values) throws LockedException {
+ super.removeBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfSerializer setPojoSwaps(Class<?>...values) throws LockedException {
+ super.setPojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfSerializer setPojoSwaps(Collection<Class<?>> values) throws LockedException {
+ super.setPojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfSerializer addPojoSwaps(Class<?>...values) throws LockedException {
+ super.addPojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfSerializer addPojoSwaps(Collection<Class<?>> values) throws LockedException {
+ super.addPojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfSerializer removePojoSwaps(Class<?>...values) throws LockedException {
+ super.removePojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfSerializer removePojoSwaps(Collection<Class<?>> values) throws LockedException {
+ super.removePojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfSerializer setImplClasses(Map<Class<?>,Class<?>> values) throws LockedException {
+ super.setImplClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public <T> CoreApi addImplClass(Class<T> interfaceClass, Class<? extends T> implClass) throws LockedException {
super.addImplClass(interfaceClass, implClass);
return this;
}
@Override /* CoreApi */
+ public RdfSerializer setBeanDictionary(Class<?>...values) throws LockedException {
+ super.setBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfSerializer setBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ super.setBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfSerializer addToBeanDictionary(Class<?>...values) throws LockedException {
+ super.addToBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfSerializer addToBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ super.addToBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfSerializer removeFromBeanDictionary(Class<?>...values) throws LockedException {
+ super.removeFromBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfSerializer removeFromBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ super.removeFromBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfSerializer setBeanTypePropertyName(String value) throws LockedException {
+ super.setBeanTypePropertyName(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfSerializer setDefaultParser(Class<?> value) throws LockedException {
+ super.setDefaultParser(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfSerializer setLocale(Locale value) throws LockedException {
+ super.setLocale(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfSerializer setTimeZone(TimeZone value) throws LockedException {
+ super.setTimeZone(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfSerializer setMediaType(MediaType value) throws LockedException {
+ super.setMediaType(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfSerializer setDebug(boolean value) throws LockedException {
+ super.setDebug(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfSerializer setProperty(String name, Object value) throws LockedException {
+ super.setProperty(name, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfSerializer setProperties(ObjectMap properties) throws LockedException {
+ super.setProperties(properties);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfSerializer addToProperty(String name, Object value) throws LockedException {
+ super.addToProperty(name, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfSerializer putToProperty(String name, Object key, Object value) throws LockedException {
+ super.putToProperty(name, key, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfSerializer putToProperty(String name, Object value) throws LockedException {
+ super.putToProperty(name, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public RdfSerializer removeFromProperty(String name, Object value) throws LockedException {
+ super.removeFromProperty(name, value);
+ return this;
+ }
+
+
+ //--------------------------------------------------------------------------------
+ // Overridden methods
+ //--------------------------------------------------------------------------------
+
+ @Override /* CoreApi */
public RdfSerializer setClassLoader(ClassLoader classLoader) throws LockedException {
super.setClassLoader(classLoader);
return this;
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfSerializerContext.java
----------------------------------------------------------------------
diff --git a/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfSerializerContext.java b/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfSerializerContext.java
index 2e3e5f0..7dcd923 100644
--- a/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfSerializerContext.java
+++ b/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfSerializerContext.java
@@ -24,52 +24,8 @@ import org.apache.juneau.xml.*;
* Context properties are set by calling {@link ContextFactory#setProperty(String, Object)} on the context factory
* returned {@link CoreApi#getContextFactory()}.
* <p>
- * The following convenience methods are also provided for setting context properties:
- * <ul>
- * <li>{@link RdfSerializer#setProperty(String,Object)}
- * <li>{@link RdfSerializer#setProperties(ObjectMap)}
- * <li>{@link RdfSerializer#addNotBeanClasses(Class[])}
- * <li>{@link RdfSerializer#addBeanFilters(Class[])}
- * <li>{@link RdfSerializer#addPojoSwaps(Class[])}
- * <li>{@link RdfSerializer#addToDictionary(Class[])}
- * <li>{@link RdfSerializer#addImplClass(Class,Class)}
- * </ul>
- * <p>
* See {@link ContextFactory} for more information about context properties.
*
- * <h6 class='topic' id='ConfigProperties'>Configurable properties on the RDF serializers</h6>
- * <table class='styled' style='border-collapse: collapse;'>
- * <tr><th>Setting name</th><th>Description</th><th>Data type</th><th>Default value</th><th>Session overridable</th></tr>
- * <tr>
- * <td>{@link #RDF_addLiteralTypes}</td>
- * <td>Add XSI data types to non-<code>String</code> literals.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>false</jk></td>
- * <td><jk>true</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #RDF_addRootProperty}</td>
- * <td>Add RDF root identifier property to root node.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>false</jk></td>
- * <td><jk>true</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #RDF_autoDetectNamespaces}</td>
- * <td>Auto-detect namespace usage.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>true</jk></td>
- * <td><jk>true</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #RDF_namespaces}</td>
- * <td>Default namespaces.</td>
- * <td><code>List<{@link Namespace}></code></td>
- * <td>empty list</td>
- * <td><jk>true</jk></td>
- * </tr>
- * </table>
- *
* <h6 class='topic' id='ConfigProperties'>Configurable properties inherited by the RDF serializers</h6>
* <ul class='javahierarchy'>
* <li class='c'><a class="doclink" href="../BeanContext.html#ConfigProperties">BeanContext</a> - Properties associated with handling beans on serializers and parsers.
[12/14] incubator-juneau git commit: Add convenience property setters
to serializers and parsers.
Posted by ja...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core-test/src/test/java/org/apache/juneau/jena/RdfTest.java
----------------------------------------------------------------------
diff --git a/juneau-core-test/src/test/java/org/apache/juneau/jena/RdfTest.java b/juneau-core-test/src/test/java/org/apache/juneau/jena/RdfTest.java
index d84ca86..678520f 100755
--- a/juneau-core-test/src/test/java/org/apache/juneau/jena/RdfTest.java
+++ b/juneau-core-test/src/test/java/org/apache/juneau/jena/RdfTest.java
@@ -14,7 +14,6 @@ package org.apache.juneau.jena;
import static org.apache.juneau.TestUtils.*;
import static org.apache.juneau.jena.RdfCommonContext.*;
-import static org.apache.juneau.jena.RdfSerializerContext.*;
import java.net.URI;
import java.util.*;
@@ -35,8 +34,8 @@ public class RdfTest {
RdfSerializer s = new RdfSerializer.XmlAbbrev()
.setProperty(RDF_rdfxml_tab, 3)
- .setProperty(SERIALIZER_quoteChar, '\'')
- .setProperty(RDF_addRootProperty, true);
+ .setQuoteChar('\'')
+ .setAddRootProperty(true);
RdfParser p = RdfParser.DEFAULT_XML.clone();
//--------------------------------------------------------------------------------
@@ -69,7 +68,7 @@ public class RdfTest {
//--------------------------------------------------------------------------------
// Explicit sequence
//--------------------------------------------------------------------------------
- s.setProperty(RDF_collectionFormat, RdfCollectionFormat.SEQ);
+ s.setCollectionFormat(RdfCollectionFormat.SEQ);
expected =
"<rdf:RDF a='http://ns/' j='http://www.apache.org/juneau/' jp='http://www.apache.org/juneaubp/' rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'>"
+ "\n <rdf:Description about='http://test/a'>"
@@ -97,7 +96,7 @@ public class RdfTest {
//--------------------------------------------------------------------------------
// Bag
//--------------------------------------------------------------------------------
- s.setProperty(RDF_collectionFormat, RdfCollectionFormat.BAG);
+ s.setCollectionFormat(RdfCollectionFormat.BAG);
expected =
"<rdf:RDF a='http://ns/' j='http://www.apache.org/juneau/' jp='http://www.apache.org/juneaubp/' rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'>"
+ "\n <rdf:Description about='http://test/a'>"
@@ -125,7 +124,7 @@ public class RdfTest {
//--------------------------------------------------------------------------------
// List
//--------------------------------------------------------------------------------
- s.setProperty(RDF_collectionFormat, RdfCollectionFormat.LIST);
+ s.setCollectionFormat(RdfCollectionFormat.LIST);
expected =
"<rdf:RDF a='http://ns/' j='http://www.apache.org/juneau/' jp='http://www.apache.org/juneaubp/' rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'>"
+ "\n <rdf:Description about='http://test/a'>"
@@ -155,7 +154,7 @@ public class RdfTest {
//--------------------------------------------------------------------------------
// Multi-properties
//--------------------------------------------------------------------------------
- s.setProperty(RDF_collectionFormat, RdfCollectionFormat.MULTI_VALUED);
+ s.setCollectionFormat(RdfCollectionFormat.MULTI_VALUED);
expected =
"<rdf:RDF a='http://ns/' j='http://www.apache.org/juneau/' jp='http://www.apache.org/juneaubp/' rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'>"
+ "\n <rdf:Description about='http://test/a'>"
@@ -170,7 +169,7 @@ public class RdfTest {
assertXmlEquals(expected, rdfXml);
// Note - Must specify collection format on parser for it to be able to understand this layout.
- p.setProperty(RDF_collectionFormat, RdfCollectionFormat.MULTI_VALUED);
+ p.setCollectionFormat(RdfCollectionFormat.MULTI_VALUED);
a2 = p.parse(rdfXml, A.class);
assertEqualObjects(a, a2);
}
@@ -195,8 +194,8 @@ public class RdfTest {
String rdfXml, expected;
RdfSerializer s = new RdfSerializer.XmlAbbrev()
.setProperty(RDF_rdfxml_tab, 3)
- .setProperty(SERIALIZER_quoteChar, '\'')
- .setProperty(RDF_addRootProperty, true);
+ .setQuoteChar('\'')
+ .setAddRootProperty(true);
RdfParser p = RdfParser.DEFAULT_XML.clone();
//--------------------------------------------------------------------------------
@@ -272,7 +271,7 @@ public class RdfTest {
//--------------------------------------------------------------------------------
// Default is Bag - Should only affect DEFAULT properties.
//--------------------------------------------------------------------------------
- s.setProperty(RDF_collectionFormat, RdfCollectionFormat.BAG);
+ s.setCollectionFormat(RdfCollectionFormat.BAG);
expected =
"<rdf:RDF b='http://ns/' j='http://www.apache.org/juneau/' jp='http://www.apache.org/juneaubp/' rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'>"
+ "\n <rdf:Description about='http://test/b'>"
@@ -428,14 +427,14 @@ public class RdfTest {
String rdfXml, expected;
RdfSerializer s = new RdfSerializer.XmlAbbrev()
.setProperty(RDF_rdfxml_tab, 3)
- .setProperty(SERIALIZER_quoteChar, '\'')
- .setProperty(RDF_addRootProperty, true);
+ .setQuoteChar('\'')
+ .setAddRootProperty(true);
RdfParser p = RdfParser.DEFAULT_XML.clone();
//--------------------------------------------------------------------------------
// Default on class is Bag - Should only affect DEFAULT properties.
//--------------------------------------------------------------------------------
- s.setProperty(RDF_collectionFormat, RdfCollectionFormat.BAG);
+ s.setCollectionFormat(RdfCollectionFormat.BAG);
expected =
"<rdf:RDF b='http://ns/' j='http://www.apache.org/juneau/' jp='http://www.apache.org/juneaubp/' rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'>"
+ "\n <rdf:Description about='http://test/b'>"
@@ -525,8 +524,8 @@ public class RdfTest {
@Test
public void testLooseCollectionsOfBeans() throws Exception {
- WriterSerializer s = new RdfSerializer.XmlAbbrev().setProperty(RDF_looseCollections, true);
- ReaderParser p = new RdfParser.Xml().setProperty(RDF_looseCollections, true);
+ WriterSerializer s = new RdfSerializer.XmlAbbrev().setLooseCollections(true);
+ ReaderParser p = new RdfParser.Xml().setLooseCollections(true);
String rdfXml, expected;
List<D> l = new LinkedList<D>();
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core-test/src/test/java/org/apache/juneau/json/CommonParserTest.java
----------------------------------------------------------------------
diff --git a/juneau-core-test/src/test/java/org/apache/juneau/json/CommonParserTest.java b/juneau-core-test/src/test/java/org/apache/juneau/json/CommonParserTest.java
index f621811..04d067d 100755
--- a/juneau-core-test/src/test/java/org/apache/juneau/json/CommonParserTest.java
+++ b/juneau-core-test/src/test/java/org/apache/juneau/json/CommonParserTest.java
@@ -12,8 +12,6 @@
// ***************************************************************************************************************************
package org.apache.juneau.json;
-import static org.apache.juneau.BeanContext.*;
-import static org.apache.juneau.serializer.SerializerContext.*;
import static org.junit.Assert.*;
import java.util.*;
@@ -31,7 +29,7 @@ public class CommonParserTest {
//====================================================================================================
@Test
public void testFromSerializer() throws Exception {
- ReaderParser p = JsonParser.DEFAULT.clone().setClassLoader(getClass().getClassLoader()).addToDictionary(A1.class);
+ ReaderParser p = JsonParser.DEFAULT.clone().addToBeanDictionary(A1.class);
Map m = null;
m = (Map)p.parse("{a:1}", Object.class);
@@ -85,7 +83,7 @@ public class CommonParserTest {
tl.add(new A3("name0","value0"));
tl.add(new A3("name1","value1"));
b.list = tl;
- String json = new JsonSerializer().setProperty(SERIALIZER_addBeanTypeProperties, true).addToDictionary(A1.class).serialize(b);
+ String json = new JsonSerializer().setAddBeanTypeProperties(true).addToBeanDictionary(A1.class).serialize(b);
b = (A1)p.parse(json, Object.class);
assertEquals("value1", b.list.get(1).value);
@@ -116,7 +114,7 @@ public class CommonParserTest {
//====================================================================================================
@Test
public void testCorrectHandlingOfUnknownProperties() throws Exception {
- ReaderParser p = new JsonParser().setProperty(BEAN_ignoreUnknownBeanProperties, true);
+ ReaderParser p = new JsonParser().setIgnoreUnknownBeanProperties(true);
B b;
String in = "{a:1,unknown:3,b:2}";
@@ -164,7 +162,7 @@ public class CommonParserTest {
@Test
public void testParserListeners() throws Exception {
final List<String> events = new LinkedList<String>();
- JsonParser p = new JsonParser().setProperty(BEAN_ignoreUnknownBeanProperties, true);
+ JsonParser p = new JsonParser().setIgnoreUnknownBeanProperties(true);
p.addListener(
new ParserListener() {
@Override /* ParserListener */
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core-test/src/test/java/org/apache/juneau/json/CommonTest.java
----------------------------------------------------------------------
diff --git a/juneau-core-test/src/test/java/org/apache/juneau/json/CommonTest.java b/juneau-core-test/src/test/java/org/apache/juneau/json/CommonTest.java
index c443e31..460ec61 100755
--- a/juneau-core-test/src/test/java/org/apache/juneau/json/CommonTest.java
+++ b/juneau-core-test/src/test/java/org/apache/juneau/json/CommonTest.java
@@ -12,9 +12,7 @@
// ***************************************************************************************************************************
package org.apache.juneau.json;
-import static org.apache.juneau.BeanContext.*;
import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.serializer.SerializerContext.*;
import static org.junit.Assert.*;
import java.net.*;
@@ -39,13 +37,13 @@ public class CommonTest {
JsonParser p = JsonParser.DEFAULT;
A t1 = A.create(), t2;
- s.setProperty(SERIALIZER_trimNullProperties, false);
+ s.setTrimNullProperties(false);
String r = s.serialize(t1);
assertEquals("{s1:null,s2:'s2'}", r);
t2 = p.parse(r, A.class);
assertEqualObjects(t1, t2);
- s.setProperty(SERIALIZER_trimNullProperties, true);
+ s.setTrimNullProperties(true);
r = s.serialize(t1);
assertEquals("{s2:'s2'}", r);
t2 = p.parse(r, A.class);
@@ -72,13 +70,13 @@ public class CommonTest {
B t1 = B.create(), t2;
String r;
- s.setProperty(SERIALIZER_trimEmptyMaps, false);
+ s.setTrimEmptyMaps(false);
r = s.serialize(t1);
assertEquals("{f1:{},f2:{f2a:null,f2b:{s2:'s2'}}}", r);
t2 = p.parse(r, B.class);
assertEqualObjects(t1, t2);
- s.setProperty(SERIALIZER_trimEmptyMaps, true);
+ s.setTrimEmptyMaps(true);
r = s.serialize(t1);
assertEquals("{f2:{f2a:null,f2b:{s2:'s2'}}}", r);
t2 = p.parse(r, B.class);
@@ -106,13 +104,13 @@ public class CommonTest {
C t1 = C.create(), t2;
String r;
- s.setProperty(SERIALIZER_trimEmptyCollections, false);
+ s.setTrimEmptyCollections(false);
r = s.serialize(t1);
assertEquals("{f1:[],f2:[null,{s2:'s2'}]}", r);
t2 = p.parse(r, C.class);
assertEqualObjects(t1, t2);
- s.setProperty(SERIALIZER_trimEmptyCollections, true);
+ s.setTrimEmptyCollections(true);
r = s.serialize(t1);
assertEquals("{f2:[null,{s2:'s2'}]}", r);
t2 = p.parse(r, C.class);
@@ -140,13 +138,13 @@ public class CommonTest {
D t1 = D.create(), t2;
String r;
- s.setProperty(SERIALIZER_trimEmptyCollections, false);
+ s.setTrimEmptyCollections(false);
r = s.serialize(t1);
assertEquals("{f1:[],f2:[null,{s2:'s2'}]}", r);
t2 = p.parse(r, D.class);
assertEqualObjects(t1, t2);
- s.setProperty(SERIALIZER_trimEmptyCollections, true);
+ s.setTrimEmptyCollections(true);
r = s.serialize(t1);
assertEquals("{f2:[null,{s2:'s2'}]}", r);
t2 = p.parse(r, D.class);
@@ -254,7 +252,7 @@ public class CommonTest {
String r;
String expected = "";
- s.setProperty(SERIALIZER_relativeUriBase, null);
+ s.setRelativeUriBase(null);
r = s.serialize(t);
expected = "{"
+"f0:'f0/x0',"
@@ -275,11 +273,11 @@ public class CommonTest {
+"}";
assertEquals(expected, r);
- s.setProperty(SERIALIZER_relativeUriBase, ""); // Same as null.
+ s.setRelativeUriBase(""); // Same as null.
r = s.serialize(t);
assertEquals(expected, r);
- s.setProperty(SERIALIZER_relativeUriBase, "/cr");
+ s.setRelativeUriBase("/cr");
r = s.serialize(t);
expected = "{"
+"f0:'/cr/f0/x0',"
@@ -300,11 +298,11 @@ public class CommonTest {
+"}";
assertEquals(expected, r);
- s.setProperty(SERIALIZER_relativeUriBase, "/cr/"); // Same as above
+ s.setRelativeUriBase("/cr/"); // Same as above
r = s.serialize(t);
assertEquals(expected, r);
- s.setProperty(SERIALIZER_relativeUriBase, "/");
+ s.setRelativeUriBase("/");
r = s.serialize(t);
expected = "{"
+"f0:'/f0/x0',"
@@ -325,9 +323,9 @@ public class CommonTest {
+"}";
assertEquals(expected, r);
- s.setProperty(SERIALIZER_relativeUriBase, null);
+ s.setRelativeUriBase(null);
- s.setProperty(SERIALIZER_absolutePathUriBase, "http://foo");
+ s.setAbsolutePathUriBase("http://foo");
r = s.serialize(t);
expected = "{"
+"f0:'f0/x0',"
@@ -348,11 +346,11 @@ public class CommonTest {
+"}";
assertEquals(expected, r);
- s.setProperty(SERIALIZER_absolutePathUriBase, "http://foo/");
+ s.setAbsolutePathUriBase("http://foo/");
r = s.serialize(t);
assertEquals(expected, r);
- s.setProperty(SERIALIZER_absolutePathUriBase, ""); // Same as null.
+ s.setAbsolutePathUriBase(""); // Same as null.
r = s.serialize(t);
expected = "{"
+"f0:'f0/x0',"
@@ -381,15 +379,15 @@ public class CommonTest {
public void testLockedSerializer() throws Exception {
JsonSerializer s = new JsonSerializer().lock();
try {
- s.setProperty(JsonSerializerContext.JSON_simpleMode, true);
+ s.setSimpleMode(true);
fail("Locked exception not thrown");
} catch (LockedException e) {}
try {
- s.setProperty(SerializerContext.SERIALIZER_addBeanTypeProperties, true);
+ s.setAddBeanTypeProperties(true);
fail("Locked exception not thrown");
} catch (LockedException e) {}
try {
- s.setProperty(BeanContext.BEAN_beanMapPutReturnsOldValue, true);
+ s.setBeanMapPutReturnsOldValue(true);
fail("Locked exception not thrown");
} catch (LockedException e) {}
}
@@ -418,7 +416,7 @@ public class CommonTest {
}
// Recursion detection, no ignore
- s.setProperty(SERIALIZER_detectRecursions, true);
+ s.setDetectRecursions(true);
try {
s.serialize(r1);
fail("Exception expected!");
@@ -430,7 +428,7 @@ public class CommonTest {
assertTrue(msg.contains("->[3]r1:org.apache.juneau.json.CommonTest$R1"));
}
- s.setProperty(SERIALIZER_ignoreRecursions, true);
+ s.setIgnoreRecursions(true);
assertEquals("{name:'foo',r2:{name:'bar',r3:{name:'baz'}}}", s.serialize(r1));
// Make sure this doesn't blow up.
@@ -455,7 +453,7 @@ public class CommonTest {
//====================================================================================================
@Test
public void testBasicBean() throws Exception {
- JsonSerializer s = new JsonSerializer.Simple().setProperty(SERIALIZER_trimNullProperties, false).setProperty(BEAN_sortProperties, true);
+ JsonSerializer s = new JsonSerializer.Simple().setTrimNullProperties(false).setSortProperties(true);
J a = new J();
a.setF1("J");
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core-test/src/test/java/org/apache/juneau/json/JsonParserEdgeCasesTest.java
----------------------------------------------------------------------
diff --git a/juneau-core-test/src/test/java/org/apache/juneau/json/JsonParserEdgeCasesTest.java b/juneau-core-test/src/test/java/org/apache/juneau/json/JsonParserEdgeCasesTest.java
index a293831..574b906 100644
--- a/juneau-core-test/src/test/java/org/apache/juneau/json/JsonParserEdgeCasesTest.java
+++ b/juneau-core-test/src/test/java/org/apache/juneau/json/JsonParserEdgeCasesTest.java
@@ -368,9 +368,9 @@ public class JsonParserEdgeCasesTest {
public void testStrict() throws Exception {
Parser p = JsonParser.DEFAULT_STRICT;
if (name.contains("utf16LE"))
- p = p.clone().setProperty(ParserContext.PARSER_inputStreamCharset, "UTF-16LE");
+ p = p.clone().setInputStreamCharset("UTF-16LE");
else if (name.contains("utf16BE"))
- p = p.clone().setProperty(ParserContext.PARSER_inputStreamCharset, "UTF-16BE");
+ p = p.clone().setInputStreamCharset("UTF-16BE");
// 'y' tests should always succeed.
if (expected == 'y') {
@@ -407,9 +407,9 @@ public class JsonParserEdgeCasesTest {
public void testLax() throws Exception {
Parser p = JsonParser.DEFAULT;
if (name.contains("utf16LE"))
- p = p.clone().setProperty(ParserContext.PARSER_inputStreamCharset, "UTF-16LE");
+ p = p.clone().setInputStreamCharset("UTF-16LE");
else if (name.contains("utf16BE"))
- p = p.clone().setProperty(ParserContext.PARSER_inputStreamCharset, "UTF-16BE");
+ p = p.clone().setInputStreamCharset("UTF-16BE");
// 'y' tests should always succeed.
if (expected == 'y') {
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core-test/src/test/java/org/apache/juneau/json/JsonTest.java
----------------------------------------------------------------------
diff --git a/juneau-core-test/src/test/java/org/apache/juneau/json/JsonTest.java b/juneau-core-test/src/test/java/org/apache/juneau/json/JsonTest.java
index cfe4096..85e09f0 100755
--- a/juneau-core-test/src/test/java/org/apache/juneau/json/JsonTest.java
+++ b/juneau-core-test/src/test/java/org/apache/juneau/json/JsonTest.java
@@ -13,7 +13,6 @@
package org.apache.juneau.json;
import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.json.JsonSerializerContext.*;
import static org.junit.Assert.*;
import java.util.*;
@@ -34,8 +33,8 @@ public class JsonTest {
Map<String,Object> m = new LinkedHashMap<String,Object>();
List<Object> l = new LinkedList<Object>();
- WriterSerializer s1 = new JsonSerializer.Simple().setProperty(SERIALIZER_trimNullProperties, false);
- WriterSerializer s2 = new JsonSerializer.Simple().setProperty(SERIALIZER_trimNullProperties, false).setProperty(SERIALIZER_quoteChar, '"');
+ WriterSerializer s1 = new JsonSerializer.Simple().setTrimNullProperties(false);
+ WriterSerializer s2 = new JsonSerializer.Simple().setTrimNullProperties(false).setQuoteChar('"');
String r;
// Null keys and values
@@ -110,7 +109,7 @@ public class JsonTest {
//====================================================================================================
@Test
public void testBackslashesInStrings() throws Exception {
- JsonSerializer s = new JsonSerializer.Simple().setProperty(SERIALIZER_trimNullProperties, false).setProperty(SERIALIZER_quoteChar, '"');
+ JsonSerializer s = new JsonSerializer.Simple().setTrimNullProperties(false).setQuoteChar('"');
String r, r2;
// [\\]
@@ -290,13 +289,13 @@ public class JsonTest {
//====================================================================================================
@Test
public void testEscapeSolidus() throws Exception {
- JsonSerializer s = new JsonSerializer().setProperty(JSON_escapeSolidus, false);
+ JsonSerializer s = new JsonSerializer().setEscapeSolidus(false);
String r = s.serialize("foo/bar");
assertEquals("\"foo/bar\"", r);
r = JsonParser.DEFAULT.parse(r, String.class);
assertEquals("foo/bar", r);
- s = new JsonSerializer().setProperty(JSON_escapeSolidus, true);
+ s = new JsonSerializer().setEscapeSolidus(true);
r = s.serialize("foo/bar");
assertEquals("\"foo\\/bar\"", r);
r = JsonParser.DEFAULT.parse(r, String.class);
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core-test/src/test/java/org/apache/juneau/transforms/ByteArrayBase64SwapTest.java
----------------------------------------------------------------------
diff --git a/juneau-core-test/src/test/java/org/apache/juneau/transforms/ByteArrayBase64SwapTest.java b/juneau-core-test/src/test/java/org/apache/juneau/transforms/ByteArrayBase64SwapTest.java
index a7d593e..ab8004b 100755
--- a/juneau-core-test/src/test/java/org/apache/juneau/transforms/ByteArrayBase64SwapTest.java
+++ b/juneau-core-test/src/test/java/org/apache/juneau/transforms/ByteArrayBase64SwapTest.java
@@ -12,7 +12,6 @@
// ***************************************************************************************************************************
package org.apache.juneau.transforms;
-import static org.apache.juneau.serializer.SerializerContext.*;
import static org.junit.Assert.*;
import java.util.*;
@@ -42,7 +41,7 @@ public class ByteArrayBase64SwapTest extends RoundTripTest {
//====================================================================================================
@Test
public void testPrimitiveArrays() throws Exception {
- WriterSerializer s = new JsonSerializer.Simple().addPojoSwaps(ByteArrayBase64Swap.class).setProperty(SERIALIZER_trimNullProperties, false);
+ WriterSerializer s = new JsonSerializer.Simple().addPojoSwaps(ByteArrayBase64Swap.class).setTrimNullProperties(false);
byte[] a1 = {1,2,3};
assertEquals("'AQID'", s.serialize(a1));
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core-test/src/test/java/org/apache/juneau/transforms/CalendarSwapTest.java
----------------------------------------------------------------------
diff --git a/juneau-core-test/src/test/java/org/apache/juneau/transforms/CalendarSwapTest.java b/juneau-core-test/src/test/java/org/apache/juneau/transforms/CalendarSwapTest.java
index 16a79c8..fa1bdfb 100755
--- a/juneau-core-test/src/test/java/org/apache/juneau/transforms/CalendarSwapTest.java
+++ b/juneau-core-test/src/test/java/org/apache/juneau/transforms/CalendarSwapTest.java
@@ -12,8 +12,6 @@
// ***************************************************************************************************************************
package org.apache.juneau.transforms;
-import static org.apache.juneau.html.HtmlSerializerContext.*;
-import static org.apache.juneau.jena.RdfCommonContext.*;
import static org.junit.Assert.*;
import java.net.*;
@@ -55,11 +53,11 @@ public class CalendarSwapTest {
private RdfSerializer getRdfSerializer() {
return new RdfSerializer()
- .setProperty(SERIALIZER_quoteChar, '\'')
- .setProperty(SERIALIZER_useIndentation, false)
- .setProperty(RDF_rdfxml_allowBadUris, true)
- .setProperty(RDF_rdfxml_showDoctypeDeclaration, false)
- .setProperty(RDF_rdfxml_showXmlDeclaration, false);
+ .setQuoteChar('\'')
+ .setUseIndentation(false)
+ .setProperty(RdfCommonContext.RDF_rdfxml_allowBadUris, true)
+ .setProperty(RdfCommonContext.RDF_rdfxml_showDoctypeDeclaration, false)
+ .setProperty(RdfCommonContext.RDF_rdfxml_showXmlDeclaration, false);
}
private String stripRdf(String s) {
@@ -440,7 +438,7 @@ public class CalendarSwapTest {
@Test
public void testDefaultMapHtml() throws Exception {
Class<?> f = CalendarMapSwap.class;
- WriterSerializer s = new HtmlSerializer.Sq().addPojoSwaps(f).setProperty(HTML_addKeyValueTableHeaders, true);
+ WriterSerializer s = new HtmlSerializer.Sq().addPojoSwaps(f).setAddKeyValueTableHeaders(true);
ReaderParser p = new HtmlParser().addPojoSwaps(f);
doTest(s, p, true, "<table><tr><th>key</th><th>value</th></tr><tr><td>time</td><td><number>-2172116928000</number></td></tr><tr><td>timeZone</td><td>PST</td></tr></table>");
}
@@ -585,7 +583,7 @@ public class CalendarSwapTest {
//====================================================================================================
@Test
public void testBeanProperyFilterHtml() throws Exception {
- WriterSerializer s = HtmlSerializer.DEFAULT_SQ.clone().setProperty(HTML_addKeyValueTableHeaders, true);
+ WriterSerializer s = HtmlSerializer.DEFAULT_SQ.clone().setAddKeyValueTableHeaders(true);
ReaderParser p = HtmlParser.DEFAULT;
Calendar c = testDate;
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core-test/src/test/java/org/apache/juneau/urlencoding/CommonParser_UonTest.java
----------------------------------------------------------------------
diff --git a/juneau-core-test/src/test/java/org/apache/juneau/urlencoding/CommonParser_UonTest.java b/juneau-core-test/src/test/java/org/apache/juneau/urlencoding/CommonParser_UonTest.java
index 64f3d8a..9b51a35 100755
--- a/juneau-core-test/src/test/java/org/apache/juneau/urlencoding/CommonParser_UonTest.java
+++ b/juneau-core-test/src/test/java/org/apache/juneau/urlencoding/CommonParser_UonTest.java
@@ -12,8 +12,6 @@
// ***************************************************************************************************************************
package org.apache.juneau.urlencoding;
-import static org.apache.juneau.BeanContext.*;
-import static org.apache.juneau.serializer.SerializerContext.*;
import static org.junit.Assert.*;
import java.util.*;
@@ -26,8 +24,8 @@ import org.junit.*;
@SuppressWarnings({"rawtypes","serial","javadoc"})
public class CommonParser_UonTest {
- ReaderParser p = UonParser.DEFAULT.clone().setClassLoader(getClass().getClassLoader()).addToDictionary(A1.class);
- ReaderParser pe = UonParser.DEFAULT_DECODING.clone().setClassLoader(getClass().getClassLoader());
+ ReaderParser p = UonParser.DEFAULT.clone().addToBeanDictionary(A1.class);
+ ReaderParser pe = UonParser.DEFAULT_DECODING.clone();
//====================================================================================================
// testFromSerializer
@@ -71,7 +69,7 @@ public class CommonParser_UonTest {
tl.add(new A3("name1","value1"));
b.list = tl;
- in = new UonSerializer().setProperty(SERIALIZER_addBeanTypeProperties, true).serialize(b);
+ in = new UonSerializer().setAddBeanTypeProperties(true).serialize(b);
b = (A1)p.parse(in, Object.class);
assertEquals("value1", b.list.get(1).value);
@@ -102,7 +100,7 @@ public class CommonParser_UonTest {
//====================================================================================================
@Test
public void testCorrectHandlingOfUnknownProperties() throws Exception {
- ReaderParser p = new UonParser().setProperty(BEAN_ignoreUnknownBeanProperties, true);
+ ReaderParser p = new UonParser().setIgnoreUnknownBeanProperties(true);
B t;
String in = "(a=1,unknown=3,b=2)";
@@ -152,7 +150,7 @@ public class CommonParser_UonTest {
@Test
public void testParserListeners() throws Exception {
final List<String> events = new LinkedList<String>();
- UonParser p = new UonParser().setProperty(BEAN_ignoreUnknownBeanProperties, true);
+ UonParser p = new UonParser().setIgnoreUnknownBeanProperties(true);
p.addListener(
new ParserListener() {
@Override /* ParserListener */
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core-test/src/test/java/org/apache/juneau/urlencoding/CommonParser_UrlEncodingTest.java
----------------------------------------------------------------------
diff --git a/juneau-core-test/src/test/java/org/apache/juneau/urlencoding/CommonParser_UrlEncodingTest.java b/juneau-core-test/src/test/java/org/apache/juneau/urlencoding/CommonParser_UrlEncodingTest.java
index 5739068..2690017 100755
--- a/juneau-core-test/src/test/java/org/apache/juneau/urlencoding/CommonParser_UrlEncodingTest.java
+++ b/juneau-core-test/src/test/java/org/apache/juneau/urlencoding/CommonParser_UrlEncodingTest.java
@@ -12,9 +12,7 @@
// ***************************************************************************************************************************
package org.apache.juneau.urlencoding;
-import static org.apache.juneau.BeanContext.*;
import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.serializer.SerializerContext.*;
import static org.junit.Assert.*;
import java.util.*;
@@ -28,7 +26,7 @@ import org.junit.*;
@SuppressWarnings({"rawtypes","serial","javadoc"})
public class CommonParser_UrlEncodingTest {
- ReaderParser p = UrlEncodingParser.DEFAULT.clone().setClassLoader(getClass().getClassLoader()).addToDictionary(A1.class);
+ ReaderParser p = UrlEncodingParser.DEFAULT.clone().addToBeanDictionary(A1.class);
//====================================================================================================
// testFromSerializer
@@ -73,7 +71,7 @@ public class CommonParser_UrlEncodingTest {
tl.add(new A3("name1","value1"));
b.list = tl;
- in = new UrlEncodingSerializer().setProperty(SERIALIZER_addBeanTypeProperties, true).serialize(b);
+ in = new UrlEncodingSerializer().setAddBeanTypeProperties(true).serialize(b);
b = (A1)p.parse(in, Object.class);
assertEquals("value1", b.list.get(1).value);
@@ -104,7 +102,7 @@ public class CommonParser_UrlEncodingTest {
//====================================================================================================
@Test
public void testCorrectHandlingOfUnknownProperties() throws Exception {
- ReaderParser p = new UrlEncodingParser().setProperty(BEAN_ignoreUnknownBeanProperties, true);
+ ReaderParser p = new UrlEncodingParser().setIgnoreUnknownBeanProperties(true);
B t;
String in = "a=1&unknown=3&b=2";
@@ -154,7 +152,7 @@ public class CommonParser_UrlEncodingTest {
@Test
public void testParserListeners() throws Exception {
final List<String> events = new LinkedList<String>();
- UonParser p = new UrlEncodingParser().setProperty(BEAN_ignoreUnknownBeanProperties, true);
+ UonParser p = new UrlEncodingParser().setIgnoreUnknownBeanProperties(true);
p.addListener(
new ParserListener() {
@Override /* ParserListener */
@@ -172,7 +170,7 @@ public class CommonParser_UrlEncodingTest {
@Test
public void testCollections() throws Exception {
- WriterSerializer s = new UrlEncodingSerializer().setProperty(UonSerializerContext.UON_simpleMode, true);
+ WriterSerializer s = new UrlEncodingSerializer().setSimpleMode(true);
ReaderParser p = new UrlEncodingParser();
List l = new ObjectList("foo","bar");
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core-test/src/test/java/org/apache/juneau/urlencoding/Common_UonTest.java
----------------------------------------------------------------------
diff --git a/juneau-core-test/src/test/java/org/apache/juneau/urlencoding/Common_UonTest.java b/juneau-core-test/src/test/java/org/apache/juneau/urlencoding/Common_UonTest.java
index 768eaec..3a819ee 100755
--- a/juneau-core-test/src/test/java/org/apache/juneau/urlencoding/Common_UonTest.java
+++ b/juneau-core-test/src/test/java/org/apache/juneau/urlencoding/Common_UonTest.java
@@ -13,7 +13,6 @@
package org.apache.juneau.urlencoding;
import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.serializer.SerializerContext.*;
import static org.junit.Assert.*;
import java.net.*;
@@ -22,7 +21,6 @@ import java.util.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
-import org.apache.juneau.json.*;
import org.apache.juneau.serializer.*;
import org.apache.juneau.testbeans.*;
import org.junit.*;
@@ -40,13 +38,13 @@ public class Common_UonTest {
UonSerializer s = new UonSerializer.Encoding();
A t1 = A.create(), t2;
- s.setProperty(SERIALIZER_trimNullProperties, false);
+ s.setTrimNullProperties(false);
String r = s.serialize(t1);
assertEquals("$o(s1=%00,s2=s2)", r);
t2 = pe.parse(r, A.class);
assertEqualObjects(t1, t2);
- s.setProperty(SERIALIZER_trimNullProperties, true);
+ s.setTrimNullProperties(true);
r = s.serialize(t1);
assertEquals("$o(s2=s2)", r);
t2 = p.parse(r, A.class);
@@ -72,13 +70,13 @@ public class Common_UonTest {
B t1 = B.create(), t2;
String r;
- s.setProperty(SERIALIZER_trimEmptyMaps, false);
+ s.setTrimEmptyMaps(false);
r = s.serialize(t1);
assertEquals("(f1=(),f2=(f2a=%00,f2b=(s2=s2)))", r);
t2 = pe.parse(r, B.class);
assertEqualObjects(t1, t2);
- s.setProperty(SERIALIZER_trimEmptyMaps, true);
+ s.setTrimEmptyMaps(true);
r = s.serialize(t1);
assertEquals("(f2=(f2a=%00,f2b=(s2=s2)))", r);
t2 = pe.parse(r, B.class);
@@ -105,13 +103,13 @@ public class Common_UonTest {
C t1 = C.create(), t2;
String r;
- s.setProperty(SERIALIZER_trimEmptyCollections, false);
+ s.setTrimEmptyCollections(false);
r = s.serialize(t1);
assertEquals("$o(f1=$a(),f2=$a(%00,$o(s2=s2)))", r);
t2 = pe.parse(r, C.class);
assertEqualObjects(t1, t2);
- s.setProperty(SERIALIZER_trimEmptyCollections, true);
+ s.setTrimEmptyCollections(true);
r = s.serialize(t1);
assertEquals("$o(f2=$a(%00,$o(s2=s2)))", r);
t2 = pe.parse(r, C.class);
@@ -138,13 +136,13 @@ public class Common_UonTest {
D t1 = D.create(), t2;
String r;
- s.setProperty(SERIALIZER_trimEmptyCollections, false);
+ s.setTrimEmptyCollections(false);
r = s.serialize(t1);
assertEquals("$o(f1=$a(),f2=$a(%00,$o(s2=s2)))", r);
t2 = pe.parse(r, D.class);
assertEqualObjects(t1, t2);
- s.setProperty(SERIALIZER_trimEmptyCollections, true);
+ s.setTrimEmptyCollections(true);
r = s.serialize(t1);
assertEquals("$o(f2=$a(%00,$o(s2=s2)))", r);
t2 = pe.parse(r, D.class);
@@ -250,7 +248,7 @@ public class Common_UonTest {
String r;
String expected;
- s.setProperty(SERIALIZER_relativeUriBase, null);
+ s.setRelativeUriBase(null);
r = s.serialize(t);
expected = ""
+"$o("
@@ -272,11 +270,11 @@ public class Common_UonTest {
+")";
assertEquals(expected, r);
- s.setProperty(SERIALIZER_relativeUriBase, ""); // Same as null.
+ s.setRelativeUriBase(""); // Same as null.
r = s.serialize(t);
assertEquals(expected, r);
- s.setProperty(SERIALIZER_relativeUriBase, "/cr");
+ s.setRelativeUriBase("/cr");
r = s.serialize(t);
expected = ""
+"$o("
@@ -298,11 +296,11 @@ public class Common_UonTest {
+")";
assertEquals(expected, r);
- s.setProperty(SERIALIZER_relativeUriBase, "/cr/"); // Same as above
+ s.setRelativeUriBase("/cr/"); // Same as above
r = s.serialize(t);
assertEquals(expected, r);
- s.setProperty(SERIALIZER_relativeUriBase, "/");
+ s.setRelativeUriBase("/");
r = s.serialize(t);
expected = ""
+"$o("
@@ -324,9 +322,9 @@ public class Common_UonTest {
+")";
assertEquals(expected, r);
- s.setProperty(SERIALIZER_relativeUriBase, null);
+ s.setRelativeUriBase(null);
- s.setProperty(SERIALIZER_absolutePathUriBase, "http://foo");
+ s.setAbsolutePathUriBase("http://foo");
r = s.serialize(t);
expected = ""
+"$o("
@@ -348,11 +346,11 @@ public class Common_UonTest {
+")";
assertEquals(expected, r);
- s.setProperty(SERIALIZER_absolutePathUriBase, "http://foo/");
+ s.setAbsolutePathUriBase("http://foo/");
r = s.serialize(t);
assertEquals(expected, r);
- s.setProperty(SERIALIZER_absolutePathUriBase, ""); // Same as null.
+ s.setAbsolutePathUriBase(""); // Same as null.
r = s.serialize(t);
expected = ""
+"$o("
@@ -382,15 +380,15 @@ public class Common_UonTest {
public void testLockedSerializer() throws Exception {
UonSerializer s = new UonSerializer().lock();
try {
- s.setProperty(JsonSerializerContext.JSON_simpleMode, true);
+ s.setSimpleMode(true);
fail("Locked exception not thrown");
} catch (LockedException e) {}
try {
- s.setProperty(SerializerContext.SERIALIZER_addBeanTypeProperties, true);
+ s.setAddBeanTypeProperties(true);
fail("Locked exception not thrown");
} catch (LockedException e) {}
try {
- s.setProperty(BeanContext.BEAN_beanMapPutReturnsOldValue, true);
+ s.setBeanMapPutReturnsOldValue(true);
fail("Locked exception not thrown");
} catch (LockedException e) {}
}
@@ -419,7 +417,7 @@ public class Common_UonTest {
}
// Recursion detection, no ignore
- s.setProperty(SERIALIZER_detectRecursions, true);
+ s.setDetectRecursions(true);
try {
s.serialize(r1);
fail("Exception expected!");
@@ -431,7 +429,7 @@ public class Common_UonTest {
assertTrue(msg.contains("->[3]r1:org.apache.juneau.urlencoding.Common_UonTest$R1"));
}
- s.setProperty(SERIALIZER_ignoreRecursions, true);
+ s.setIgnoreRecursions(true);
assertEquals("$o(name=foo,r2=$o(name=bar,r3=$o(name=baz)))", s.serialize(r1));
}
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core-test/src/test/java/org/apache/juneau/urlencoding/Common_UrlEncodingTest.java
----------------------------------------------------------------------
diff --git a/juneau-core-test/src/test/java/org/apache/juneau/urlencoding/Common_UrlEncodingTest.java b/juneau-core-test/src/test/java/org/apache/juneau/urlencoding/Common_UrlEncodingTest.java
index 0f0a30f..efd9e93 100755
--- a/juneau-core-test/src/test/java/org/apache/juneau/urlencoding/Common_UrlEncodingTest.java
+++ b/juneau-core-test/src/test/java/org/apache/juneau/urlencoding/Common_UrlEncodingTest.java
@@ -13,7 +13,6 @@
package org.apache.juneau.urlencoding;
import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.serializer.SerializerContext.*;
import static org.junit.Assert.*;
import java.net.*;
@@ -22,7 +21,6 @@ import java.util.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
-import org.apache.juneau.json.*;
import org.apache.juneau.serializer.*;
import org.apache.juneau.testbeans.*;
import org.junit.*;
@@ -39,13 +37,13 @@ public class Common_UrlEncodingTest {
UrlEncodingSerializer s = new UrlEncodingSerializer();
A t1 = A.create(), t2;
- s.setProperty(SERIALIZER_trimNullProperties, false);
+ s.setTrimNullProperties(false);
String r = s.serialize(t1);
assertEquals("s1=%00&s2=s2", r);
t2 = p.parse(r, A.class);
assertEqualObjects(t1, t2);
- s.setProperty(SERIALIZER_trimNullProperties, true);
+ s.setTrimNullProperties(true);
r = s.serialize(t1);
assertEquals("s2=s2", r);
t2 = p.parse(r, A.class);
@@ -71,13 +69,13 @@ public class Common_UrlEncodingTest {
B t1 = B.create(), t2;
String r;
- s.setProperty(SERIALIZER_trimEmptyMaps, false);
+ s.setTrimEmptyMaps(false);
r = s.serialize(t1);
assertEquals("f1=()&f2=(f2a=%00,f2b=(s2=s2))", r);
t2 = p.parse(r, B.class);
assertEqualObjects(t1, t2);
- s.setProperty(SERIALIZER_trimEmptyMaps, true);
+ s.setTrimEmptyMaps(true);
r = s.serialize(t1);
assertEquals("f2=(f2a=%00,f2b=(s2=s2))", r);
t2 = p.parse(r, B.class);
@@ -104,13 +102,13 @@ public class Common_UrlEncodingTest {
C t1 = C.create(), t2;
String r;
- s.setProperty(SERIALIZER_trimEmptyCollections, false);
+ s.setTrimEmptyCollections(false);
r = s.serialize(t1);
assertEquals("f1=$a()&f2=$a(%00,$o(s2=s2))", r);
t2 = p.parse(r, C.class);
assertEqualObjects(t1, t2);
- s.setProperty(SERIALIZER_trimEmptyCollections, true);
+ s.setTrimEmptyCollections(true);
r = s.serialize(t1);
assertEquals("f2=$a(%00,$o(s2=s2))", r);
t2 = p.parse(r, C.class);
@@ -137,13 +135,13 @@ public class Common_UrlEncodingTest {
D t1 = D.create(), t2;
String r;
- s.setProperty(SERIALIZER_trimEmptyCollections, false);
+ s.setTrimEmptyCollections(false);
r = s.serialize(t1);
assertEquals("f1=$a()&f2=$a(%00,$o(s2=s2))", r);
t2 = p.parse(r, D.class);
assertEqualObjects(t1, t2);
- s.setProperty(SERIALIZER_trimEmptyCollections, true);
+ s.setTrimEmptyCollections(true);
r = s.serialize(t1);
assertEquals("f2=$a(%00,$o(s2=s2))", r);
t2 = p.parse(r, D.class);
@@ -252,7 +250,7 @@ public class Common_UrlEncodingTest {
String r;
String expected = "";
- s.setProperty(SERIALIZER_relativeUriBase, null);
+ s.setRelativeUriBase(null);
r = s.serialize(t);
expected = ""
+"f0=f0/x0"
@@ -272,11 +270,11 @@ public class Common_UrlEncodingTest {
+"&fe=http://www.apache.org/fe/xe?foo=bar%26label2=MY_LABEL";
assertEquals(expected, r);
- s.setProperty(SERIALIZER_relativeUriBase, ""); // Same as null.
+ s.setRelativeUriBase(""); // Same as null.
r = s.serialize(t);
assertEquals(expected, r);
- s.setProperty(SERIALIZER_relativeUriBase, "/cr");
+ s.setRelativeUriBase("/cr");
r = s.serialize(t);
expected = ""
+"f0=/cr/f0/x0"
@@ -296,11 +294,11 @@ public class Common_UrlEncodingTest {
+"&fe=http://www.apache.org/fe/xe?foo=bar%26label2=MY_LABEL";
assertEquals(expected, r);
- s.setProperty(SERIALIZER_relativeUriBase, "/cr/"); // Same as above
+ s.setRelativeUriBase("/cr/"); // Same as above
r = s.serialize(t);
assertEquals(expected, r);
- s.setProperty(SERIALIZER_relativeUriBase, "/");
+ s.setRelativeUriBase("/");
r = s.serialize(t);
expected = ""
+"f0=/f0/x0"
@@ -320,9 +318,9 @@ public class Common_UrlEncodingTest {
+"&fe=http://www.apache.org/fe/xe?foo=bar%26label2=MY_LABEL";
assertEquals(expected, r);
- s.setProperty(SERIALIZER_relativeUriBase, null);
+ s.setRelativeUriBase(null);
- s.setProperty(SERIALIZER_absolutePathUriBase, "http://foo");
+ s.setAbsolutePathUriBase("http://foo");
r = s.serialize(t);
expected = ""
+"f0=f0/x0"
@@ -342,11 +340,11 @@ public class Common_UrlEncodingTest {
+"&fe=http://www.apache.org/fe/xe?foo=bar%26label2=MY_LABEL";
assertEquals(expected, r);
- s.setProperty(SERIALIZER_absolutePathUriBase, "http://foo/");
+ s.setAbsolutePathUriBase("http://foo/");
r = s.serialize(t);
assertEquals(expected, r);
- s.setProperty(SERIALIZER_absolutePathUriBase, ""); // Same as null.
+ s.setAbsolutePathUriBase(""); // Same as null.
r = s.serialize(t);
expected = ""
+"f0=f0/x0"
@@ -374,15 +372,15 @@ public class Common_UrlEncodingTest {
public void testLockedSerializer() throws Exception {
UrlEncodingSerializer s = new UrlEncodingSerializer().lock();
try {
- s.setProperty(JsonSerializerContext.JSON_simpleMode, true);
+ s.setSimpleMode(true);
fail("Locked exception not thrown");
} catch (LockedException e) {}
try {
- s.setProperty(SerializerContext.SERIALIZER_addBeanTypeProperties, true);
+ s.setAddBeanTypeProperties(true);
fail("Locked exception not thrown");
} catch (LockedException e) {}
try {
- s.setProperty(BeanContext.BEAN_beanMapPutReturnsOldValue, true);
+ s.setBeanMapPutReturnsOldValue(true);
fail("Locked exception not thrown");
} catch (LockedException e) {}
}
@@ -411,7 +409,7 @@ public class Common_UrlEncodingTest {
}
// Recursion detection, no ignore
- s.setProperty(SERIALIZER_detectRecursions, true);
+ s.setDetectRecursions(true);
try {
s.serialize(r1);
fail("Exception expected!");
@@ -423,7 +421,7 @@ public class Common_UrlEncodingTest {
assertTrue(msg.contains("->[3]r1:org.apache.juneau.urlencoding.Common_UrlEncodingTest$R1"));
}
- s.setProperty(SERIALIZER_ignoreRecursions, true);
+ s.setIgnoreRecursions(true);
assertEquals("name=foo&r2=$o(name=bar,r3=$o(name=baz))", s.serialize(r1));
}
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core-test/src/test/java/org/apache/juneau/urlencoding/UrlEncodingParserTest.java
----------------------------------------------------------------------
diff --git a/juneau-core-test/src/test/java/org/apache/juneau/urlencoding/UrlEncodingParserTest.java b/juneau-core-test/src/test/java/org/apache/juneau/urlencoding/UrlEncodingParserTest.java
index 911bf22..30ab795 100755
--- a/juneau-core-test/src/test/java/org/apache/juneau/urlencoding/UrlEncodingParserTest.java
+++ b/juneau-core-test/src/test/java/org/apache/juneau/urlencoding/UrlEncodingParserTest.java
@@ -893,7 +893,7 @@ public class UrlEncodingParserTest {
UrlEncodingParser p;
String in;
- p = UrlEncodingParser.DEFAULT.clone().setProperty(UrlEncodingContext.URLENC_expandedParams, true);
+ p = UrlEncodingParser.DEFAULT.clone().setExpandedParams(true);
in = ""
+ "f01=a&f01=b"
+ "&f02=c&f02=d"
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core-test/src/test/java/org/apache/juneau/urlencoding/UrlEncodingSerializerTest.java
----------------------------------------------------------------------
diff --git a/juneau-core-test/src/test/java/org/apache/juneau/urlencoding/UrlEncodingSerializerTest.java b/juneau-core-test/src/test/java/org/apache/juneau/urlencoding/UrlEncodingSerializerTest.java
index 8bcb6ce..3366856 100755
--- a/juneau-core-test/src/test/java/org/apache/juneau/urlencoding/UrlEncodingSerializerTest.java
+++ b/juneau-core-test/src/test/java/org/apache/juneau/urlencoding/UrlEncodingSerializerTest.java
@@ -391,7 +391,7 @@ public class UrlEncodingSerializerTest {
+ "&f20=(((a=a,b=1,c=true)),((a=a,b=1,c=true)))";
assertEquals(e, r);
- s = UrlEncodingSerializer.DEFAULT_SIMPLE.clone().setProperty(UrlEncodingContext.URLENC_expandedParams, true);
+ s = UrlEncodingSerializer.DEFAULT_SIMPLE.clone().setExpandedParams(true);
r = s.serialize(t);
e = ""
+ "f01=a&f01=b"
@@ -452,7 +452,7 @@ public class UrlEncodingSerializerTest {
+ "&f20=((a=a,b=1,c=true))&f20=((a=a,b=1,c=true))";
assertEquals(e, r);
- s = UrlEncodingSerializer.DEFAULT_SIMPLE.clone().setProperty(UrlEncodingContext.URLENC_expandedParams, true);
+ s = UrlEncodingSerializer.DEFAULT_SIMPLE.clone().setExpandedParams(true);
r = s.serialize(t);
e = ""
+ "f01=a&f01=b"
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core-test/src/test/java/org/apache/juneau/utils/PojoRestTest.java
----------------------------------------------------------------------
diff --git a/juneau-core-test/src/test/java/org/apache/juneau/utils/PojoRestTest.java b/juneau-core-test/src/test/java/org/apache/juneau/utils/PojoRestTest.java
index 8661c71..5450e2d 100755
--- a/juneau-core-test/src/test/java/org/apache/juneau/utils/PojoRestTest.java
+++ b/juneau-core-test/src/test/java/org/apache/juneau/utils/PojoRestTest.java
@@ -12,7 +12,6 @@
// ***************************************************************************************************************************
package org.apache.juneau.utils;
-import static org.apache.juneau.serializer.SerializerContext.*;
import static org.junit.Assert.*;
import java.util.*;
@@ -83,7 +82,7 @@ public class PojoRestTest {
Address a3 = (Address)model.get("/person1/addresses/1");
assertEquals("city B", a3.city);
- serializer = new JsonSerializer.Simple().setProperty(SERIALIZER_addBeanTypeProperties, true);
+ serializer = new JsonSerializer.Simple().setAddBeanTypeProperties(true);
p = new Person("some name", 123,
new Address("street A", "city A", "state A", 12345, true),
new Address("street B", "city B", "state B", 12345, false)
@@ -95,7 +94,7 @@ public class PojoRestTest {
assertEquals(expectedValue, s);
// Parse it back to Java objects.
- p = (Person)JsonParser.DEFAULT.clone().setClassLoader(getClass().getClassLoader()).addToDictionary(Person.class).parse(s, Object.class);
+ p = (Person)JsonParser.DEFAULT.clone().addToBeanDictionary(Person.class).parse(s, Object.class);
expectedValue = "city B";
s = p.addresses[1].city;
assertEquals(expectedValue, s);
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core-test/src/test/java/org/apache/juneau/utils/StringUtilsTest.java
----------------------------------------------------------------------
diff --git a/juneau-core-test/src/test/java/org/apache/juneau/utils/StringUtilsTest.java b/juneau-core-test/src/test/java/org/apache/juneau/utils/StringUtilsTest.java
index 71ccc49..5adc446 100755
--- a/juneau-core-test/src/test/java/org/apache/juneau/utils/StringUtilsTest.java
+++ b/juneau-core-test/src/test/java/org/apache/juneau/utils/StringUtilsTest.java
@@ -15,7 +15,6 @@ package org.apache.juneau.utils;
import static org.apache.juneau.TestUtils.*;
import static org.apache.juneau.internal.StringUtils.*;
import static org.junit.Assert.*;
-import static org.apache.juneau.BeanContext.*;
import java.math.*;
import java.util.*;
@@ -639,7 +638,7 @@ public class StringUtilsTest {
//====================================================================================================
@Test
public void testParseISO8601Date() throws Exception {
- WriterSerializer s = new JsonSerializer.Simple().addPojoSwaps(DateSwap.ISO8601DTPZ.class).setProperty(BEAN_timeZone, "GMT");
+ WriterSerializer s = new JsonSerializer.Simple().addPojoSwaps(DateSwap.ISO8601DTPZ.class).setTimeZone(TimeZone.getTimeZone("GMT"));
assertNull(parseISO8601Date(null));
assertNull(parseISO8601Date(""));
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core-test/src/test/java/org/apache/juneau/xml/CommonParserTest.java
----------------------------------------------------------------------
diff --git a/juneau-core-test/src/test/java/org/apache/juneau/xml/CommonParserTest.java b/juneau-core-test/src/test/java/org/apache/juneau/xml/CommonParserTest.java
index 481cfb7..68265db 100755
--- a/juneau-core-test/src/test/java/org/apache/juneau/xml/CommonParserTest.java
+++ b/juneau-core-test/src/test/java/org/apache/juneau/xml/CommonParserTest.java
@@ -12,7 +12,6 @@
// ***************************************************************************************************************************
package org.apache.juneau.xml;
-import static org.apache.juneau.BeanContext.*;
import static org.junit.Assert.*;
import java.util.*;
@@ -104,7 +103,7 @@ public class CommonParserTest {
//====================================================================================================
@Test
public void testCorrectHandlingOfUnknownProperties() throws Exception {
- ReaderParser p = new XmlParser().setProperty(BEAN_ignoreUnknownBeanProperties, true);
+ ReaderParser p = new XmlParser().setIgnoreUnknownBeanProperties(true);
B t;
String in = "<object><a>1</a><unknown>foo</unknown><b>2</b></object>";
@@ -160,7 +159,7 @@ public class CommonParserTest {
@Test
public void testParserListeners() throws Exception {
final List<String> events = new LinkedList<String>();
- XmlParser p = new XmlParser().setProperty(BEAN_ignoreUnknownBeanProperties, true);
+ XmlParser p = new XmlParser().setIgnoreUnknownBeanProperties(true);
p.addListener(
new ParserListener() {
@Override /* ParserListener */
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core-test/src/test/java/org/apache/juneau/xml/CommonTest.java
----------------------------------------------------------------------
diff --git a/juneau-core-test/src/test/java/org/apache/juneau/xml/CommonTest.java b/juneau-core-test/src/test/java/org/apache/juneau/xml/CommonTest.java
index 7ef01fd..764847a 100755
--- a/juneau-core-test/src/test/java/org/apache/juneau/xml/CommonTest.java
+++ b/juneau-core-test/src/test/java/org/apache/juneau/xml/CommonTest.java
@@ -13,8 +13,6 @@
package org.apache.juneau.xml;
import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.serializer.SerializerContext.*;
-import static org.apache.juneau.xml.XmlSerializerContext.*;
import static org.apache.juneau.xml.annotation.XmlFormat.*;
import static org.junit.Assert.*;
@@ -42,13 +40,13 @@ public class CommonTest {
XmlParser p = new XmlParser();
A t1 = A.create(), t2;
- s.setProperty(SERIALIZER_trimNullProperties, false);
+ s.setTrimNullProperties(false);
String r = s.serialize(t1);
assertEquals("<object><s1 _type='null'/><s2>s2</s2></object>", r);
t2 = p.parse(r, A.class);
assertEqualObjects(t1, t2);
- s.setProperty(SERIALIZER_trimNullProperties, true);
+ s.setTrimNullProperties(true);
r = s.serialize(t1);
assertEquals("<object><s2>s2</s2></object>", r);
t2 = p.parse(r, A.class);
@@ -75,13 +73,13 @@ public class CommonTest {
B t1 = B.create(), t2;
String r;
- s.setProperty(SERIALIZER_trimEmptyMaps, false);
+ s.setTrimEmptyMaps(false);
r = s.serialize(t1);
assertEquals("<object><f1/><f2><f2a _type='null'/><f2b><s2>s2</s2></f2b></f2></object>", r);
t2 = p.parse(r, B.class);
assertEqualObjects(t1, t2);
- s.setProperty(SERIALIZER_trimEmptyMaps, true);
+ s.setTrimEmptyMaps(true);
r = s.serialize(t1);
assertEquals("<object><f2><f2a _type='null'/><f2b><s2>s2</s2></f2b></f2></object>", r);
t2 = p.parse(r, B.class);
@@ -109,13 +107,13 @@ public class CommonTest {
C t1 = C.create(), t2;
String r;
- s.setProperty(SERIALIZER_trimEmptyCollections, false);
+ s.setTrimEmptyCollections(false);
r = s.serialize(t1);
assertEquals("<object><f1></f1><f2><null/><object><s2>s2</s2></object></f2></object>", r);
t2 = p.parse(r, C.class);
assertEqualObjects(t1, t2);
- s.setProperty(SERIALIZER_trimEmptyCollections, true);
+ s.setTrimEmptyCollections(true);
r = s.serialize(t1);
assertEquals("<object><f2><null/><object><s2>s2</s2></object></f2></object>", r);
t2 = p.parse(r, C.class);
@@ -143,13 +141,13 @@ public class CommonTest {
D t1 = D.create(), t2;
String r;
- s.setProperty(SERIALIZER_trimEmptyCollections, false);
+ s.setTrimEmptyCollections(false);
r = s.serialize(t1);
assertEquals("<object><f1></f1><f2><null/><object><s2>s2</s2></object></f2></object>", r);
t2 = p.parse(r, D.class);
assertEqualObjects(t1, t2);
- s.setProperty(SERIALIZER_trimEmptyCollections, true);
+ s.setTrimEmptyCollections(true);
r = s.serialize(t1);
assertEquals("<object><f2><null/><object><s2>s2</s2></object></f2></object>", r);
t2 = p.parse(r, D.class);
@@ -265,7 +263,7 @@ public class CommonTest {
String r;
String expected;
- s.setProperty(SERIALIZER_relativeUriBase, null);
+ s.setRelativeUriBase(null);
r = s.serialize(t);
expected = ""
+"<object f0='f0/x0'>"
@@ -286,11 +284,11 @@ public class CommonTest {
+"</object>";
assertEquals(expected, r);
- s.setProperty(SERIALIZER_relativeUriBase, ""); // Same as null.
+ s.setRelativeUriBase(""); // Same as null.
r = s.serialize(t);
assertEquals(expected, r);
- s.setProperty(SERIALIZER_relativeUriBase, "/cr");
+ s.setRelativeUriBase("/cr");
r = s.serialize(t);
expected = ""
+"<object f0='/cr/f0/x0'>"
@@ -311,11 +309,11 @@ public class CommonTest {
+"</object>";
assertEquals(expected, r);
- s.setProperty(SERIALIZER_relativeUriBase, "/cr/"); // Same as above
+ s.setRelativeUriBase("/cr/"); // Same as above
r = s.serialize(t);
assertEquals(expected, r);
- s.setProperty(SERIALIZER_relativeUriBase, "/");
+ s.setRelativeUriBase("/");
r = s.serialize(t);
expected = ""
+"<object f0='/f0/x0'>"
@@ -336,9 +334,9 @@ public class CommonTest {
+"</object>";
assertEquals(expected, r);
- s.setProperty(SERIALIZER_relativeUriBase, null);
+ s.setRelativeUriBase(null);
- s.setProperty(SERIALIZER_absolutePathUriBase, "http://foo");
+ s.setAbsolutePathUriBase("http://foo");
r = s.serialize(t);
expected = ""
+"<object f0='f0/x0'>"
@@ -359,11 +357,11 @@ public class CommonTest {
+"</object>";
assertEquals(expected, r);
- s.setProperty(SERIALIZER_absolutePathUriBase, "http://foo/");
+ s.setAbsolutePathUriBase("http://foo/");
r = s.serialize(t);
assertEquals(expected, r);
- s.setProperty(SERIALIZER_absolutePathUriBase, ""); // Same as null.
+ s.setAbsolutePathUriBase(""); // Same as null.
r = s.serialize(t);
expected = ""
+"<object f0='f0/x0'>"
@@ -392,15 +390,15 @@ public class CommonTest {
public void testLockedSerializer() throws Exception {
XmlSerializer s = new XmlSerializer().lock();
try {
- s.setProperty(XmlSerializerContext.XML_enableNamespaces, true);
+ s.setEnableNamespaces(true);
fail("Locked exception not thrown");
} catch (LockedException e) {}
try {
- s.setProperty(SerializerContext.SERIALIZER_addBeanTypeProperties, true);
+ s.setAddBeanTypeProperties(true);
fail("Locked exception not thrown");
} catch (LockedException e) {}
try {
- s.setProperty(BeanContext.BEAN_beanMapPutReturnsOldValue, true);
+ s.setBeanMapPutReturnsOldValue(true);
fail("Locked exception not thrown");
} catch (LockedException e) {}
}
@@ -410,7 +408,7 @@ public class CommonTest {
//====================================================================================================
@Test
public void testRecursion() throws Exception {
- XmlSerializer s = new XmlSerializer().setProperty(XML_enableNamespaces, false);
+ XmlSerializer s = new XmlSerializer().setEnableNamespaces(false);
R1 r1 = new R1();
R2 r2 = new R2();
@@ -429,7 +427,7 @@ public class CommonTest {
}
// Recursion detection, no ignore
- s.setProperty(SERIALIZER_detectRecursions, true);
+ s.setDetectRecursions(true);
try {
s.serialize(r1);
fail("Exception expected!");
@@ -441,7 +439,7 @@ public class CommonTest {
assertTrue(msg.contains("->[3]r1:org.apache.juneau.xml.CommonTest$R1"));
}
- s.setProperty(SERIALIZER_ignoreRecursions, true);
+ s.setIgnoreRecursions(true);
assertEquals("<object><name>foo</name><r2><name>bar</name><r3><name>baz</name></r3></r2></object>", s.serialize(r1));
// Make sure this doesn't blow up.
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core-test/src/test/java/org/apache/juneau/xml/CommonXmlTest.java
----------------------------------------------------------------------
diff --git a/juneau-core-test/src/test/java/org/apache/juneau/xml/CommonXmlTest.java b/juneau-core-test/src/test/java/org/apache/juneau/xml/CommonXmlTest.java
index e2fd383..996a6cf 100755
--- a/juneau-core-test/src/test/java/org/apache/juneau/xml/CommonXmlTest.java
+++ b/juneau-core-test/src/test/java/org/apache/juneau/xml/CommonXmlTest.java
@@ -13,7 +13,6 @@
package org.apache.juneau.xml;
import static org.apache.juneau.TestUtils.*;
-import static org.apache.juneau.xml.XmlSerializerContext.*;
import static org.apache.juneau.xml.annotation.XmlFormat.*;
import static org.junit.Assert.*;
@@ -62,7 +61,7 @@ public class CommonXmlTest {
//====================================================================================================
@Test
public void testBeanUriAnnotationOnlyUriProperty() throws Exception {
- XmlSerializer s = new XmlSerializer.Sq().setProperty(XML_addNamespaceUrisToRoot, false);
+ XmlSerializer s = new XmlSerializer.Sq().setAddNamespaceUrisToRoot(false);
B t = new B("http://foo");
String xml = s.serialize(t);
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core-test/src/test/java/org/apache/juneau/xml/XmlContentTest.java
----------------------------------------------------------------------
diff --git a/juneau-core-test/src/test/java/org/apache/juneau/xml/XmlContentTest.java b/juneau-core-test/src/test/java/org/apache/juneau/xml/XmlContentTest.java
index 6872723..d695969 100755
--- a/juneau-core-test/src/test/java/org/apache/juneau/xml/XmlContentTest.java
+++ b/juneau-core-test/src/test/java/org/apache/juneau/xml/XmlContentTest.java
@@ -14,7 +14,6 @@ package org.apache.juneau.xml;
import static org.apache.juneau.TestUtils.*;
import static org.apache.juneau.serializer.SerializerContext.*;
-import static org.apache.juneau.xml.XmlSerializerContext.*;
import static org.apache.juneau.xml.annotation.XmlFormat.*;
import static org.junit.Assert.*;
@@ -35,7 +34,7 @@ public class XmlContentTest {
public void testContentFormat() throws Exception {
A t = A.newInstance(), t2;
XmlSerializer s1 = XmlSerializer.DEFAULT_SQ,
- s2 = new XmlSerializer().setProperty(SERIALIZER_quoteChar, '\'').setProperty(SERIALIZER_useIndentation, true).setProperty(XML_enableNamespaces, false);
+ s2 = new XmlSerializer().setQuoteChar('\'').setUseIndentation(true).setEnableNamespaces(false);
XmlParser p = XmlParser.DEFAULT;
XmlSerializerSession session;
String r;
@@ -143,7 +142,7 @@ public class XmlContentTest {
public void testXmlMixed() throws Exception {
B t = B.newInstance(), t2;
XmlSerializer s1 = XmlSerializer.DEFAULT_SQ,
- s2 = new XmlSerializer().setProperty(SERIALIZER_quoteChar, '\'').setProperty(SERIALIZER_useIndentation, true).setProperty(XML_enableNamespaces, false);
+ s2 = new XmlSerializer().setQuoteChar('\'').setUseIndentation(true).setEnableNamespaces(false);
XmlParser p = XmlParser.DEFAULT;
XmlSerializerSession session;
String r;
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core-test/src/test/java/org/apache/juneau/xml/XmlParserTest.java
----------------------------------------------------------------------
diff --git a/juneau-core-test/src/test/java/org/apache/juneau/xml/XmlParserTest.java b/juneau-core-test/src/test/java/org/apache/juneau/xml/XmlParserTest.java
index 3606118..64ca1c3 100755
--- a/juneau-core-test/src/test/java/org/apache/juneau/xml/XmlParserTest.java
+++ b/juneau-core-test/src/test/java/org/apache/juneau/xml/XmlParserTest.java
@@ -12,7 +12,6 @@
// ***************************************************************************************************************************
package org.apache.juneau.xml;
-import static org.apache.juneau.xml.XmlParserContext.*;
import static org.junit.Assert.*;
import org.apache.juneau.*;
@@ -83,7 +82,7 @@ public class XmlParserTest {
public void testPreserveRootElement() throws Exception {
String xml;
ObjectMap m;
- ReaderParser p = new XmlParser().setProperty(XML_preserveRootElement, true);
+ ReaderParser p = new XmlParser().setPreserveRootElement(true);
xml = "<A><B><C>c</C></B></A>";
m = p.parse(xml, ObjectMap.class);
[08/14] incubator-juneau git commit: Add convenience property setters
to serializers and parsers.
Posted by ja...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/dto/html5/Label.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Label.java b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Label.java
index 794e2f5..d64564a 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Label.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Label.java
@@ -24,7 +24,7 @@ public class Label extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-label-for">for</a> attribute.
* Associate the label with form control.
- * @param _for - The new value for this attribute.
+ * @param _for The new value for this attribute.
* @return This object (for method chaining).
*/
public final Label _for(String _for) {
@@ -35,7 +35,7 @@ public class Label extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fae-form">form</a> attribute.
* Associates the control with a form element.
- * @param form - The new value for this attribute.
+ * @param form The new value for this attribute.
* @return This object (for method chaining).
*/
public final Label form(String form) {
@@ -43,6 +43,7 @@ public class Label extends HtmlElementMixed {
return this;
}
+
//--------------------------------------------------------------------------------
// Overridden methods
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/dto/html5/Link.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Link.java b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Link.java
index f9a2f41..e25d90c 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Link.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Link.java
@@ -26,7 +26,7 @@ public class Link extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/document-metadata.html#attr-link-crossorigin">crossorigin</a> attribute.
* How the element handles crossorigin requests.
- * @param crossorigin - The new value for this attribute.
+ * @param crossorigin The new value for this attribute.
* @return This object (for method chaining).
*/
public final Link crossorigin(String crossorigin) {
@@ -37,7 +37,7 @@ public class Link extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/document-metadata.html#attr-link-href">href</a> attribute.
* Address of the hyperlink.
- * @param href - The new value for this attribute.
+ * @param href The new value for this attribute.
* Typically a {@link URL} or {@link String}.
* @return This object (for method chaining).
*/
@@ -49,7 +49,7 @@ public class Link extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/document-metadata.html#attr-link-hreflang">hreflang</a> attribute.
* Language of the linked resource.
- * @param hreflang - The new value for this attribute.
+ * @param hreflang The new value for this attribute.
* @return This object (for method chaining).
*/
public final Link hreflang(String hreflang) {
@@ -60,7 +60,7 @@ public class Link extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/document-metadata.html#attr-link-media">media</a> attribute.
* Applicable media.
- * @param media - The new value for this attribute.
+ * @param media The new value for this attribute.
* @return This object (for method chaining).
*/
public final Link media(String media) {
@@ -71,7 +71,7 @@ public class Link extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/document-metadata.html#attr-link-rel">rel</a> attribute.
* Relationship between the document containing the hyperlink and the destination resource.
- * @param rel - The new value for this attribute.
+ * @param rel The new value for this attribute.
* @return This object (for method chaining).
*/
public final Link rel(String rel) {
@@ -82,7 +82,7 @@ public class Link extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/links.html#attr-link-sizes">sizes</a> attribute.
* Sizes of the icons (for rel="icon").
- * @param sizes - The new value for this attribute.
+ * @param sizes The new value for this attribute.
* @return This object (for method chaining).
*/
public final Link sizes(String sizes) {
@@ -93,7 +93,7 @@ public class Link extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/document-metadata.html#attr-link-type">type</a> attribute.
* Hint for the type of the referenced resource.
- * @param type - The new value for this attribute.
+ * @param type The new value for this attribute.
* @return This object (for method chaining).
*/
public final Link type(String type) {
@@ -101,6 +101,7 @@ public class Link extends HtmlElementEmpty {
return this;
}
+
//--------------------------------------------------------------------------------
// Overridden methods
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/dto/html5/Map.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Map.java b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Map.java
index 709526b..19d1d85 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Map.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Map.java
@@ -24,7 +24,7 @@ public class Map extends HtmlElementContainer {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-map-name">name</a> attribute.
* Name of image map to reference from the usemap attribute.
- * @param name - The new value for this attribute.
+ * @param name The new value for this attribute.
* @return This object (for method chaining).
*/
public final Map name(String name) {
@@ -32,6 +32,7 @@ public class Map extends HtmlElementContainer {
return this;
}
+
//--------------------------------------------------------------------------------
// Overridden methods
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/dto/html5/Meta.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Meta.java b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Meta.java
index 70ee31e..fd98fa7 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Meta.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Meta.java
@@ -24,7 +24,7 @@ public class Meta extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/document-metadata.html#attr-meta-charset">charset</a> attribute.
* Character encoding declaration.
- * @param charset - The new value for this attribute.
+ * @param charset The new value for this attribute.
* @return This object (for method chaining).
*/
public final Meta charset(String charset) {
@@ -35,7 +35,7 @@ public class Meta extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/document-metadata.html#attr-meta-content">content</a> attribute.
* Value of the element.
- * @param content - The new value for this attribute.
+ * @param content The new value for this attribute.
* @return This object (for method chaining).
*/
public final Meta content(String content) {
@@ -46,7 +46,7 @@ public class Meta extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/document-metadata.html#attr-meta-http-equiv">http-equiv</a> attribute.
* Pragma directive.
- * @param httpequiv - The new value for this attribute.
+ * @param httpequiv The new value for this attribute.
* @return This object (for method chaining).
*/
public final Meta httpequiv(String httpequiv) {
@@ -57,7 +57,7 @@ public class Meta extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/document-metadata.html#attr-meta-name">name</a> attribute.
* Metadata name.
- * @param name - The new value for this attribute.
+ * @param name The new value for this attribute.
* @return This object (for method chaining).
*/
public final Meta name(String name) {
@@ -65,6 +65,7 @@ public class Meta extends HtmlElementEmpty {
return this;
}
+
//--------------------------------------------------------------------------------
// Overridden methods
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/dto/html5/Meter.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Meter.java b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Meter.java
index ce2a87d..f6009cb 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Meter.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Meter.java
@@ -24,7 +24,7 @@ public class Meter extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-meter-high">high</a> attribute.
* Low limit of high range.
- * @param high - The new value for this attribute.
+ * @param high The new value for this attribute.
* Typically a {@link Number} or {@link String}.
* @return This object (for method chaining).
*/
@@ -36,7 +36,7 @@ public class Meter extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-meter-low">low</a> attribute.
* High limit of low range.
- * @param low - The new value for this attribute.
+ * @param low The new value for this attribute.
* Typically a {@link Number} or {@link String}.
* @return This object (for method chaining).
*/
@@ -48,7 +48,7 @@ public class Meter extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-meter-max">max</a> attribute.
* Upper bound of range.
- * @param max - The new value for this attribute.
+ * @param max The new value for this attribute.
* Typically a {@link Number} or {@link String}.
* @return This object (for method chaining).
*/
@@ -60,7 +60,7 @@ public class Meter extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-meter-min">min</a> attribute.
* Lower bound of range.
- * @param min - The new value for this attribute.
+ * @param min The new value for this attribute.
* Typically a {@link Number} or {@link String}.
* @return This object (for method chaining).
*/
@@ -72,7 +72,7 @@ public class Meter extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-meter-optimum">optimum</a> attribute.
* Optimum value in gauge.
- * @param optimum - The new value for this attribute.
+ * @param optimum The new value for this attribute.
* Typically a {@link Number} or {@link String}.
* @return This object (for method chaining).
*/
@@ -84,7 +84,7 @@ public class Meter extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-meter-value">value</a> attribute.
* Current value of the element.
- * @param value - The new value for this attribute.
+ * @param value The new value for this attribute.
* Typically a {@link Number} or {@link String}.
* @return This object (for method chaining).
*/
@@ -93,6 +93,7 @@ public class Meter extends HtmlElementMixed {
return this;
}
+
//--------------------------------------------------------------------------------
// Overridden methods
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/dto/html5/Object2.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Object2.java b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Object2.java
index dc340ac..0fcf493 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Object2.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Object2.java
@@ -24,7 +24,7 @@ public class Object2 extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-object-data">data</a> attribute.
* Address of the resource.
- * @param data - The new value for this attribute.
+ * @param data The new value for this attribute.
* @return This object (for method chaining).
*/
public final Object2 data(String data) {
@@ -35,7 +35,7 @@ public class Object2 extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fae-form">form</a> attribute.
* Associates the control with a form element.
- * @param form - The new value for this attribute.
+ * @param form The new value for this attribute.
* @return This object (for method chaining).
*/
public final Object2 form(String form) {
@@ -46,7 +46,7 @@ public class Object2 extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-dim-height">height</a> attribute.
* Vertical dimension.
- * @param height - The new value for this attribute.
+ * @param height The new value for this attribute.
* Typically a {@link Number} or {@link String}.
* @return This object (for method chaining).
*/
@@ -58,7 +58,7 @@ public class Object2 extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-object-name">name</a> attribute.
* Name of nested browsing context.
- * @param name - The new value for this attribute.
+ * @param name The new value for this attribute.
* @return This object (for method chaining).
*/
public final Object2 name(String name) {
@@ -69,7 +69,7 @@ public class Object2 extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-object-type">type</a> attribute.
* Type of embedded resource.
- * @param type - The new value for this attribute.
+ * @param type The new value for this attribute.
* @return This object (for method chaining).
*/
public final Object2 type(String type) {
@@ -80,7 +80,7 @@ public class Object2 extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-object-typemustmatch">typemustmatch</a> attribute.
* Whether the type attribute and the Content-Type value need to match for the resource to be used.
- * @param typemustmatch - The new value for this attribute.
+ * @param typemustmatch The new value for this attribute.
* Typically a {@link Boolean} or {@link String}.
* @return This object (for method chaining).
*/
@@ -92,7 +92,7 @@ public class Object2 extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-hyperlink-usemap">usemap</a> attribute.
* Name of image map to use.
- * @param usemap - The new value for this attribute.
+ * @param usemap The new value for this attribute.
* @return This object (for method chaining).
*/
public final Object2 usemap(String usemap) {
@@ -103,7 +103,7 @@ public class Object2 extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-dim-width">width</a> attribute.
* Horizontal dimension.
- * @param width - The new value for this attribute.
+ * @param width The new value for this attribute.
* Typically a {@link Number} or {@link String}.
* @return This object (for method chaining).
*/
@@ -112,6 +112,7 @@ public class Object2 extends HtmlElementMixed {
return this;
}
+
//--------------------------------------------------------------------------------
// Overridden methods
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/dto/html5/Ol.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Ol.java b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Ol.java
index f6847be..3a16500 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Ol.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Ol.java
@@ -24,7 +24,7 @@ public class Ol extends HtmlElementContainer {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/grouping-content.html#attr-ol-reversed">reversed</a> attribute.
* Number the list backwards..
- * @param reversed - The new value for this attribute.
+ * @param reversed The new value for this attribute.
* Typically a {@link Boolean} or {@link String}.
* @return This object (for method chaining).
*/
@@ -36,7 +36,7 @@ public class Ol extends HtmlElementContainer {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/grouping-content.html#attr-ol-start">start</a> attribute.
* Ordinal value of the first item.
- * @param start - The new value for this attribute.
+ * @param start The new value for this attribute.
* Typically a {@link Number} or {@link String}.
* @return This object (for method chaining).
*/
@@ -48,7 +48,7 @@ public class Ol extends HtmlElementContainer {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/grouping-content.html#attr-ol-type">type</a> attribute.
* Kind of list marker..
- * @param type - The new value for this attribute.
+ * @param type The new value for this attribute.
* @return This object (for method chaining).
*/
public final Ol type(String type) {
@@ -56,6 +56,7 @@ public class Ol extends HtmlElementContainer {
return this;
}
+
//--------------------------------------------------------------------------------
// Overridden methods
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/dto/html5/Optgroup.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Optgroup.java b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Optgroup.java
index 9375c5f..61ec10f 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Optgroup.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Optgroup.java
@@ -24,7 +24,7 @@ public class Optgroup extends HtmlElementContainer {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-optgroup-disabled">disabled</a> attribute.
* Whether the form control is disabled.
- * @param disabled - The new value for this attribute.
+ * @param disabled The new value for this attribute.
* Typically a {@link Boolean} or {@link String}.
* @return This object (for method chaining).
*/
@@ -36,7 +36,7 @@ public class Optgroup extends HtmlElementContainer {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-optgroup-label">label</a> attribute.
* User-visible label.
- * @param label - The new value for this attribute.
+ * @param label The new value for this attribute.
* @return This object (for method chaining).
*/
public final Optgroup label(String label) {
@@ -44,6 +44,7 @@ public class Optgroup extends HtmlElementContainer {
return this;
}
+
//--------------------------------------------------------------------------------
// Overridden methods
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/dto/html5/Option.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Option.java b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Option.java
index 9636345..4e9f5a6 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Option.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Option.java
@@ -24,7 +24,7 @@ public class Option extends HtmlElementText {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-option-disabled">disabled</a> attribute.
* Whether the form control is disabled.
- * @param disabled - The new value for this attribute.
+ * @param disabled The new value for this attribute.
* Typically a {@link Boolean} or {@link String}.
* @return This object (for method chaining).
*/
@@ -36,7 +36,7 @@ public class Option extends HtmlElementText {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-option-label">label</a> attribute.
* User-visible label.
- * @param label - The new value for this attribute.
+ * @param label The new value for this attribute.
* @return This object (for method chaining).
*/
public final Option label(String label) {
@@ -47,7 +47,7 @@ public class Option extends HtmlElementText {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-option-selected">selected</a> attribute.
* Whether the option is selected by default.
- * @param selected - The new value for this attribute.
+ * @param selected The new value for this attribute.
* Typically a {@link Boolean} or {@link String}.
* @return This object (for method chaining).
*/
@@ -59,7 +59,7 @@ public class Option extends HtmlElementText {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-option-value">value</a> attribute.
* Value to be used for form submission.
- * @param value - The new value for this attribute.
+ * @param value The new value for this attribute.
* Typically a {@link Number} or {@link String}.
* @return This object (for method chaining).
*/
@@ -68,6 +68,7 @@ public class Option extends HtmlElementText {
return this;
}
+
//--------------------------------------------------------------------------------
// Overridden methods
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/dto/html5/Output.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Output.java b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Output.java
index 3524ccc..a6d9379 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Output.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Output.java
@@ -24,7 +24,7 @@ public class Output extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-output-for">for</a> attribute.
* Specifies controls from which the output was calculated.
- * @param _for - The new value for this attribute.
+ * @param _for The new value for this attribute.
* @return This object (for method chaining).
*/
public final Output _for(String _for) {
@@ -35,7 +35,7 @@ public class Output extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fae-form">form</a> attribute.
* Associates the control with a form element.
- * @param form - The new value for this attribute.
+ * @param form The new value for this attribute.
* @return This object (for method chaining).
*/
public final Output form(String form) {
@@ -46,7 +46,7 @@ public class Output extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fe-name">name</a> attribute.
* Name of form control to use for form submission and in the form.elements API.
- * @param name - The new value for this attribute.
+ * @param name The new value for this attribute.
* @return This object (for method chaining).
*/
public final Output name(String name) {
@@ -54,6 +54,7 @@ public class Output extends HtmlElementMixed {
return this;
}
+
//--------------------------------------------------------------------------------
// Overridden methods
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/dto/html5/Param.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Param.java b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Param.java
index dc36d56..04fe149 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Param.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Param.java
@@ -24,7 +24,7 @@ public class Param extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-param-name">name</a> attribute.
* Name of parameter.
- * @param name - The new value for this attribute.
+ * @param name The new value for this attribute.
* @return This object (for method chaining).
*/
public final Param name(String name) {
@@ -35,7 +35,7 @@ public class Param extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-param-value">value</a> attribute.
* Value of parameter.
- * @param value - The new value for this attribute.
+ * @param value The new value for this attribute.
* Typically a {@link Number} or {@link String}.
* @return This object (for method chaining).
*/
@@ -44,6 +44,7 @@ public class Param extends HtmlElementEmpty {
return this;
}
+
//--------------------------------------------------------------------------------
// Overridden methods
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/dto/html5/Progress.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Progress.java b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Progress.java
index 1324ef4..1e27351 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Progress.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Progress.java
@@ -24,7 +24,7 @@ public class Progress extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-progress-max">max</a> attribute.
* Upper bound of range.
- * @param max - The new value for this attribute.
+ * @param max The new value for this attribute.
* Typically a {@link Number} or {@link String}.
* @return This object (for method chaining).
*/
@@ -36,7 +36,7 @@ public class Progress extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-progress-value">value</a> attribute.
* Current value of the element.
- * @param value - The new value for this attribute.
+ * @param value The new value for this attribute.
* Typically a {@link Number} or {@link String}.
* @return This object (for method chaining).
*/
@@ -45,6 +45,7 @@ public class Progress extends HtmlElementMixed {
return this;
}
+
//--------------------------------------------------------------------------------
// Overridden methods
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/dto/html5/Q.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Q.java b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Q.java
index ff75b74..e60a900 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Q.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Q.java
@@ -24,7 +24,7 @@ public class Q extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/text-level-semantics.html#attr-q-cite">cite</a> attribute.
* Link to the source of the quotation or more information about the edit.
- * @param cite - The new value for this attribute.
+ * @param cite The new value for this attribute.
* @return This object (for method chaining).
*/
public final Q cite(String cite) {
@@ -32,6 +32,7 @@ public class Q extends HtmlElementMixed {
return this;
}
+
//--------------------------------------------------------------------------------
// Overridden methods
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/dto/html5/Script.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Script.java b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Script.java
index dfef75a..4992a5c 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Script.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Script.java
@@ -27,7 +27,7 @@ public class Script extends HtmlElementText {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/scripting-1.html#attr-script-async">async</a> attribute.
* Execute script asynchronously.
- * @param async - The new value for this attribute.
+ * @param async The new value for this attribute.
* Typically a {@link Boolean} or {@link String}.
* @return This object (for method chaining).
*/
@@ -39,7 +39,7 @@ public class Script extends HtmlElementText {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/scripting-1.html#attr-script-charset">charset</a> attribute.
* Character encoding of the external script resource.
- * @param charset - The new value for this attribute.
+ * @param charset The new value for this attribute.
* @return This object (for method chaining).
*/
public final Script charset(String charset) {
@@ -50,7 +50,7 @@ public class Script extends HtmlElementText {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/scripting-1.html#attr-script-crossorigin">crossorigin</a> attribute.
* How the element handles crossorigin requests.
- * @param crossorigin - The new value for this attribute.
+ * @param crossorigin The new value for this attribute.
* @return This object (for method chaining).
*/
public final Script crossorigin(String crossorigin) {
@@ -61,7 +61,7 @@ public class Script extends HtmlElementText {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/scripting-1.html#attr-script-defer">defer</a> attribute.
* Defer script execution.
- * @param defer - The new value for this attribute.
+ * @param defer The new value for this attribute.
* Typically a {@link Boolean} or {@link String}.
* @return This object (for method chaining).
*/
@@ -73,7 +73,7 @@ public class Script extends HtmlElementText {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/scripting-1.html#attr-script-src">src</a> attribute.
* Address of the resource.
- * @param src - The new value for this attribute.
+ * @param src The new value for this attribute.
* Typically a {@link URL} or {@link String}.
* @return This object (for method chaining).
*/
@@ -85,7 +85,7 @@ public class Script extends HtmlElementText {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/scripting-1.html#attr-script-type">type</a> attribute.
* Type of embedded resource.
- * @param type - The new value for this attribute.
+ * @param type The new value for this attribute.
* @return This object (for method chaining).
*/
public final Script type(String type) {
@@ -93,6 +93,7 @@ public class Script extends HtmlElementText {
return this;
}
+
//--------------------------------------------------------------------------------
// Overridden methods
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/dto/html5/Select.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Select.java b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Select.java
index 54d5372..43fd4d6 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Select.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Select.java
@@ -24,7 +24,7 @@ public class Select extends HtmlElementContainer {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fe-autofocus">autofocus</a> attribute.
* Automatically focus the form control when the page is loaded.
- * @param autofocus - The new value for this attribute.
+ * @param autofocus The new value for this attribute.
* Typically a {@link Boolean} or {@link String}.
* @return This object (for method chaining).
*/
@@ -36,7 +36,7 @@ public class Select extends HtmlElementContainer {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fe-disabled">disabled</a> attribute.
* Whether the form control is disabled.
- * @param disabled - The new value for this attribute.
+ * @param disabled The new value for this attribute.
* Typically a {@link Boolean} or {@link String}.
* @return This object (for method chaining).
*/
@@ -48,7 +48,7 @@ public class Select extends HtmlElementContainer {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fae-form">form</a> attribute.
* Associates the control with a form element.
- * @param form - The new value for this attribute.
+ * @param form The new value for this attribute.
* @return This object (for method chaining).
*/
public final Select form(String form) {
@@ -59,7 +59,7 @@ public class Select extends HtmlElementContainer {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-select-multiple">multiple</a> attribute.
* Whether to allow multiple values.
- * @param multiple - The new value for this attribute.
+ * @param multiple The new value for this attribute.
* Typically a {@link Boolean} or {@link String}.
* @return This object (for method chaining).
*/
@@ -71,7 +71,7 @@ public class Select extends HtmlElementContainer {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fe-name">name</a> attribute.
* Name of form control to use for form submission and in the form.elements API.
- * @param name - The new value for this attribute.
+ * @param name The new value for this attribute.
* @return This object (for method chaining).
*/
public final Select name(String name) {
@@ -82,7 +82,7 @@ public class Select extends HtmlElementContainer {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-select-required">required</a> attribute.
* Whether the control is required for form submission.
- * @param required - The new value for this attribute.
+ * @param required The new value for this attribute.
* Typically a {@link Boolean} or {@link String}.
* @return This object (for method chaining).
*/
@@ -94,7 +94,7 @@ public class Select extends HtmlElementContainer {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-select-size">size</a> attribute.
* Size of the control.
- * @param size - The new value for this attribute.
+ * @param size The new value for this attribute.
* Typically a {@link Number} or {@link String}.
* @return This object (for method chaining).
*/
@@ -103,6 +103,7 @@ public class Select extends HtmlElementContainer {
return this;
}
+
//--------------------------------------------------------------------------------
// Overridden methods
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/dto/html5/Source.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Source.java b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Source.java
index 57cf235..59f9996 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Source.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Source.java
@@ -26,7 +26,7 @@ public class Source extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-source-src">src</a> attribute.
* Address of the resource.
- * @param src - The new value for this attribute.
+ * @param src The new value for this attribute.
* Typically a {@link URL} or {@link String}.
* @return This object (for method chaining).
*/
@@ -38,7 +38,7 @@ public class Source extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-source-type">type</a> attribute.
* Type of embedded resource.
- * @param type - The new value for this attribute.
+ * @param type The new value for this attribute.
* @return This object (for method chaining).
*/
public final Source type(String type) {
@@ -46,6 +46,7 @@ public class Source extends HtmlElementEmpty {
return this;
}
+
//--------------------------------------------------------------------------------
// Overridden methods
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/dto/html5/Style.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Style.java b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Style.java
index b4a8c77..174c1f5 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Style.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Style.java
@@ -25,7 +25,7 @@ public class Style extends HtmlElementText {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/document-metadata.html#attr-style-media">media</a> attribute.
* Applicable media.
- * @param media - The new value for this attribute.
+ * @param media The new value for this attribute.
* @return This object (for method chaining).
*/
public final Style media(String media) {
@@ -36,7 +36,7 @@ public class Style extends HtmlElementText {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/document-metadata.html#attr-style-type">type</a> attribute.
* Type of embedded resource.
- * @param type - The new value for this attribute.
+ * @param type The new value for this attribute.
* @return This object (for method chaining).
*/
public final Style type(String type) {
@@ -44,6 +44,7 @@ public class Style extends HtmlElementText {
return this;
}
+
//--------------------------------------------------------------------------------
// Overridden methods
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/dto/html5/Table.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Table.java b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Table.java
index 2c1e80d..136a3cc 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Table.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Table.java
@@ -24,7 +24,7 @@ public class Table extends HtmlElementContainer {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/tabular-data.html#attr-table-border">border</a> attribute.
* //sortable - Enables a sorting interface for the table.
- * @param border - The new value for this attribute.
+ * @param border The new value for this attribute.
* Typically a {@link Number} or {@link String}.
* @return This object (for method chaining).
*/
@@ -33,6 +33,7 @@ public class Table extends HtmlElementContainer {
return this;
}
+
//--------------------------------------------------------------------------------
// Overridden methods
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/dto/html5/Td.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Td.java b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Td.java
index ef86e8f..3b88acb 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Td.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Td.java
@@ -24,7 +24,7 @@ public class Td extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/tabular-data.html#attr-tdth-colspan">colspan</a> attribute.
* Number of columns that the cell is to span.
- * @param colspan - The new value for this attribute.
+ * @param colspan The new value for this attribute.
* Typically a {@link Number} or {@link String}.
* @return This object (for method chaining).
*/
@@ -36,7 +36,7 @@ public class Td extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/tabular-data.html#attr-tdth-headers">headers</a> attribute.
* The header cells for this cell.
- * @param headers - The new value for this attribute.
+ * @param headers The new value for this attribute.
* @return This object (for method chaining).
*/
public final Td headers(String headers) {
@@ -47,7 +47,7 @@ public class Td extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/tabular-data.html#attr-tdth-rowspan">rowspan</a> attribute.
* Number of rows that the cell is to span.
- * @param rowspan - The new value for this attribute.
+ * @param rowspan The new value for this attribute.
* Typically a {@link Number} or {@link String}.
* @return This object (for method chaining).
*/
@@ -56,6 +56,7 @@ public class Td extends HtmlElementMixed {
return this;
}
+
//--------------------------------------------------------------------------------
// Overridden methods
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/dto/html5/Textarea.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Textarea.java b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Textarea.java
index 66a6441..498d0d6 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Textarea.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Textarea.java
@@ -24,7 +24,7 @@ public class Textarea extends HtmlElementText {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fe-autocomplete">autocomplete</a> attribute.
* Hint for form autofill feature.
- * @param autocomplete - The new value for this attribute.
+ * @param autocomplete The new value for this attribute.
* @return This object (for method chaining).
*/
public final Textarea autocomplete(String autocomplete) {
@@ -35,7 +35,7 @@ public class Textarea extends HtmlElementText {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fe-autofocus">autofocus</a> attribute.
* Automatically focus the form control when the page is loaded.
- * @param autofocus - The new value for this attribute.
+ * @param autofocus The new value for this attribute.
* Typically a {@link Boolean} or {@link String}.
* @return This object (for method chaining).
*/
@@ -47,7 +47,7 @@ public class Textarea extends HtmlElementText {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-textarea-cols">cols</a> attribute.
* Maximum number of characters per line.
- * @param cols - The new value for this attribute.
+ * @param cols The new value for this attribute.
* Typically a {@link Number} or {@link String}.
* @return This object (for method chaining).
*/
@@ -59,7 +59,7 @@ public class Textarea extends HtmlElementText {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fe-dirname">dirname</a> attribute.
* Name of form field to use for sending the element's directionality in form submission.
- * @param dirname - The new value for this attribute.
+ * @param dirname The new value for this attribute.
* @return This object (for method chaining).
*/
public final Textarea dirname(String dirname) {
@@ -70,7 +70,7 @@ public class Textarea extends HtmlElementText {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fe-disabled">disabled</a> attribute.
* Whether the form control is disabled.
- * @param disabled - The new value for this attribute.
+ * @param disabled The new value for this attribute.
* Typically a {@link Boolean} or {@link String}.
* @return This object (for method chaining).
*/
@@ -82,7 +82,7 @@ public class Textarea extends HtmlElementText {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fae-form">form</a> attribute.
* Associates the control with a form element.
- * @param form - The new value for this attribute.
+ * @param form The new value for this attribute.
* @return This object (for method chaining).
*/
public final Textarea form(String form) {
@@ -93,7 +93,7 @@ public class Textarea extends HtmlElementText {
/**
* <a class="doclink" href="-">inputmode</a> attribute.
* Hint for selecting an input modality.
- * @param inputmode - The new value for this attribute.
+ * @param inputmode The new value for this attribute.
* @return This object (for method chaining).
*/
public final Textarea inputmode(String inputmode) {
@@ -104,7 +104,7 @@ public class Textarea extends HtmlElementText {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-textarea-maxlength">maxlength</a> attribute.
* Maximum length of value.
- * @param maxlength - The new value for this attribute.
+ * @param maxlength The new value for this attribute.
* Typically a {@link Number} or {@link String}.
* @return This object (for method chaining).
*/
@@ -116,7 +116,7 @@ public class Textarea extends HtmlElementText {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-textarea-minlength">minlength</a> attribute.
* Minimum length of value.
- * @param minlength - The new value for this attribute.
+ * @param minlength The new value for this attribute.
* Typically a {@link Number} or {@link String}.
* @return This object (for method chaining).
*/
@@ -128,7 +128,7 @@ public class Textarea extends HtmlElementText {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fe-name">name</a> attribute.
* Name of form control to use for form submission and in the form.elements API.
- * @param name - The new value for this attribute.
+ * @param name The new value for this attribute.
* @return This object (for method chaining).
*/
public final Textarea name(String name) {
@@ -139,7 +139,7 @@ public class Textarea extends HtmlElementText {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-textarea-placeholder">placeholder</a> attribute.
* User-visible label to be placed within the form control.
- * @param placeholder - The new value for this attribute.
+ * @param placeholder The new value for this attribute.
* @return This object (for method chaining).
*/
public final Textarea placeholder(String placeholder) {
@@ -150,7 +150,7 @@ public class Textarea extends HtmlElementText {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-textarea-readonly">readonly</a> attribute.
* Whether to allow the value to be edited by the user.
- * @param readonly - The new value for this attribute.
+ * @param readonly The new value for this attribute.
* Typically a {@link Boolean} or {@link String}.
* @return This object (for method chaining).
*/
@@ -162,7 +162,7 @@ public class Textarea extends HtmlElementText {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-textarea-required">required</a> attribute.
* Whether the control is required for form submission.
- * @param required - The new value for this attribute.
+ * @param required The new value for this attribute.
* Typically a {@link Boolean} or {@link String}.
* @return This object (for method chaining).
*/
@@ -174,7 +174,7 @@ public class Textarea extends HtmlElementText {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-textarea-rows">rows</a> attribute.
* Number of lines to show.
- * @param rows - The new value for this attribute.
+ * @param rows The new value for this attribute.
* Typically a {@link Number} or {@link String}.
* @return This object (for method chaining).
*/
@@ -186,7 +186,7 @@ public class Textarea extends HtmlElementText {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-textarea-wrap">wrap</a> attribute.
* How the value of the form control is to be wrapped for form submission.
- * @param wrap - The new value for this attribute.
+ * @param wrap The new value for this attribute.
* @return This object (for method chaining).
*/
public final Textarea wrap(String wrap) {
@@ -194,6 +194,7 @@ public class Textarea extends HtmlElementText {
return this;
}
+
//--------------------------------------------------------------------------------
// Overridden methods
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/dto/html5/Th.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Th.java b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Th.java
index fd7fd9e..26fb2c5 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Th.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Th.java
@@ -24,7 +24,7 @@ public class Th extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/tabular-data.html#attr-th-abbr">abbr</a> attribute.
* Alternative label to use for the header cell when referencing the cell in other contexts.
- * @param abbr - The new value for this attribute.
+ * @param abbr The new value for this attribute.
* @return This object (for method chaining).
*/
public final Th abbr(String abbr) {
@@ -35,7 +35,7 @@ public class Th extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/tabular-data.html#attr-tdth-colspan">colspan</a> attribute.
* Number of columns that the cell is to span.
- * @param colspan - The new value for this attribute.
+ * @param colspan The new value for this attribute.
* Typically a {@link Number} or {@link String}.
* @return This object (for method chaining).
*/
@@ -47,7 +47,7 @@ public class Th extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/tabular-data.html#attr-tdth-headers">headers</a> attribute.
* The headers for this cell.
- * @param headers - The new value for this attribute.
+ * @param headers The new value for this attribute.
* @return This object (for method chaining).
*/
public final Th headers(String headers) {
@@ -58,7 +58,7 @@ public class Th extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/tabular-data.html#attr-tdth-rowspan">rowspan</a> attribute.
* Number of rows that the cell is to span.
- * @param rowspan - The new value for this attribute.
+ * @param rowspan The new value for this attribute.
* Typically a {@link Number} or {@link String}.
* @return This object (for method chaining).
*/
@@ -70,7 +70,7 @@ public class Th extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/tabular-data.html#attr-th-scope">scope</a> attribute.
* Specifies which cells the header cell applies to.
- * @param scope - The new value for this attribute.
+ * @param scope The new value for this attribute.
* @return This object (for method chaining).
*/
public final Th scope(String scope) {
@@ -81,7 +81,7 @@ public class Th extends HtmlElementMixed {
/**
* <a class="doclink" href="-">sorted</a> attribute.
* Column sort direction and ordinality.
- * @param sorted - The new value for this attribute.
+ * @param sorted The new value for this attribute.
* @return This object (for method chaining).
*/
public final Th sorted(String sorted) {
@@ -89,6 +89,7 @@ public class Th extends HtmlElementMixed {
return this;
}
+
//--------------------------------------------------------------------------------
// Overridden methods
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/dto/html5/Time.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Time.java b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Time.java
index b3b49fa..ce67952 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Time.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Time.java
@@ -24,7 +24,7 @@ public class Time extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/text-level-semantics.html#attr-time-datetime">datetime</a> attribute.
* Machine-readable value.
- * @param datetime - The new value for this attribute.
+ * @param datetime The new value for this attribute.
* @return This object (for method chaining).
*/
public final Time datetime(String datetime) {
@@ -32,6 +32,7 @@ public class Time extends HtmlElementMixed {
return this;
}
+
//--------------------------------------------------------------------------------
// Overridden methods
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/dto/html5/Track.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Track.java b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Track.java
index 1717e88..e3f4728 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Track.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Track.java
@@ -26,7 +26,7 @@ public class Track extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-track-default">default</a> attribute.
* Enable the track if no other text track is more suitable.
- * @param _default - The new value for this attribute.
+ * @param _default The new value for this attribute.
* @return This object (for method chaining).
*/
public final Track _default(String _default) {
@@ -37,7 +37,7 @@ public class Track extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-track-kind">kind</a> attribute.
* The type of text track.
- * @param kind - The new value for this attribute.
+ * @param kind The new value for this attribute.
* @return This object (for method chaining).
*/
public final Track kind(String kind) {
@@ -48,7 +48,7 @@ public class Track extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-track-label">label</a> attribute.
* User-visible label.
- * @param label - The new value for this attribute.
+ * @param label The new value for this attribute.
* @return This object (for method chaining).
*/
public final Track label(String label) {
@@ -59,7 +59,7 @@ public class Track extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-track-src">src</a> attribute.
* Address of the resource.
- * @param src - The new value for this attribute.
+ * @param src The new value for this attribute.
* Typically a {@link URL} or {@link String}.
* @return This object (for method chaining).
*/
@@ -71,7 +71,7 @@ public class Track extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-track-srclang">srclang</a> attribute.
* Language of the text track.
- * @param srclang - The new value for this attribute.
+ * @param srclang The new value for this attribute.
* @return This object (for method chaining).
*/
public final Track srclang(String srclang) {
@@ -79,6 +79,7 @@ public class Track extends HtmlElementEmpty {
return this;
}
+
//--------------------------------------------------------------------------------
// Overridden methods
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/dto/html5/Video.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Video.java b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Video.java
index 09ed270..0ff65bf 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Video.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Video.java
@@ -26,7 +26,7 @@ public class Video extends HtmlElementContainer {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-autoplay">autoplay</a> attribute.
* Hint that the media resource can be started automatically when the page is loaded.
- * @param autoplay - The new value for this attribute.
+ * @param autoplay The new value for this attribute.
* Typically a {@link Boolean} or {@link String}.
* @return This object (for method chaining).
*/
@@ -38,7 +38,7 @@ public class Video extends HtmlElementContainer {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-controls">controls</a> attribute.
* Show user agent controls.
- * @param controls - The new value for this attribute.
+ * @param controls The new value for this attribute.
* Typically a {@link Boolean} or {@link String}.
* @return This object (for method chaining).
*/
@@ -50,7 +50,7 @@ public class Video extends HtmlElementContainer {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-crossorigin">crossorigin</a> attribute.
* How the element handles crossorigin requests.
- * @param crossorigin - The new value for this attribute.
+ * @param crossorigin The new value for this attribute.
* @return This object (for method chaining).
*/
public final Video crossorigin(String crossorigin) {
@@ -61,7 +61,7 @@ public class Video extends HtmlElementContainer {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-dim-height">height</a> attribute.
* Vertical dimension.
- * @param height - The new value for this attribute.
+ * @param height The new value for this attribute.
* Typically a {@link Number} or {@link String}.
* @return This object (for method chaining).
*/
@@ -73,7 +73,7 @@ public class Video extends HtmlElementContainer {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-loop">loop</a> attribute.
* Whether to loop the media resource.
- * @param loop - The new value for this attribute.
+ * @param loop The new value for this attribute.
* Typically a {@link Boolean} or {@link String}.
* @return This object (for method chaining).
*/
@@ -85,7 +85,7 @@ public class Video extends HtmlElementContainer {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-mediagroup">mediagroup</a> attribute.
* Groups media elements together with an implicit MediaController.
- * @param mediagroup - The new value for this attribute.
+ * @param mediagroup The new value for this attribute.
* @return This object (for method chaining).
*/
public final Video mediagroup(String mediagroup) {
@@ -96,7 +96,7 @@ public class Video extends HtmlElementContainer {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-muted">muted</a> attribute.
* Whether to mute the media resource by default.
- * @param muted - The new value for this attribute.
+ * @param muted The new value for this attribute.
* Typically a {@link Boolean} or {@link String}.
* @return This object (for method chaining).
*/
@@ -108,7 +108,7 @@ public class Video extends HtmlElementContainer {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-video-poster">poster</a> attribute.
* Poster frame to show prior to video playback.
- * @param poster - The new value for this attribute.
+ * @param poster The new value for this attribute.
* @return This object (for method chaining).
*/
public final Video poster(String poster) {
@@ -119,7 +119,7 @@ public class Video extends HtmlElementContainer {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-preload">preload</a> attribute.
* Hints how much buffering the media resource will likely need.
- * @param preload - The new value for this attribute.
+ * @param preload The new value for this attribute.
* @return This object (for method chaining).
*/
public final Video preload(String preload) {
@@ -130,7 +130,7 @@ public class Video extends HtmlElementContainer {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-src">src</a> attribute.
* Address of the resource.
- * @param src - The new value for this attribute.
+ * @param src The new value for this attribute.
* Typically a {@link URL} or {@link String}.
* @return This object (for method chaining).
*/
@@ -142,7 +142,7 @@ public class Video extends HtmlElementContainer {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-dim-width">width</a> attribute.
* Horizontal dimension.
- * @param width - The new value for this attribute.
+ * @param width The new value for this attribute.
* Typically a {@link Number} or {@link String}.
* @return This object (for method chaining).
*/
@@ -151,6 +151,7 @@ public class Video extends HtmlElementContainer {
return this;
}
+
//--------------------------------------------------------------------------------
// Overridden methods
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/dto/jsonschema/Schema.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/jsonschema/Schema.java b/juneau-core/src/main/java/org/apache/juneau/dto/jsonschema/Schema.java
index 6418c62..f3a8eee 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/jsonschema/Schema.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/jsonschema/Schema.java
@@ -80,6 +80,7 @@ public class Schema {
*/
public Schema() {}
+
//--------------------------------------------------------------------------------
// Bean properties
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/encoders/EncoderGroup.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/encoders/EncoderGroup.java b/juneau-core/src/main/java/org/apache/juneau/encoders/EncoderGroup.java
index a40a93a..5f148d2 100644
--- a/juneau-core/src/main/java/org/apache/juneau/encoders/EncoderGroup.java
+++ b/juneau-core/src/main/java/org/apache/juneau/encoders/EncoderGroup.java
@@ -64,7 +64,7 @@ public final class EncoderGroup extends Lockable {
/**
* Adds the specified encoder to the beginning of this group.
*
- * @param e - The encoder to add to this group.
+ * @param e The encoder to add to this group.
* @return This object (for method chaining).
*/
public EncoderGroup append(Encoder e) {
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/html/HtmlDocSerializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/html/HtmlDocSerializer.java b/juneau-core/src/main/java/org/apache/juneau/html/HtmlDocSerializer.java
index ce1ec10..692357d 100644
--- a/juneau-core/src/main/java/org/apache/juneau/html/HtmlDocSerializer.java
+++ b/juneau-core/src/main/java/org/apache/juneau/html/HtmlDocSerializer.java
@@ -56,6 +56,7 @@ public class HtmlDocSerializer extends HtmlStrippedDocSerializer {
/** Default serializer, all default settings. */
public static final HtmlDocSerializer DEFAULT = new HtmlDocSerializer().lock();
+
//--------------------------------------------------------------------------------
// Overridden methods
//--------------------------------------------------------------------------------
@@ -164,53 +165,501 @@ public class HtmlDocSerializer extends HtmlStrippedDocSerializer {
return false;
}
+
//--------------------------------------------------------------------------------
- // Overridden methods
+ // Properties
//--------------------------------------------------------------------------------
+ @Override /* HtmlSerializer */
+ public HtmlDocSerializer setUriAnchorText(String value) throws LockedException {
+ super.setUriAnchorText(value);
+ return this;
+ }
+
+ @Override /* HtmlSerializer */
+ public HtmlDocSerializer setDetectLinksInStrings(boolean value) throws LockedException {
+ super.setDetectLinksInStrings(value);
+ return this;
+ }
+
+ @Override /* HtmlSerializer */
+ public HtmlDocSerializer setLookForLabelParameters(boolean value) throws LockedException {
+ super.setLookForLabelParameters(value);
+ return this;
+ }
+
+ @Override /* HtmlSerializer */
+ public HtmlDocSerializer setLabelParameter(String value) throws LockedException {
+ super.setLabelParameter(value);
+ return this;
+ }
+
+ @Override /* HtmlSerializer */
+ public HtmlDocSerializer setAddKeyValueTableHeaders(boolean value) throws LockedException {
+ super.setAddKeyValueTableHeaders(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public HtmlDocSerializer setMaxDepth(int value) throws LockedException {
+ super.setMaxDepth(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public HtmlDocSerializer setInitialDepth(int value) throws LockedException {
+ super.setInitialDepth(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public HtmlDocSerializer setDetectRecursions(boolean value) throws LockedException {
+ super.setDetectRecursions(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public HtmlDocSerializer setIgnoreRecursions(boolean value) throws LockedException {
+ super.setIgnoreRecursions(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public HtmlDocSerializer setUseIndentation(boolean value) throws LockedException {
+ super.setUseIndentation(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public HtmlDocSerializer setAddBeanTypeProperties(boolean value) throws LockedException {
+ super.setAddBeanTypeProperties(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public HtmlDocSerializer setQuoteChar(char value) throws LockedException {
+ super.setQuoteChar(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public HtmlDocSerializer setTrimNullProperties(boolean value) throws LockedException {
+ super.setTrimNullProperties(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public HtmlDocSerializer setTrimEmptyCollections(boolean value) throws LockedException {
+ super.setTrimEmptyCollections(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public HtmlDocSerializer setTrimEmptyMaps(boolean value) throws LockedException {
+ super.setTrimEmptyMaps(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public HtmlDocSerializer setTrimStrings(boolean value) throws LockedException {
+ super.setTrimStrings(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public HtmlDocSerializer setRelativeUriBase(String value) throws LockedException {
+ super.setRelativeUriBase(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public HtmlDocSerializer setAbsolutePathUriBase(String value) throws LockedException {
+ super.setAbsolutePathUriBase(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public HtmlDocSerializer setSortCollections(boolean value) throws LockedException {
+ super.setSortCollections(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public HtmlDocSerializer setSortMaps(boolean value) throws LockedException {
+ super.setSortMaps(value);
+ return this;
+ }
+
@Override /* CoreApi */
- public HtmlDocSerializer setProperty(String property, Object value) throws LockedException {
- super.setProperty(property, value);
+ public HtmlDocSerializer setBeansRequireDefaultConstructor(boolean value) throws LockedException {
+ super.setBeansRequireDefaultConstructor(value);
return this;
}
@Override /* CoreApi */
- public HtmlDocSerializer setProperties(ObjectMap properties) throws LockedException {
- super.setProperties(properties);
+ public HtmlDocSerializer setBeansRequireSerializable(boolean value) throws LockedException {
+ super.setBeansRequireSerializable(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlDocSerializer setBeansRequireSettersForGetters(boolean value) throws LockedException {
+ super.setBeansRequireSettersForGetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlDocSerializer setBeansRequireSomeProperties(boolean value) throws LockedException {
+ super.setBeansRequireSomeProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlDocSerializer setBeanMapPutReturnsOldValue(boolean value) throws LockedException {
+ super.setBeanMapPutReturnsOldValue(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlDocSerializer setBeanConstructorVisibility(Visibility value) throws LockedException {
+ super.setBeanConstructorVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlDocSerializer setBeanClassVisibility(Visibility value) throws LockedException {
+ super.setBeanClassVisibility(value);
return this;
}
@Override /* CoreApi */
- public HtmlDocSerializer addNotBeanClasses(Class<?>...classes) throws LockedException {
- super.addNotBeanClasses(classes);
+ public HtmlDocSerializer setBeanFieldVisibility(Visibility value) throws LockedException {
+ super.setBeanFieldVisibility(value);
return this;
}
@Override /* CoreApi */
- public HtmlDocSerializer addBeanFilters(Class<?>...classes) throws LockedException {
- super.addBeanFilters(classes);
+ public HtmlDocSerializer setMethodVisibility(Visibility value) throws LockedException {
+ super.setMethodVisibility(value);
return this;
}
@Override /* CoreApi */
- public HtmlDocSerializer addPojoSwaps(Class<?>...classes) throws LockedException {
- super.addPojoSwaps(classes);
+ public HtmlDocSerializer setUseJavaBeanIntrospector(boolean value) throws LockedException {
+ super.setUseJavaBeanIntrospector(value);
return this;
}
@Override /* CoreApi */
- public HtmlDocSerializer addToDictionary(Class<?>...classes) throws LockedException {
- super.addToDictionary(classes);
+ public HtmlDocSerializer setUseInterfaceProxies(boolean value) throws LockedException {
+ super.setUseInterfaceProxies(value);
return this;
}
@Override /* CoreApi */
- public <T> HtmlDocSerializer addImplClass(Class<T> interfaceClass, Class<? extends T> implClass) throws LockedException {
+ public HtmlDocSerializer setIgnoreUnknownBeanProperties(boolean value) throws LockedException {
+ super.setIgnoreUnknownBeanProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlDocSerializer setIgnoreUnknownNullBeanProperties(boolean value) throws LockedException {
+ super.setIgnoreUnknownNullBeanProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlDocSerializer setIgnorePropertiesWithoutSetters(boolean value) throws LockedException {
+ super.setIgnorePropertiesWithoutSetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlDocSerializer setIgnoreInvocationExceptionsOnGetters(boolean value) throws LockedException {
+ super.setIgnoreInvocationExceptionsOnGetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlDocSerializer setIgnoreInvocationExceptionsOnSetters(boolean value) throws LockedException {
+ super.setIgnoreInvocationExceptionsOnSetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlDocSerializer setSortProperties(boolean value) throws LockedException {
+ super.setSortProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlDocSerializer setNotBeanPackages(String...values) throws LockedException {
+ super.setNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlDocSerializer setNotBeanPackages(Collection<String> values) throws LockedException {
+ super.setNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlDocSerializer addNotBeanPackages(String...values) throws LockedException {
+ super.addNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlDocSerializer addNotBeanPackages(Collection<String> values) throws LockedException {
+ super.addNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlDocSerializer removeNotBeanPackages(String...values) throws LockedException {
+ super.removeNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlDocSerializer removeNotBeanPackages(Collection<String> values) throws LockedException {
+ super.removeNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlDocSerializer setNotBeanClasses(Class<?>...values) throws LockedException {
+ super.setNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlDocSerializer setNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ super.setNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlDocSerializer addNotBeanClasses(Class<?>...values) throws LockedException {
+ super.addNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlDocSerializer addNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ super.addNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlDocSerializer removeNotBeanClasses(Class<?>...values) throws LockedException {
+ super.removeNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlDocSerializer removeNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ super.removeNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlDocSerializer setBeanFilters(Class<?>...values) throws LockedException {
+ super.setBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlDocSerializer setBeanFilters(Collection<Class<?>> values) throws LockedException {
+ super.setBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlDocSerializer addBeanFilters(Class<?>...values) throws LockedException {
+ super.addBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlDocSerializer addBeanFilters(Collection<Class<?>> values) throws LockedException {
+ super.addBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlDocSerializer removeBeanFilters(Class<?>...values) throws LockedException {
+ super.removeBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlDocSerializer removeBeanFilters(Collection<Class<?>> values) throws LockedException {
+ super.removeBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlDocSerializer setPojoSwaps(Class<?>...values) throws LockedException {
+ super.setPojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlDocSerializer setPojoSwaps(Collection<Class<?>> values) throws LockedException {
+ super.setPojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlDocSerializer addPojoSwaps(Class<?>...values) throws LockedException {
+ super.addPojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlDocSerializer addPojoSwaps(Collection<Class<?>> values) throws LockedException {
+ super.addPojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlDocSerializer removePojoSwaps(Class<?>...values) throws LockedException {
+ super.removePojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlDocSerializer removePojoSwaps(Collection<Class<?>> values) throws LockedException {
+ super.removePojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlDocSerializer setImplClasses(Map<Class<?>,Class<?>> values) throws LockedException {
+ super.setImplClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public <T> CoreApi addImplClass(Class<T> interfaceClass, Class<? extends T> implClass) throws LockedException {
super.addImplClass(interfaceClass, implClass);
return this;
}
@Override /* CoreApi */
+ public HtmlDocSerializer setBeanDictionary(Class<?>...values) throws LockedException {
+ super.setBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlDocSerializer setBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ super.setBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlDocSerializer addToBeanDictionary(Class<?>...values) throws LockedException {
+ super.addToBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlDocSerializer addToBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ super.addToBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlDocSerializer removeFromBeanDictionary(Class<?>...values) throws LockedException {
+ super.removeFromBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlDocSerializer removeFromBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ super.removeFromBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlDocSerializer setBeanTypePropertyName(String value) throws LockedException {
+ super.setBeanTypePropertyName(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlDocSerializer setDefaultParser(Class<?> value) throws LockedException {
+ super.setDefaultParser(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlDocSerializer setLocale(Locale value) throws LockedException {
+ super.setLocale(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlDocSerializer setTimeZone(TimeZone value) throws LockedException {
+ super.setTimeZone(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlDocSerializer setMediaType(MediaType value) throws LockedException {
+ super.setMediaType(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlDocSerializer setDebug(boolean value) throws LockedException {
+ super.setDebug(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlDocSerializer setProperty(String name, Object value) throws LockedException {
+ super.setProperty(name, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlDocSerializer setProperties(ObjectMap properties) throws LockedException {
+ super.setProperties(properties);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlDocSerializer addToProperty(String name, Object value) throws LockedException {
+ super.addToProperty(name, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlDocSerializer putToProperty(String name, Object key, Object value) throws LockedException {
+ super.putToProperty(name, key, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlDocSerializer putToProperty(String name, Object value) throws LockedException {
+ super.putToProperty(name, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public HtmlDocSerializer removeFromProperty(String name, Object value) throws LockedException {
+ super.removeFromProperty(name, value);
+ return this;
+ }
+
+ // Overridden methods
+ //--------------------------------------------------------------------------------
+
+ @Override /* CoreApi */
public HtmlDocSerializer setClassLoader(ClassLoader classLoader) throws LockedException {
super.setClassLoader(classLoader);
return this;
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/html/HtmlDocSerializerContext.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/html/HtmlDocSerializerContext.java b/juneau-core/src/main/java/org/apache/juneau/html/HtmlDocSerializerContext.java
index 64d8e3a..57f10db 100644
--- a/juneau-core/src/main/java/org/apache/juneau/html/HtmlDocSerializerContext.java
+++ b/juneau-core/src/main/java/org/apache/juneau/html/HtmlDocSerializerContext.java
@@ -40,53 +40,6 @@ import org.apache.juneau.*;
* Several built-in runtime variable types are defined, and the API can be extended to include user-defined variables.
* </p>
*
- * <h6 class='topic' id='ConfigProperties'>Configurable properties on the HTML document serializer</h6>
- * <table class='styled' style='border-collapse: collapse;'>
- * <tr><th>Setting name</th><th>Description</th><th>Data type</th><th>Default value</th><th>Session overridable</th></tr>
- * <tr>
- * <td>{@link #HTMLDOC_title}</td>
- * <td>Page title.</td>
- * <td><code>String</code></td>
- * <td><jk>null</jk></td>
- * <td><jk>true</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #HTMLDOC_description}</td>
- * <td>Page description.</td>
- * <td><code>String</code></td>
- * <td><jk>null</jk></td>
- * <td><jk>true</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #HTMLDOC_links}<br>{@link #HTMLDOC_links_put}</td>
- * <td>Page links.</td>
- * <td><code>Map<String,String></code></td>
- * <td>empty map</td>
- * <td><jk>true</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #HTMLDOC_cssUrl}</td>
- * <td>Stylesheet URL.</td>
- * <td><code>String</code></td>
- * <td><js>"style.css"</js></td>
- * <td><jk>true</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #HTMLDOC_cssImports}<br>{@link #HTMLDOC_cssImports_add}</td>
- * <td>CSS imports.</td>
- * <td><code>List<String></code></td>
- * <td>empty list</td>
- * <td><jk>true</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #HTMLDOC_nowrap}</td>
- * <td>Prevent word wrap on page.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>false</jk></td>
- * <td><jk>true</jk></td>
- * </tr>
- * </table>
- *
* <h5 class='section'>Inherited configurable properties:</h5>
* <ul class='javahierarchy'>
* <li class='c'><a class="doclink" href="../BeanContext.html#ConfigProperties">BeanContext</a> - Properties associated with handling beans on serializers and parsers.
[06/14] incubator-juneau git commit: Add convenience property setters
to serializers and parsers.
Posted by ja...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/json/JsonSerializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/json/JsonSerializer.java b/juneau-core/src/main/java/org/apache/juneau/json/JsonSerializer.java
index d5c2b3f..07121d3 100644
--- a/juneau-core/src/main/java/org/apache/juneau/json/JsonSerializer.java
+++ b/juneau-core/src/main/java/org/apache/juneau/json/JsonSerializer.java
@@ -76,12 +76,12 @@ import org.apache.juneau.transform.*;
*
* <jc>// Create a custom serializer for lax syntax using single quote characters</jc>
* JsonSerializer serializer = <jk>new</jk> JsonSerializer()
- * .setProperty(JsonSerializerContext.<jsf>JSON_simpleMode</jsf>, <jk>true</jk>)
- * .setProperty(SerializerContext.<jsf>SERIALIZER_quoteChar</jsf>, <js>'\''</js>);
+ * .setSimpleMode(<jk>true</jk>)
+ * .setQuoteChar(<js>'\''</js>);
*
* <jc>// Clone an existing serializer and modify it to use single-quotes</jc>
* JsonSerializer serializer = JsonSerializer.<jsf>DEFAULT</jsf>.clone()
- * .setProperty(SerializerContext.<jsf>SERIALIZER_quoteChar</jsf>, <js>'\''</js>);
+ * .setQuoteChar(<js>'\''</js>);
*
* <jc>// Serialize a POJO to JSON</jc>
* String json = serializer.serialize(someObject);
@@ -112,8 +112,8 @@ public class JsonSerializer extends WriterSerializer {
public static class Readable extends JsonSerializer {
/** Constructor */
public Readable() {
- setProperty(JSON_useWhitespace, true);
- setProperty(SERIALIZER_useIndentation, true);
+ setUseWhitespace(true);
+ setUseIndentation(true);
}
}
@@ -122,8 +122,8 @@ public class JsonSerializer extends WriterSerializer {
public static class Simple extends JsonSerializer {
/** Constructor */
public Simple() {
- setProperty(JSON_simpleMode, true);
- setProperty(SERIALIZER_quoteChar, '\'');
+ setSimpleMode(true);
+ setQuoteChar('\'');
}
}
@@ -131,8 +131,8 @@ public class JsonSerializer extends WriterSerializer {
public static class SimpleReadable extends Simple {
/** Constructor */
public SimpleReadable() {
- setProperty(JSON_useWhitespace, true);
- setProperty(SERIALIZER_useIndentation, true);
+ setUseWhitespace(true);
+ setUseIndentation(true);
}
}
@@ -143,7 +143,7 @@ public class JsonSerializer extends WriterSerializer {
public static class SimpleReadableSafe extends SimpleReadable {
/** Constructor */
public SimpleReadableSafe() {
- setProperty(SERIALIZER_detectRecursions, true);
+ setDetectRecursions(true);
}
}
@@ -324,8 +324,9 @@ public class JsonSerializer extends WriterSerializer {
return s;
}
+
//--------------------------------------------------------------------------------
- // Overridden methods
+ // Entry point methods
//--------------------------------------------------------------------------------
@Override /* Serializer */
@@ -339,49 +340,554 @@ public class JsonSerializer extends WriterSerializer {
serializeAnything(s, s.getWriter(), o, null, "root", null);
}
+
+ //--------------------------------------------------------------------------------
+ // Properties
+ //--------------------------------------------------------------------------------
+
+ /**
+ * <b>Configuration property:</b> Simple JSON mode.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"JsonSerializer.simpleMode"</js>
+ * <li><b>Data type:</b> <code>Boolean</code>
+ * <li><b>Default:</b> <jk>false</jk>
+ * <li><b>Session-overridable:</b> <jk>true</jk>
+ * </ul>
+ * <p>
+ * If <jk>true</jk>, JSON attribute names will only be quoted when necessary.
+ * Otherwise, they are always quoted.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>JSON_simpleMode</jsf>, value)</code>.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see JsonSerializerContext#JSON_simpleMode
+ */
+ public JsonSerializer setSimpleMode(boolean value) throws LockedException {
+ return setProperty(JSON_simpleMode, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> Use whitespace.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"JsonSerializer.useWhitespace"</js>
+ * <li><b>Data type:</b> <code>Boolean</code>
+ * <li><b>Default:</b> <jk>false</jk>
+ * <li><b>Session-overridable:</b> <jk>true</jk>
+ * </ul>
+ * <p>
+ * If <jk>true</jk>, whitespace is added to the output to improve readability.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>JSON_useWhitespace</jsf>, value)</code>.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see JsonSerializerContext#JSON_useWhitespace
+ */
+ public JsonSerializer setUseWhitespace(boolean value) throws LockedException {
+ return setProperty(JSON_useWhitespace, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> Prefix solidus <js>'/'</js> characters with escapes.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"JsonSerializer.escapeSolidus"</js>
+ * <li><b>Data type:</b> <code>Boolean</code>
+ * <li><b>Default:</b> <jk>false</jk>
+ * <li><b>Session-overridable:</b> <jk>true</jk>
+ * </ul>
+ * <p>
+ * If <jk>true</jk>, solidus (e.g. slash) characters should be escaped.
+ * The JSON specification allows for either format.
+ * However, if you're embedding JSON in an HTML script tag, this setting prevents
+ * confusion when trying to serialize <xt><\/script></xt>.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>JSON_escapeSolidus</jsf>, value)</code>.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see JsonSerializerContext#JSON_escapeSolidus
+ */
+ public JsonSerializer setEscapeSolidus(boolean value) throws LockedException {
+ return setProperty(JSON_escapeSolidus, value);
+ }
+
+ @Override /* Serializer */
+ public JsonSerializer setMaxDepth(int value) throws LockedException {
+ super.setMaxDepth(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public JsonSerializer setInitialDepth(int value) throws LockedException {
+ super.setInitialDepth(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public JsonSerializer setDetectRecursions(boolean value) throws LockedException {
+ super.setDetectRecursions(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public JsonSerializer setIgnoreRecursions(boolean value) throws LockedException {
+ super.setIgnoreRecursions(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public JsonSerializer setUseIndentation(boolean value) throws LockedException {
+ super.setUseIndentation(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public JsonSerializer setAddBeanTypeProperties(boolean value) throws LockedException {
+ super.setAddBeanTypeProperties(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public JsonSerializer setQuoteChar(char value) throws LockedException {
+ super.setQuoteChar(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public JsonSerializer setTrimNullProperties(boolean value) throws LockedException {
+ super.setTrimNullProperties(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public JsonSerializer setTrimEmptyCollections(boolean value) throws LockedException {
+ super.setTrimEmptyCollections(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public JsonSerializer setTrimEmptyMaps(boolean value) throws LockedException {
+ super.setTrimEmptyMaps(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public JsonSerializer setTrimStrings(boolean value) throws LockedException {
+ super.setTrimStrings(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public JsonSerializer setRelativeUriBase(String value) throws LockedException {
+ super.setRelativeUriBase(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public JsonSerializer setAbsolutePathUriBase(String value) throws LockedException {
+ super.setAbsolutePathUriBase(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public JsonSerializer setSortCollections(boolean value) throws LockedException {
+ super.setSortCollections(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public JsonSerializer setSortMaps(boolean value) throws LockedException {
+ super.setSortMaps(value);
+ return this;
+ }
@Override /* CoreApi */
- public JsonSerializer setProperty(String property, Object value) throws LockedException {
- super.setProperty(property, value);
+ public JsonSerializer setBeansRequireDefaultConstructor(boolean value) throws LockedException {
+ super.setBeansRequireDefaultConstructor(value);
return this;
}
@Override /* CoreApi */
- public JsonSerializer setProperties(ObjectMap properties) throws LockedException {
- super.setProperties(properties);
+ public JsonSerializer setBeansRequireSerializable(boolean value) throws LockedException {
+ super.setBeansRequireSerializable(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonSerializer setBeansRequireSettersForGetters(boolean value) throws LockedException {
+ super.setBeansRequireSettersForGetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonSerializer setBeansRequireSomeProperties(boolean value) throws LockedException {
+ super.setBeansRequireSomeProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonSerializer setBeanMapPutReturnsOldValue(boolean value) throws LockedException {
+ super.setBeanMapPutReturnsOldValue(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonSerializer setBeanConstructorVisibility(Visibility value) throws LockedException {
+ super.setBeanConstructorVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonSerializer setBeanClassVisibility(Visibility value) throws LockedException {
+ super.setBeanClassVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonSerializer setBeanFieldVisibility(Visibility value) throws LockedException {
+ super.setBeanFieldVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonSerializer setMethodVisibility(Visibility value) throws LockedException {
+ super.setMethodVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonSerializer setUseJavaBeanIntrospector(boolean value) throws LockedException {
+ super.setUseJavaBeanIntrospector(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonSerializer setUseInterfaceProxies(boolean value) throws LockedException {
+ super.setUseInterfaceProxies(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonSerializer setIgnoreUnknownBeanProperties(boolean value) throws LockedException {
+ super.setIgnoreUnknownBeanProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonSerializer setIgnoreUnknownNullBeanProperties(boolean value) throws LockedException {
+ super.setIgnoreUnknownNullBeanProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonSerializer setIgnorePropertiesWithoutSetters(boolean value) throws LockedException {
+ super.setIgnorePropertiesWithoutSetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonSerializer setIgnoreInvocationExceptionsOnGetters(boolean value) throws LockedException {
+ super.setIgnoreInvocationExceptionsOnGetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonSerializer setIgnoreInvocationExceptionsOnSetters(boolean value) throws LockedException {
+ super.setIgnoreInvocationExceptionsOnSetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonSerializer setSortProperties(boolean value) throws LockedException {
+ super.setSortProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonSerializer setNotBeanPackages(String...values) throws LockedException {
+ super.setNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonSerializer setNotBeanPackages(Collection<String> values) throws LockedException {
+ super.setNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonSerializer addNotBeanPackages(String...values) throws LockedException {
+ super.addNotBeanPackages(values);
return this;
}
@Override /* CoreApi */
- public JsonSerializer addNotBeanClasses(Class<?>...classes) throws LockedException {
- super.addNotBeanClasses(classes);
+ public JsonSerializer addNotBeanPackages(Collection<String> values) throws LockedException {
+ super.addNotBeanPackages(values);
return this;
}
@Override /* CoreApi */
- public JsonSerializer addBeanFilters(Class<?>...classes) throws LockedException {
- super.addBeanFilters(classes);
+ public JsonSerializer removeNotBeanPackages(String...values) throws LockedException {
+ super.removeNotBeanPackages(values);
return this;
}
@Override /* CoreApi */
- public JsonSerializer addPojoSwaps(Class<?>...classes) throws LockedException {
- super.addPojoSwaps(classes);
+ public JsonSerializer removeNotBeanPackages(Collection<String> values) throws LockedException {
+ super.removeNotBeanPackages(values);
return this;
}
@Override /* CoreApi */
- public JsonSerializer addToDictionary(Class<?>...classes) throws LockedException {
- super.addToDictionary(classes);
+ public JsonSerializer setNotBeanClasses(Class<?>...values) throws LockedException {
+ super.setNotBeanClasses(values);
return this;
}
@Override /* CoreApi */
- public <T> JsonSerializer addImplClass(Class<T> interfaceClass, Class<? extends T> implClass) throws LockedException {
+ public JsonSerializer setNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ super.setNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonSerializer addNotBeanClasses(Class<?>...values) throws LockedException {
+ super.addNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonSerializer addNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ super.addNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonSerializer removeNotBeanClasses(Class<?>...values) throws LockedException {
+ super.removeNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonSerializer removeNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ super.removeNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonSerializer setBeanFilters(Class<?>...values) throws LockedException {
+ super.setBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonSerializer setBeanFilters(Collection<Class<?>> values) throws LockedException {
+ super.setBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonSerializer addBeanFilters(Class<?>...values) throws LockedException {
+ super.addBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonSerializer addBeanFilters(Collection<Class<?>> values) throws LockedException {
+ super.addBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonSerializer removeBeanFilters(Class<?>...values) throws LockedException {
+ super.removeBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonSerializer removeBeanFilters(Collection<Class<?>> values) throws LockedException {
+ super.removeBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonSerializer setPojoSwaps(Class<?>...values) throws LockedException {
+ super.setPojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonSerializer setPojoSwaps(Collection<Class<?>> values) throws LockedException {
+ super.setPojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonSerializer addPojoSwaps(Class<?>...values) throws LockedException {
+ super.addPojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonSerializer addPojoSwaps(Collection<Class<?>> values) throws LockedException {
+ super.addPojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonSerializer removePojoSwaps(Class<?>...values) throws LockedException {
+ super.removePojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonSerializer removePojoSwaps(Collection<Class<?>> values) throws LockedException {
+ super.removePojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonSerializer setImplClasses(Map<Class<?>,Class<?>> values) throws LockedException {
+ super.setImplClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public <T> CoreApi addImplClass(Class<T> interfaceClass, Class<? extends T> implClass) throws LockedException {
super.addImplClass(interfaceClass, implClass);
return this;
}
@Override /* CoreApi */
+ public JsonSerializer setBeanDictionary(Class<?>...values) throws LockedException {
+ super.setBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonSerializer setBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ super.setBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonSerializer addToBeanDictionary(Class<?>...values) throws LockedException {
+ super.addToBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonSerializer addToBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ super.addToBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonSerializer removeFromBeanDictionary(Class<?>...values) throws LockedException {
+ super.removeFromBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonSerializer removeFromBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ super.removeFromBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonSerializer setBeanTypePropertyName(String value) throws LockedException {
+ super.setBeanTypePropertyName(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonSerializer setDefaultParser(Class<?> value) throws LockedException {
+ super.setDefaultParser(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonSerializer setLocale(Locale value) throws LockedException {
+ super.setLocale(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonSerializer setTimeZone(TimeZone value) throws LockedException {
+ super.setTimeZone(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonSerializer setMediaType(MediaType value) throws LockedException {
+ super.setMediaType(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonSerializer setDebug(boolean value) throws LockedException {
+ super.setDebug(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonSerializer setProperty(String name, Object value) throws LockedException {
+ super.setProperty(name, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonSerializer setProperties(ObjectMap properties) throws LockedException {
+ super.setProperties(properties);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonSerializer addToProperty(String name, Object value) throws LockedException {
+ super.addToProperty(name, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonSerializer putToProperty(String name, Object key, Object value) throws LockedException {
+ super.putToProperty(name, key, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonSerializer putToProperty(String name, Object value) throws LockedException {
+ super.putToProperty(name, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public JsonSerializer removeFromProperty(String name, Object value) throws LockedException {
+ super.removeFromProperty(name, value);
+ return this;
+ }
+
+
+ //--------------------------------------------------------------------------------
+ // Overridden methods
+ //--------------------------------------------------------------------------------
+
+ @Override /* CoreApi */
public JsonSerializer setClassLoader(ClassLoader classLoader) throws LockedException {
super.setClassLoader(classLoader);
return this;
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/json/JsonSerializerContext.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/json/JsonSerializerContext.java b/juneau-core/src/main/java/org/apache/juneau/json/JsonSerializerContext.java
index c4a62cd..eec89c8 100644
--- a/juneau-core/src/main/java/org/apache/juneau/json/JsonSerializerContext.java
+++ b/juneau-core/src/main/java/org/apache/juneau/json/JsonSerializerContext.java
@@ -21,45 +21,8 @@ import org.apache.juneau.serializer.*;
* Context properties are set by calling {@link ContextFactory#setProperty(String, Object)} on the context factory
* returned {@link CoreApi#getContextFactory()}.
* <p>
- * The following convenience methods are also provided for setting context properties:
- * <ul>
- * <li>{@link JsonSerializer#setProperty(String,Object)}
- * <li>{@link JsonSerializer#setProperties(ObjectMap)}
- * <li>{@link JsonSerializer#addNotBeanClasses(Class[])}
- * <li>{@link JsonSerializer#addBeanFilters(Class[])}
- * <li>{@link JsonSerializer#addPojoSwaps(Class[])}
- * <li>{@link JsonSerializer#addToDictionary(Class[])}
- * <li>{@link JsonSerializer#addImplClass(Class,Class)}
- * </ul>
- * <p>
* See {@link ContextFactory} for more information about context properties.
*
- * <h6 class='topic' id='ConfigProperties'>Configurable properties on the JSON serializer</h6>
- * <table class='styled' style='border-collapse: collapse;'>
- * <tr><th>Setting name</th><th>Description</th><th>Data type</th><th>Default value</th><th>Session overridable</th></tr>
- * <tr>
- * <td>{@link #JSON_simpleMode}</td>
- * <td>Simple JSON mode.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>false</jk></td>
- * <td><jk>true</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #JSON_useWhitespace}</td>
- * <td>Use whitespace.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>false</jk></td>
- * <td><jk>true</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #JSON_escapeSolidus}</td>
- * <td>Prefix solidus <js>'/'</js> characters with escapes.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>false</jk></td>
- * <td><jk>true</jk></td>
- * </tr>
- * </table>
- *
* <h5 class='section'>Inherited configurable properties:</h5>
* <ul class='javahierarchy'>
* <li class='c'><a class="doclink" href="../BeanContext.html#ConfigProperties">BeanContext</a> - Properties associated with handling beans on serializers and parsers.
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/json/JsonWriter.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/json/JsonWriter.java b/juneau-core/src/main/java/org/apache/juneau/json/JsonWriter.java
index 374cf94..4b3af99 100644
--- a/juneau-core/src/main/java/org/apache/juneau/json/JsonWriter.java
+++ b/juneau-core/src/main/java/org/apache/juneau/json/JsonWriter.java
@@ -176,6 +176,7 @@ public final class JsonWriter extends SerializerWriter {
return this;
}
+
//--------------------------------------------------------------------------------
// Overridden methods
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/json/package.html
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/json/package.html b/juneau-core/src/main/java/org/apache/juneau/json/package.html
index 1131613..bb0d4c3 100644
--- a/juneau-core/src/main/java/org/apache/juneau/json/package.html
+++ b/juneau-core/src/main/java/org/apache/juneau/json/package.html
@@ -277,10 +277,10 @@
</p>
<p class='bcode'>
JsonSerializer s = <jk>new</jk> JsonSerializer()
- .setProperty(SerializerContext.<jsf>SERIALIZER_useIndentation</jsf>, <jk>true</jk>)
- .setProperty(JsonSerializerContext.<jsf>JSON_useWhitespace</jsf>, <jk>true</jk>)
- .setProperty(JsonSerializerContext.<jsf>JSON_simpleMode</jsf>, <jk>true</jk>)
- .setProperty(SerializerContext.<jsf>SERIALIZER_quoteChar</jsf>, <js>'\''</js>);
+ .setUseIndentation(<jk>true</jk>)
+ .setUseWhitespace(<jk>true</jk>)
+ .setSimpleMode(<jk>true</jk>)
+ .setQuoteChar(<js>'\''</js>);
</p>
<p>
@@ -648,7 +648,7 @@
</p>
<p class='bcode'>
<jc>// Clone an existing serializer and set property for detecting recursions.</jc>
- JsonSerializer s = JsonSerializer.<jsf>DEFAULT_LAX_READABLE</jsf>.clone().setProperty(SerializerContext.<jsf>SERIALIZER_detectRecursions</jsf>, <jk>true</jk>);
+ JsonSerializer s = JsonSerializer.<jsf>DEFAULT_LAX_READABLE</jsf>.clone().setDetectRecursions(<jk>true</jk>);
<jc>// Create a recursive loop.</jc>
A a = <jk>new</jk> A();
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/msgpack/MsgPackParser.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/msgpack/MsgPackParser.java b/juneau-core/src/main/java/org/apache/juneau/msgpack/MsgPackParser.java
index 9113093..0b15adc 100644
--- a/juneau-core/src/main/java/org/apache/juneau/msgpack/MsgPackParser.java
+++ b/juneau-core/src/main/java/org/apache/juneau/msgpack/MsgPackParser.java
@@ -18,7 +18,6 @@ import java.lang.reflect.*;
import java.util.*;
import org.apache.juneau.*;
-import org.apache.juneau.MediaType;
import org.apache.juneau.annotation.*;
import org.apache.juneau.parser.*;
import org.apache.juneau.transform.*;
@@ -181,8 +180,9 @@ public final class MsgPackParser extends InputStreamParser {
return (T)o;
}
+
//--------------------------------------------------------------------------------
- // Overridden methods
+ // Entry point methods
//--------------------------------------------------------------------------------
@Override /* Parser */
@@ -198,50 +198,408 @@ public final class MsgPackParser extends InputStreamParser {
return o;
}
+
+ //--------------------------------------------------------------------------------
+ // Properties
+ //--------------------------------------------------------------------------------
+
+ @Override /* Parser */
+ public Parser setTrimStrings(boolean value) throws LockedException {
+ super.setTrimStrings(value);
+ return this;
+ }
+
+ @Override /* Parser */
+ public Parser setStrict(boolean value) throws LockedException {
+ super.setStrict(value);
+ return this;
+ }
+
@Override /* Parser */
- public MsgPackParser setProperty(String property, Object value) throws LockedException {
- super.setProperty(property, value);
+ public Parser setInputStreamCharset(String value) throws LockedException {
+ super.setInputStreamCharset(value);
+ return this;
+ }
+
+ @Override /* Parser */
+ public Parser setFileCharset(String value) throws LockedException {
+ super.setFileCharset(value);
return this;
}
@Override /* CoreApi */
- public MsgPackParser setProperties(ObjectMap properties) throws LockedException {
- super.setProperties(properties);
+ public Parser setBeansRequireDefaultConstructor(boolean value) throws LockedException {
+ super.setBeansRequireDefaultConstructor(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setBeansRequireSerializable(boolean value) throws LockedException {
+ super.setBeansRequireSerializable(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setBeansRequireSettersForGetters(boolean value) throws LockedException {
+ super.setBeansRequireSettersForGetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setBeansRequireSomeProperties(boolean value) throws LockedException {
+ super.setBeansRequireSomeProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setBeanMapPutReturnsOldValue(boolean value) throws LockedException {
+ super.setBeanMapPutReturnsOldValue(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setBeanConstructorVisibility(Visibility value) throws LockedException {
+ super.setBeanConstructorVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setBeanClassVisibility(Visibility value) throws LockedException {
+ super.setBeanClassVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setBeanFieldVisibility(Visibility value) throws LockedException {
+ super.setBeanFieldVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setMethodVisibility(Visibility value) throws LockedException {
+ super.setMethodVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setUseJavaBeanIntrospector(boolean value) throws LockedException {
+ super.setUseJavaBeanIntrospector(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setUseInterfaceProxies(boolean value) throws LockedException {
+ super.setUseInterfaceProxies(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setIgnoreUnknownBeanProperties(boolean value) throws LockedException {
+ super.setIgnoreUnknownBeanProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setIgnoreUnknownNullBeanProperties(boolean value) throws LockedException {
+ super.setIgnoreUnknownNullBeanProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setIgnorePropertiesWithoutSetters(boolean value) throws LockedException {
+ super.setIgnorePropertiesWithoutSetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setIgnoreInvocationExceptionsOnGetters(boolean value) throws LockedException {
+ super.setIgnoreInvocationExceptionsOnGetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setIgnoreInvocationExceptionsOnSetters(boolean value) throws LockedException {
+ super.setIgnoreInvocationExceptionsOnSetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setSortProperties(boolean value) throws LockedException {
+ super.setSortProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setNotBeanPackages(String...values) throws LockedException {
+ super.setNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setNotBeanPackages(Collection<String> values) throws LockedException {
+ super.setNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser addNotBeanPackages(String...values) throws LockedException {
+ super.addNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser addNotBeanPackages(Collection<String> values) throws LockedException {
+ super.addNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser removeNotBeanPackages(String...values) throws LockedException {
+ super.removeNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser removeNotBeanPackages(Collection<String> values) throws LockedException {
+ super.removeNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setNotBeanClasses(Class<?>...values) throws LockedException {
+ super.setNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ super.setNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser addNotBeanClasses(Class<?>...values) throws LockedException {
+ super.addNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser addNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ super.addNotBeanClasses(values);
return this;
}
@Override /* CoreApi */
- public MsgPackParser addNotBeanClasses(Class<?>...classes) throws LockedException {
- super.addNotBeanClasses(classes);
+ public Parser removeNotBeanClasses(Class<?>...values) throws LockedException {
+ super.removeNotBeanClasses(values);
return this;
}
@Override /* CoreApi */
- public MsgPackParser addBeanFilters(Class<?>...classes) throws LockedException {
- super.addBeanFilters(classes);
+ public Parser removeNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ super.removeNotBeanClasses(values);
return this;
}
@Override /* CoreApi */
- public MsgPackParser addPojoSwaps(Class<?>...classes) throws LockedException {
- super.addPojoSwaps(classes);
+ public Parser setBeanFilters(Class<?>...values) throws LockedException {
+ super.setBeanFilters(values);
return this;
}
@Override /* CoreApi */
- public MsgPackParser addToDictionary(Class<?>...classes) throws LockedException {
- super.addToDictionary(classes);
+ public Parser setBeanFilters(Collection<Class<?>> values) throws LockedException {
+ super.setBeanFilters(values);
return this;
}
@Override /* CoreApi */
- public <T> MsgPackParser addImplClass(Class<T> interfaceClass, Class<? extends T> implClass) throws LockedException {
+ public Parser addBeanFilters(Class<?>...values) throws LockedException {
+ super.addBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser addBeanFilters(Collection<Class<?>> values) throws LockedException {
+ super.addBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser removeBeanFilters(Class<?>...values) throws LockedException {
+ super.removeBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser removeBeanFilters(Collection<Class<?>> values) throws LockedException {
+ super.removeBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setPojoSwaps(Class<?>...values) throws LockedException {
+ super.setPojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setPojoSwaps(Collection<Class<?>> values) throws LockedException {
+ super.setPojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser addPojoSwaps(Class<?>...values) throws LockedException {
+ super.addPojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser addPojoSwaps(Collection<Class<?>> values) throws LockedException {
+ super.addPojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser removePojoSwaps(Class<?>...values) throws LockedException {
+ super.removePojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser removePojoSwaps(Collection<Class<?>> values) throws LockedException {
+ super.removePojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setImplClasses(Map<Class<?>,Class<?>> values) throws LockedException {
+ super.setImplClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public <T> CoreApi addImplClass(Class<T> interfaceClass, Class<? extends T> implClass) throws LockedException {
super.addImplClass(interfaceClass, implClass);
return this;
}
@Override /* CoreApi */
- public MsgPackParser setClassLoader(ClassLoader classLoader) throws LockedException {
+ public Parser setBeanDictionary(Class<?>...values) throws LockedException {
+ super.setBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ super.setBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser addToBeanDictionary(Class<?>...values) throws LockedException {
+ super.addToBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser addToBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ super.addToBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser removeFromBeanDictionary(Class<?>...values) throws LockedException {
+ super.removeFromBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser removeFromBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ super.removeFromBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setBeanTypePropertyName(String value) throws LockedException {
+ super.setBeanTypePropertyName(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setDefaultParser(Class<?> value) throws LockedException {
+ super.setDefaultParser(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setLocale(Locale value) throws LockedException {
+ super.setLocale(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setTimeZone(TimeZone value) throws LockedException {
+ super.setTimeZone(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setMediaType(MediaType value) throws LockedException {
+ super.setMediaType(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setDebug(boolean value) throws LockedException {
+ super.setDebug(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setProperty(String name, Object value) throws LockedException {
+ super.setProperty(name, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setProperties(ObjectMap properties) throws LockedException {
+ super.setProperties(properties);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser addToProperty(String name, Object value) throws LockedException {
+ super.addToProperty(name, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser putToProperty(String name, Object key, Object value) throws LockedException {
+ super.putToProperty(name, key, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser putToProperty(String name, Object value) throws LockedException {
+ super.putToProperty(name, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser removeFromProperty(String name, Object value) throws LockedException {
+ super.removeFromProperty(name, value);
+ return this;
+ }
+
+
+ //--------------------------------------------------------------------------------
+ // Overridden methods
+ //--------------------------------------------------------------------------------
+
+ @Override /* CoreApi */
+ public Parser setClassLoader(ClassLoader classLoader) throws LockedException {
super.setClassLoader(classLoader);
return this;
}
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/msgpack/MsgPackParserContext.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/msgpack/MsgPackParserContext.java b/juneau-core/src/main/java/org/apache/juneau/msgpack/MsgPackParserContext.java
index 2e04978..267305f 100644
--- a/juneau-core/src/main/java/org/apache/juneau/msgpack/MsgPackParserContext.java
+++ b/juneau-core/src/main/java/org/apache/juneau/msgpack/MsgPackParserContext.java
@@ -21,23 +21,8 @@ import org.apache.juneau.parser.*;
* Context properties are set by calling {@link ContextFactory#setProperty(String, Object)} on the context factory
* returned {@link CoreApi#getContextFactory()}.
* <p>
- * The following convenience methods are also provided for setting context properties:
- * <ul>
- * <li>{@link MsgPackParser#setProperty(String,Object)}
- * <li>{@link MsgPackParser#setProperties(ObjectMap)}
- * <li>{@link MsgPackParser#addNotBeanClasses(Class[])}
- * <li>{@link MsgPackParser#addBeanFilters(Class[])}
- * <li>{@link MsgPackParser#addPojoSwaps(Class[])}
- * <li>{@link MsgPackParser#addToDictionary(Class[])}
- * <li>{@link MsgPackParser#addImplClass(Class,Class)}
- * </ul>
- * <p>
* See {@link ContextFactory} for more information about context properties.
*
- * <h6 class='topic' id='ConfigProperties'>Configurable properties on the MessagePack parser</h6>
- * <p>
- * None.
- *
* <h5 class='section'>Inherited configurable properties:</h5>
* <ul class='javahierarchy'>
* <li class='c'><a class="doclink" href="../BeanContext.html#ConfigProperties">BeanContext</a> - Properties associated with handling beans on serializers and parsers.
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/msgpack/MsgPackSerializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/msgpack/MsgPackSerializer.java b/juneau-core/src/main/java/org/apache/juneau/msgpack/MsgPackSerializer.java
index 4ab038b..4ce103d 100644
--- a/juneau-core/src/main/java/org/apache/juneau/msgpack/MsgPackSerializer.java
+++ b/juneau-core/src/main/java/org/apache/juneau/msgpack/MsgPackSerializer.java
@@ -190,7 +190,7 @@ public class MsgPackSerializer extends OutputStreamSerializer {
//--------------------------------------------------------------------------------
- // Overridden methods
+ // Entry point methods
//--------------------------------------------------------------------------------
@Override /* Serializer */
@@ -204,49 +204,473 @@ public class MsgPackSerializer extends OutputStreamSerializer {
serializeAnything(s, s.getOutputStream(), o, null, "root", null);
}
+
+ //--------------------------------------------------------------------------------
+ // Properties
+ //--------------------------------------------------------------------------------
+
+ @Override /* Serializer */
+ public MsgPackSerializer setMaxDepth(int value) throws LockedException {
+ super.setMaxDepth(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public MsgPackSerializer setInitialDepth(int value) throws LockedException {
+ super.setInitialDepth(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public MsgPackSerializer setDetectRecursions(boolean value) throws LockedException {
+ super.setDetectRecursions(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public MsgPackSerializer setIgnoreRecursions(boolean value) throws LockedException {
+ super.setIgnoreRecursions(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public MsgPackSerializer setUseIndentation(boolean value) throws LockedException {
+ super.setUseIndentation(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public MsgPackSerializer setAddBeanTypeProperties(boolean value) throws LockedException {
+ super.setAddBeanTypeProperties(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public MsgPackSerializer setQuoteChar(char value) throws LockedException {
+ super.setQuoteChar(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public MsgPackSerializer setTrimNullProperties(boolean value) throws LockedException {
+ super.setTrimNullProperties(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public MsgPackSerializer setTrimEmptyCollections(boolean value) throws LockedException {
+ super.setTrimEmptyCollections(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public MsgPackSerializer setTrimEmptyMaps(boolean value) throws LockedException {
+ super.setTrimEmptyMaps(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public MsgPackSerializer setTrimStrings(boolean value) throws LockedException {
+ super.setTrimStrings(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public MsgPackSerializer setRelativeUriBase(String value) throws LockedException {
+ super.setRelativeUriBase(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public MsgPackSerializer setAbsolutePathUriBase(String value) throws LockedException {
+ super.setAbsolutePathUriBase(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public MsgPackSerializer setSortCollections(boolean value) throws LockedException {
+ super.setSortCollections(value);
+ return this;
+ }
+
+ @Override /* Serializer */
+ public MsgPackSerializer setSortMaps(boolean value) throws LockedException {
+ super.setSortMaps(value);
+ return this;
+ }
+
@Override /* CoreApi */
- public MsgPackSerializer setProperty(String property, Object value) throws LockedException {
- super.setProperty(property, value);
+ public MsgPackSerializer setBeansRequireDefaultConstructor(boolean value) throws LockedException {
+ super.setBeansRequireDefaultConstructor(value);
return this;
}
@Override /* CoreApi */
- public MsgPackSerializer setProperties(ObjectMap properties) throws LockedException {
- super.setProperties(properties);
+ public MsgPackSerializer setBeansRequireSerializable(boolean value) throws LockedException {
+ super.setBeansRequireSerializable(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public MsgPackSerializer setBeansRequireSettersForGetters(boolean value) throws LockedException {
+ super.setBeansRequireSettersForGetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public MsgPackSerializer setBeansRequireSomeProperties(boolean value) throws LockedException {
+ super.setBeansRequireSomeProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public MsgPackSerializer setBeanMapPutReturnsOldValue(boolean value) throws LockedException {
+ super.setBeanMapPutReturnsOldValue(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public MsgPackSerializer setBeanConstructorVisibility(Visibility value) throws LockedException {
+ super.setBeanConstructorVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public MsgPackSerializer setBeanClassVisibility(Visibility value) throws LockedException {
+ super.setBeanClassVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public MsgPackSerializer setBeanFieldVisibility(Visibility value) throws LockedException {
+ super.setBeanFieldVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public MsgPackSerializer setMethodVisibility(Visibility value) throws LockedException {
+ super.setMethodVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public MsgPackSerializer setUseJavaBeanIntrospector(boolean value) throws LockedException {
+ super.setUseJavaBeanIntrospector(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public MsgPackSerializer setUseInterfaceProxies(boolean value) throws LockedException {
+ super.setUseInterfaceProxies(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public MsgPackSerializer setIgnoreUnknownBeanProperties(boolean value) throws LockedException {
+ super.setIgnoreUnknownBeanProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public MsgPackSerializer setIgnoreUnknownNullBeanProperties(boolean value) throws LockedException {
+ super.setIgnoreUnknownNullBeanProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public MsgPackSerializer setIgnorePropertiesWithoutSetters(boolean value) throws LockedException {
+ super.setIgnorePropertiesWithoutSetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public MsgPackSerializer setIgnoreInvocationExceptionsOnGetters(boolean value) throws LockedException {
+ super.setIgnoreInvocationExceptionsOnGetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public MsgPackSerializer setIgnoreInvocationExceptionsOnSetters(boolean value) throws LockedException {
+ super.setIgnoreInvocationExceptionsOnSetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public MsgPackSerializer setSortProperties(boolean value) throws LockedException {
+ super.setSortProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public MsgPackSerializer setNotBeanPackages(String...values) throws LockedException {
+ super.setNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public MsgPackSerializer setNotBeanPackages(Collection<String> values) throws LockedException {
+ super.setNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public MsgPackSerializer addNotBeanPackages(String...values) throws LockedException {
+ super.addNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public MsgPackSerializer addNotBeanPackages(Collection<String> values) throws LockedException {
+ super.addNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public MsgPackSerializer removeNotBeanPackages(String...values) throws LockedException {
+ super.removeNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public MsgPackSerializer removeNotBeanPackages(Collection<String> values) throws LockedException {
+ super.removeNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public MsgPackSerializer setNotBeanClasses(Class<?>...values) throws LockedException {
+ super.setNotBeanClasses(values);
return this;
}
@Override /* CoreApi */
- public MsgPackSerializer addNotBeanClasses(Class<?>...classes) throws LockedException {
- super.addNotBeanClasses(classes);
+ public MsgPackSerializer setNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ super.setNotBeanClasses(values);
return this;
}
@Override /* CoreApi */
- public MsgPackSerializer addBeanFilters(Class<?>...classes) throws LockedException {
- super.addBeanFilters(classes);
+ public MsgPackSerializer addNotBeanClasses(Class<?>...values) throws LockedException {
+ super.addNotBeanClasses(values);
return this;
}
@Override /* CoreApi */
- public MsgPackSerializer addPojoSwaps(Class<?>...classes) throws LockedException {
- super.addPojoSwaps(classes);
+ public MsgPackSerializer addNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ super.addNotBeanClasses(values);
return this;
}
@Override /* CoreApi */
- public MsgPackSerializer addToDictionary(Class<?>...classes) throws LockedException {
- super.addToDictionary(classes);
+ public MsgPackSerializer removeNotBeanClasses(Class<?>...values) throws LockedException {
+ super.removeNotBeanClasses(values);
return this;
}
@Override /* CoreApi */
- public <T> MsgPackSerializer addImplClass(Class<T> interfaceClass, Class<? extends T> implClass) throws LockedException {
+ public MsgPackSerializer removeNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ super.removeNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public MsgPackSerializer setBeanFilters(Class<?>...values) throws LockedException {
+ super.setBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public MsgPackSerializer setBeanFilters(Collection<Class<?>> values) throws LockedException {
+ super.setBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public MsgPackSerializer addBeanFilters(Class<?>...values) throws LockedException {
+ super.addBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public MsgPackSerializer addBeanFilters(Collection<Class<?>> values) throws LockedException {
+ super.addBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public MsgPackSerializer removeBeanFilters(Class<?>...values) throws LockedException {
+ super.removeBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public MsgPackSerializer removeBeanFilters(Collection<Class<?>> values) throws LockedException {
+ super.removeBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public MsgPackSerializer setPojoSwaps(Class<?>...values) throws LockedException {
+ super.setPojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public MsgPackSerializer setPojoSwaps(Collection<Class<?>> values) throws LockedException {
+ super.setPojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public MsgPackSerializer addPojoSwaps(Class<?>...values) throws LockedException {
+ super.addPojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public MsgPackSerializer addPojoSwaps(Collection<Class<?>> values) throws LockedException {
+ super.addPojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public MsgPackSerializer removePojoSwaps(Class<?>...values) throws LockedException {
+ super.removePojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public MsgPackSerializer removePojoSwaps(Collection<Class<?>> values) throws LockedException {
+ super.removePojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public MsgPackSerializer setImplClasses(Map<Class<?>,Class<?>> values) throws LockedException {
+ super.setImplClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public <T> CoreApi addImplClass(Class<T> interfaceClass, Class<? extends T> implClass) throws LockedException {
super.addImplClass(interfaceClass, implClass);
return this;
}
@Override /* CoreApi */
+ public MsgPackSerializer setBeanDictionary(Class<?>...values) throws LockedException {
+ super.setBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public MsgPackSerializer setBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ super.setBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public MsgPackSerializer addToBeanDictionary(Class<?>...values) throws LockedException {
+ super.addToBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public MsgPackSerializer addToBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ super.addToBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public MsgPackSerializer removeFromBeanDictionary(Class<?>...values) throws LockedException {
+ super.removeFromBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public MsgPackSerializer removeFromBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ super.removeFromBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public MsgPackSerializer setBeanTypePropertyName(String value) throws LockedException {
+ super.setBeanTypePropertyName(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public MsgPackSerializer setDefaultParser(Class<?> value) throws LockedException {
+ super.setDefaultParser(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public MsgPackSerializer setLocale(Locale value) throws LockedException {
+ super.setLocale(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public MsgPackSerializer setTimeZone(TimeZone value) throws LockedException {
+ super.setTimeZone(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public MsgPackSerializer setMediaType(MediaType value) throws LockedException {
+ super.setMediaType(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public MsgPackSerializer setDebug(boolean value) throws LockedException {
+ super.setDebug(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public MsgPackSerializer setProperty(String name, Object value) throws LockedException {
+ super.setProperty(name, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public MsgPackSerializer setProperties(ObjectMap properties) throws LockedException {
+ super.setProperties(properties);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public MsgPackSerializer addToProperty(String name, Object value) throws LockedException {
+ super.addToProperty(name, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public MsgPackSerializer putToProperty(String name, Object key, Object value) throws LockedException {
+ super.putToProperty(name, key, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public MsgPackSerializer putToProperty(String name, Object value) throws LockedException {
+ super.putToProperty(name, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public MsgPackSerializer removeFromProperty(String name, Object value) throws LockedException {
+ super.removeFromProperty(name, value);
+ return this;
+ }
+
+
+ //--------------------------------------------------------------------------------
+ // Overridden methods
+ //--------------------------------------------------------------------------------
+
+ @Override /* CoreApi */
public MsgPackSerializer setClassLoader(ClassLoader classLoader) throws LockedException {
super.setClassLoader(classLoader);
return this;
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/msgpack/MsgPackSerializerContext.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/msgpack/MsgPackSerializerContext.java b/juneau-core/src/main/java/org/apache/juneau/msgpack/MsgPackSerializerContext.java
index ced4439..7fa6019 100644
--- a/juneau-core/src/main/java/org/apache/juneau/msgpack/MsgPackSerializerContext.java
+++ b/juneau-core/src/main/java/org/apache/juneau/msgpack/MsgPackSerializerContext.java
@@ -21,23 +21,8 @@ import org.apache.juneau.serializer.*;
* Context properties are set by calling {@link ContextFactory#setProperty(String, Object)} on the context factory
* returned {@link CoreApi#getContextFactory()}.
* <p>
- * The following convenience methods are also provided for setting context properties:
- * <ul>
- * <li>{@link MsgPackSerializer#setProperty(String,Object)}
- * <li>{@link MsgPackSerializer#setProperties(ObjectMap)}
- * <li>{@link MsgPackSerializer#addNotBeanClasses(Class[])}
- * <li>{@link MsgPackSerializer#addBeanFilters(Class[])}
- * <li>{@link MsgPackSerializer#addPojoSwaps(Class[])}
- * <li>{@link MsgPackSerializer#addToDictionary(Class[])}
- * <li>{@link MsgPackSerializer#addImplClass(Class,Class)}
- * </ul>
- * <p>
* See {@link ContextFactory} for more information about context properties.
*
- * <h6 class='topic' id='ConfigProperties'>Configurable properties on the MessagePack serializer</h6>
- * <p>
- * None.
- *
* <h5 class='section'>Inherited configurable properties:</h5>
* <ul class='javahierarchy'>
* <li class='c'><a class="doclink" href="../BeanContext.html#ConfigProperties">BeanContext</a> - Properties associated with handling beans on serializers and parsers.
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/parser/Parser.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/parser/Parser.java b/juneau-core/src/main/java/org/apache/juneau/parser/Parser.java
index 9ec061a..e3d9f9a 100644
--- a/juneau-core/src/main/java/org/apache/juneau/parser/Parser.java
+++ b/juneau-core/src/main/java/org/apache/juneau/parser/Parser.java
@@ -12,6 +12,7 @@
// ***************************************************************************************************************************
package org.apache.juneau.parser;
+import static org.apache.juneau.parser.ParserContext.*;
import static org.apache.juneau.internal.StringUtils.*;
import java.io.*;
@@ -22,6 +23,8 @@ import java.util.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
import org.apache.juneau.internal.*;
+import org.apache.juneau.json.*;
+import org.apache.juneau.parser.ParseException;
import org.apache.juneau.transform.*;
import org.apache.juneau.transforms.*;
import org.apache.juneau.utils.*;
@@ -149,6 +152,7 @@ public abstract class Parser extends CoreApi {
}
}
+
//--------------------------------------------------------------------------------
// Abstract methods
//--------------------------------------------------------------------------------
@@ -354,6 +358,7 @@ public abstract class Parser extends CoreApi {
return createSession(input, null, null, null, null, null, getPrimaryMediaType());
}
+
//--------------------------------------------------------------------------------
// Optional methods
//--------------------------------------------------------------------------------
@@ -498,6 +503,7 @@ public abstract class Parser extends CoreApi {
throw new UnsupportedOperationException("Parser '"+getClass().getName()+"' does not support this method.");
}
+
//--------------------------------------------------------------------------------
// Other methods
//--------------------------------------------------------------------------------
@@ -643,47 +649,520 @@ public abstract class Parser extends CoreApi {
return mediaTypes == null || mediaTypes.length == 0 ? null : mediaTypes[0];
}
+
//--------------------------------------------------------------------------------
- // Overridden methods
+ // Properties
//--------------------------------------------------------------------------------
+ /**
+ * <b>Configuration property:</b> Trim parsed strings.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"Parser.trimStrings"</js>
+ * <li><b>Data type:</b> <code>Boolean</code>
+ * <li><b>Default:</b> <jk>false</jk>
+ * <li><b>Session-overridable:</b> <jk>true</jk>
+ * </ul>
+ * <p>
+ * If <jk>true</jk>, string values will be trimmed of whitespace using {@link String#trim()} before being added to the POJO.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>PARSER_trimStrings</jsf>, value)</code>.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see ParserContext#PARSER_trimStrings
+ */
+ public Parser setTrimStrings(boolean value) throws LockedException {
+ return setProperty(PARSER_trimStrings, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> Strict mode.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"Parser.strict"</js>
+ * <li><b>Data type:</b> <code>Boolean</code>
+ * <li><b>Default:</b> <jk>false</jk>
+ * <li><b>Session-overridable:</b> <jk>true</jk>
+ * </ul>
+ * <p>
+ * If <jk>true</jk>, strict mode for the parser is enabled.
+ * <p>
+ * Strict mode can mean different things for different parsers.
+ * <p>
+ * <table class='styled'>
+ * <tr><th>Parser class</th><th>Strict behavior</th></tr>
+ * <tr>
+ * <td>All reader-based parsers</td>
+ * <td>
+ * When enabled, throws {@link ParseException ParseExceptions} on malformed charset input.
+ * Otherwise, malformed input is ignored.
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>{@link JsonParser}</td>
+ * <td>
+ * When enabled, throws exceptions on the following invalid JSON syntax:
+ * <ul>
+ * <li>Unquoted attributes.
+ * <li>Missing attribute values.
+ * <li>Concatenated strings.
+ * <li>Javascript comments.
+ * <li>Numbers and booleans when Strings are expected.
+ * <li>Numbers valid in Java but not JSON (e.g. octal notation, etc...)
+ * </ul>
+ * </td>
+ * </tr>
+ * </table>
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>PARSER_strict</jsf>,value)</code>.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see ParserContext#PARSER_strict
+ */
+ public Parser setStrict(boolean value) throws LockedException {
+ return setProperty(PARSER_strict, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> Input stream charset.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"Parser.inputStreamCharset"</js>
+ * <li><b>Data type:</b> <code>String</code>
+ * <li><b>Default:</b> <js>"UTF-8"</js>
+ * <li><b>Session-overridable:</b> <jk>true</jk>
+ * </ul>
+ * <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)}.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>PARSER_inputStreamCharset</jsf>, value)</code>.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see ParserContext#PARSER_inputStreamCharset
+ */
+ public Parser setInputStreamCharset(String value) throws LockedException {
+ return setProperty(PARSER_inputStreamCharset, value);
+ }
+
+ /**
+ * <b>Configuration property:</b> File charset.
+ * <p>
+ * <ul>
+ * <li><b>Name:</b> <js>"Parser.fileCharset"</js>
+ * <li><b>Data type:</b> <code>String</code>
+ * <li><b>Default:</b> <js>"default"</js>
+ * <li><b>Session-overridable:</b> <jk>true</jk>
+ * </ul>
+ * <p>
+ * The character set to use for reading <code>Files</code> from the file system.
+ * <p>
+ * 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.
+ * <p>
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>setProperty(<jsf>PARSER_fileCharset</jsf>,value)</code>.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @throws LockedException If {@link #lock()} was called on this class.
+ * @see ParserContext#PARSER_fileCharset
+ */
+ public Parser setFileCharset(String value) throws LockedException {
+ return setProperty(PARSER_fileCharset, value);
+ }
+
+ @Override /* CoreApi */
+ public Parser setBeansRequireDefaultConstructor(boolean value) throws LockedException {
+ super.setBeansRequireDefaultConstructor(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setBeansRequireSerializable(boolean value) throws LockedException {
+ super.setBeansRequireSerializable(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setBeansRequireSettersForGetters(boolean value) throws LockedException {
+ super.setBeansRequireSettersForGetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setBeansRequireSomeProperties(boolean value) throws LockedException {
+ super.setBeansRequireSomeProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setBeanMapPutReturnsOldValue(boolean value) throws LockedException {
+ super.setBeanMapPutReturnsOldValue(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setBeanConstructorVisibility(Visibility value) throws LockedException {
+ super.setBeanConstructorVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setBeanClassVisibility(Visibility value) throws LockedException {
+ super.setBeanClassVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setBeanFieldVisibility(Visibility value) throws LockedException {
+ super.setBeanFieldVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setMethodVisibility(Visibility value) throws LockedException {
+ super.setMethodVisibility(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setUseJavaBeanIntrospector(boolean value) throws LockedException {
+ super.setUseJavaBeanIntrospector(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setUseInterfaceProxies(boolean value) throws LockedException {
+ super.setUseInterfaceProxies(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setIgnoreUnknownBeanProperties(boolean value) throws LockedException {
+ super.setIgnoreUnknownBeanProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setIgnoreUnknownNullBeanProperties(boolean value) throws LockedException {
+ super.setIgnoreUnknownNullBeanProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setIgnorePropertiesWithoutSetters(boolean value) throws LockedException {
+ super.setIgnorePropertiesWithoutSetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setIgnoreInvocationExceptionsOnGetters(boolean value) throws LockedException {
+ super.setIgnoreInvocationExceptionsOnGetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setIgnoreInvocationExceptionsOnSetters(boolean value) throws LockedException {
+ super.setIgnoreInvocationExceptionsOnSetters(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setSortProperties(boolean value) throws LockedException {
+ super.setSortProperties(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setNotBeanPackages(String...values) throws LockedException {
+ super.setNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setNotBeanPackages(Collection<String> values) throws LockedException {
+ super.setNotBeanPackages(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser addNotBeanPackages(String...values) throws LockedException {
+ super.addNotBeanPackages(values);
+ return this;
+ }
+
@Override /* CoreApi */
- public Parser setProperty(String property, Object value) throws LockedException {
- super.setProperty(property, value);
+ public Parser addNotBeanPackages(Collection<String> values) throws LockedException {
+ super.addNotBeanPackages(values);
return this;
}
@Override /* CoreApi */
- public Parser addNotBeanClasses(Class<?>...classes) throws LockedException {
- super.addNotBeanClasses(classes);
+ public Parser removeNotBeanPackages(String...values) throws LockedException {
+ super.removeNotBeanPackages(values);
return this;
}
@Override /* CoreApi */
- public Parser addBeanFilters(Class<?>...classes) throws LockedException {
- super.addBeanFilters(classes);
+ public Parser removeNotBeanPackages(Collection<String> values) throws LockedException {
+ super.removeNotBeanPackages(values);
return this;
}
@Override /* CoreApi */
- public Parser addPojoSwaps(Class<?>...classes) throws LockedException {
- super.addPojoSwaps(classes);
+ public Parser setNotBeanClasses(Class<?>...values) throws LockedException {
+ super.setNotBeanClasses(values);
return this;
}
@Override /* CoreApi */
- public Parser addToDictionary(Class<?>...classes) throws LockedException {
- super.addToDictionary(classes);
+ public Parser setNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ super.setNotBeanClasses(values);
return this;
}
@Override /* CoreApi */
- public <T> Parser addImplClass(Class<T> interfaceClass, Class<? extends T> implClass) throws LockedException {
+ public Parser addNotBeanClasses(Class<?>...values) throws LockedException {
+ super.addNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser addNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ super.addNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser removeNotBeanClasses(Class<?>...values) throws LockedException {
+ super.removeNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser removeNotBeanClasses(Collection<Class<?>> values) throws LockedException {
+ super.removeNotBeanClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setBeanFilters(Class<?>...values) throws LockedException {
+ super.setBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setBeanFilters(Collection<Class<?>> values) throws LockedException {
+ super.setBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser addBeanFilters(Class<?>...values) throws LockedException {
+ super.addBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser addBeanFilters(Collection<Class<?>> values) throws LockedException {
+ super.addBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser removeBeanFilters(Class<?>...values) throws LockedException {
+ super.removeBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser removeBeanFilters(Collection<Class<?>> values) throws LockedException {
+ super.removeBeanFilters(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setPojoSwaps(Class<?>...values) throws LockedException {
+ super.setPojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setPojoSwaps(Collection<Class<?>> values) throws LockedException {
+ super.setPojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser addPojoSwaps(Class<?>...values) throws LockedException {
+ super.addPojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser addPojoSwaps(Collection<Class<?>> values) throws LockedException {
+ super.addPojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser removePojoSwaps(Class<?>...values) throws LockedException {
+ super.removePojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser removePojoSwaps(Collection<Class<?>> values) throws LockedException {
+ super.removePojoSwaps(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setImplClasses(Map<Class<?>,Class<?>> values) throws LockedException {
+ super.setImplClasses(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public <T> CoreApi addImplClass(Class<T> interfaceClass, Class<? extends T> implClass) throws LockedException {
super.addImplClass(interfaceClass, implClass);
return this;
}
@Override /* CoreApi */
+ public Parser setBeanDictionary(Class<?>...values) throws LockedException {
+ super.setBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ super.setBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser addToBeanDictionary(Class<?>...values) throws LockedException {
+ super.addToBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser addToBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ super.addToBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser removeFromBeanDictionary(Class<?>...values) throws LockedException {
+ super.removeFromBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser removeFromBeanDictionary(Collection<Class<?>> values) throws LockedException {
+ super.removeFromBeanDictionary(values);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setBeanTypePropertyName(String value) throws LockedException {
+ super.setBeanTypePropertyName(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setDefaultParser(Class<?> value) throws LockedException {
+ super.setDefaultParser(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setLocale(Locale value) throws LockedException {
+ super.setLocale(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setTimeZone(TimeZone value) throws LockedException {
+ super.setTimeZone(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setMediaType(MediaType value) throws LockedException {
+ super.setMediaType(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setDebug(boolean value) throws LockedException {
+ super.setDebug(value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setProperty(String name, Object value) throws LockedException {
+ super.setProperty(name, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser setProperties(ObjectMap properties) throws LockedException {
+ super.setProperties(properties);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser addToProperty(String name, Object value) throws LockedException {
+ super.addToProperty(name, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser putToProperty(String name, Object key, Object value) throws LockedException {
+ super.putToProperty(name, key, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser putToProperty(String name, Object value) throws LockedException {
+ super.putToProperty(name, value);
+ return this;
+ }
+
+ @Override /* CoreApi */
+ public Parser removeFromProperty(String name, Object value) throws LockedException {
+ super.removeFromProperty(name, value);
+ return this;
+ }
+
+
+ //--------------------------------------------------------------------------------
+ // Overridden methods
+ //--------------------------------------------------------------------------------
+
+ @Override /* CoreApi */
public Parser setClassLoader(ClassLoader classLoader) throws LockedException {
super.setClassLoader(classLoader);
return this;
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/parser/ParserContext.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/parser/ParserContext.java b/juneau-core/src/main/java/org/apache/juneau/parser/ParserContext.java
index a314a41..1432efb 100644
--- a/juneau-core/src/main/java/org/apache/juneau/parser/ParserContext.java
+++ b/juneau-core/src/main/java/org/apache/juneau/parser/ParserContext.java
@@ -17,39 +17,6 @@ import org.apache.juneau.json.*;
/**
* Configurable properties common to all parsers.
- *
- * <h6 class='topic' id='ConfigProperties'>Configurable properties common to all parsers</h6>
- * <table class='styled' style='border-collapse: collapse;'>
- * <tr><th>Setting name</th><th>Description</th><th>Data type</th><th>Default value</th><th>Session overridable</th></tr>
- * <tr>
- * <td>{@link #PARSER_trimStrings}</td>
- * <td>Trim parsed strings.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>false</jk></td>
- * <td><jk>true</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #PARSER_strict}</td>
- * <td>Strict mode.</td>
- * <td><code>Boolean</code></td>
- * <td><jk>false</jk></td>
- * <td><jk>true</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #PARSER_inputStreamCharset}</td>
- * <td>Input stream charset.</td>
- * <td><code>String</code></td>
- * <td><js>"UTF-8"</js></td>
- * <td><jk>true</jk></td>
- * </tr>
- * <tr>
- * <td>{@link #PARSER_fileCharset}</td>
- * <td>File charset.</td>
- * <td><code>String</code></td>
- * <td><js>"default"</js></td>
- * <td><jk>true</jk></td>
- * </tr>
- * </table>
*/
public class ParserContext extends BeanContext {
[09/14] incubator-juneau git commit: Add convenience property setters
to serializers and parsers.
Posted by ja...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/dto/html5/Audio.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Audio.java b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Audio.java
index 1b4643c..785e5ef 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Audio.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Audio.java
@@ -26,7 +26,7 @@ public class Audio extends HtmlElementContainer {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-autoplay">autoplay</a> attribute.
* Hint that the media resource can be started automatically when the page is loaded.
- * @param autoplay - The new value for this attribute.
+ * @param autoplay The new value for this attribute.
* Typically a {@link Boolean} or {@link String}.
* @return This object (for method chaining).
*/
@@ -38,7 +38,7 @@ public class Audio extends HtmlElementContainer {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-controls">controls</a> attribute.
* Show user agent controls.
- * @param controls - The new value for this attribute.
+ * @param controls The new value for this attribute.
* Typically a {@link Boolean} or {@link String}.
* @return This object (for method chaining).
*/
@@ -50,7 +50,7 @@ public class Audio extends HtmlElementContainer {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-crossorigin">crossorigin</a> attribute.
* How the element handles crossorigin requests.
- * @param crossorigin - The new value for this attribute.
+ * @param crossorigin The new value for this attribute.
* @return This object (for method chaining).
*/
public final Audio crossorigin(String crossorigin) {
@@ -61,7 +61,7 @@ public class Audio extends HtmlElementContainer {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-loop">loop</a> attribute.
* Whether to loop the media resource.
- * @param loop - The new value for this attribute.
+ * @param loop The new value for this attribute.
* Typically a {@link Boolean} or {@link String}.
* @return This object (for method chaining).
*/
@@ -73,7 +73,7 @@ public class Audio extends HtmlElementContainer {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-mediagroup">mediagroup</a> attribute.
* Groups media elements together with an implicit MediaController.
- * @param mediagroup - The new value for this attribute.
+ * @param mediagroup The new value for this attribute.
* @return This object (for method chaining).
*/
public final Audio mediagroup(String mediagroup) {
@@ -84,7 +84,7 @@ public class Audio extends HtmlElementContainer {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-muted">muted</a> attribute.
* Whether to mute the media resource by default.
- * @param muted - The new value for this attribute.
+ * @param muted The new value for this attribute.
* Typically a {@link Boolean} or {@link String}.
* @return This object (for method chaining).
*/
@@ -96,7 +96,7 @@ public class Audio extends HtmlElementContainer {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-preload">preload</a> attribute.
* Hints how much buffering the media resource will likely need.
- * @param preload - The new value for this attribute.
+ * @param preload The new value for this attribute.
* @return This object (for method chaining).
*/
public final Audio preload(Object preload) {
@@ -107,7 +107,7 @@ public class Audio extends HtmlElementContainer {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-src">src</a> attribute.
* Address of the resource.
- * @param src - The new value for this attribute.
+ * @param src The new value for this attribute.
* Typically a {@link URL} or {@link String}.
* @return This object (for method chaining).
*/
@@ -116,6 +116,7 @@ public class Audio extends HtmlElementContainer {
return this;
}
+
//--------------------------------------------------------------------------------
// Overridden methods
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/dto/html5/Base.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Base.java b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Base.java
index 7e47750..e001ce1 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Base.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Base.java
@@ -26,7 +26,7 @@ public class Base extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/document-metadata.html#attr-base-href">href</a> attribute.
* Document base URL.
- * @param href - The new value for this attribute.
+ * @param href The new value for this attribute.
* Typically a {@link URL} or {@link String}.
* @return This object (for method chaining).
*/
@@ -38,7 +38,7 @@ public class Base extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/document-metadata.html#attr-base-target">target</a> attribute.
* Default browsing context for hyperlink navigation and form submission.
- * @param target - The new value for this attribute.
+ * @param target The new value for this attribute.
* @return This object (for method chaining).
*/
public final Base target(String target) {
@@ -46,6 +46,7 @@ public class Base extends HtmlElementEmpty {
return this;
}
+
//--------------------------------------------------------------------------------
// Overridden methods
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/dto/html5/Blockquote.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Blockquote.java b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Blockquote.java
index 72ee4c4..9938a67 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Blockquote.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Blockquote.java
@@ -24,7 +24,7 @@ public class Blockquote extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/grouping-content.html#attr-blockquote-cite">cite</a> attribute.
* Link to the source of the quotation..
- * @param cite - The new value for this attribute.
+ * @param cite The new value for this attribute.
* @return This object (for method chaining).
*/
public final Blockquote cite(String cite) {
@@ -32,6 +32,7 @@ public class Blockquote extends HtmlElementMixed {
return this;
}
+
//--------------------------------------------------------------------------------
// Overridden methods
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/dto/html5/Body.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Body.java b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Body.java
index 9a6df15..c7e53fc 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Body.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Body.java
@@ -24,7 +24,7 @@ public class Body extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/webappapis.html#handler-window-onafterprint">onafterprint</a> attribute.
* //onbeforeprint https://www.w3.org/TR/html5/webappapis.html#handler-window-onbeforeprint.
- * @param onafterprint - The new value for this attribute.
+ * @param onafterprint The new value for this attribute.
* @return This object (for method chaining).
*/
public final Body onafterprint(String onafterprint) {
@@ -35,7 +35,7 @@ public class Body extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/webappapis.html#handler-window-onbeforeunload">onbeforeunload</a> attribute.
* //onhashchange https://www.w3.org/TR/html5/webappapis.html#handler-window-onhashchange.
- * @param onbeforeunload - The new value for this attribute.
+ * @param onbeforeunload The new value for this attribute.
* @return This object (for method chaining).
*/
public final Body onbeforeunload(String onbeforeunload) {
@@ -46,7 +46,7 @@ public class Body extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/webappapis.html#handler-window-onmessage">onmessage</a> attribute.
* //onoffline https://www.w3.org/TR/html5/webappapis.html#handler-window-onoffline.
- * @param onmessage - The new value for this attribute.
+ * @param onmessage The new value for this attribute.
* @return This object (for method chaining).
*/
public final Body onmessage(String onmessage) {
@@ -57,7 +57,7 @@ public class Body extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/webappapis.html#handler-window-ononline">ononline</a> attribute.
* //onpagehide https://www.w3.org/TR/html5/webappapis.html#handler-window-onpagehide.
- * @param ononline - The new value for this attribute.
+ * @param ononline The new value for this attribute.
* @return This object (for method chaining).
*/
public final Body ononline(String ononline) {
@@ -68,7 +68,7 @@ public class Body extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/webappapis.html#handler-window-onpageshow">onpageshow</a> attribute.
* //onpopstate https://www.w3.org/TR/html5/webappapis.html#handler-window-onpopstate.
- * @param onpageshow - The new value for this attribute.
+ * @param onpageshow The new value for this attribute.
* @return This object (for method chaining).
*/
public final Body onpageshow(String onpageshow) {
@@ -79,7 +79,7 @@ public class Body extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/webappapis.html#handler-window-onstorage">onstorage</a> attribute.
* //onunload https://www.w3.org/TR/html5/webappapis.html#handler-window-onunload.
- * @param onstorage - The new value for this attribute.
+ * @param onstorage The new value for this attribute.
* @return This object (for method chaining).
*/
public final Body onstorage(String onstorage) {
@@ -87,6 +87,7 @@ public class Body extends HtmlElementMixed {
return this;
}
+
//--------------------------------------------------------------------------------
// Overridden methods
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/dto/html5/Button.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Button.java b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Button.java
index 90faa1c..a18e255 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Button.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Button.java
@@ -24,7 +24,7 @@ public class Button extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fe-autofocus">autofocus</a> attribute.
* Automatically focus the form control when the page is loaded.
- * @param autofocus - The new value for this attribute.
+ * @param autofocus The new value for this attribute.
* Typically a {@link Boolean} or {@link String}.
* @return This object (for method chaining).
*/
@@ -36,7 +36,7 @@ public class Button extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fe-disabled">disabled</a> attribute.
* Whether the form control is disabled.
- * @param disabled - The new value for this attribute.
+ * @param disabled The new value for this attribute.
* Typically a {@link Boolean} or {@link String}.
* @return This object (for method chaining).
*/
@@ -48,7 +48,7 @@ public class Button extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fae-form">form</a> attribute.
* Associates the control with a form element.
- * @param form - The new value for this attribute.
+ * @param form The new value for this attribute.
* @return This object (for method chaining).
*/
public final Button form(String form) {
@@ -59,7 +59,7 @@ public class Button extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fs-formaction">formaction</a> attribute.
* URL to use for form submission.
- * @param formaction - The new value for this attribute.
+ * @param formaction The new value for this attribute.
* @return This object (for method chaining).
*/
public final Button formaction(String formaction) {
@@ -70,7 +70,7 @@ public class Button extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fs-formenctype">formenctype</a> attribute.
* Form data set encoding type to use for form submission.
- * @param formenctype - The new value for this attribute.
+ * @param formenctype The new value for this attribute.
* @return This object (for method chaining).
*/
public final Button formenctype(String formenctype) {
@@ -81,7 +81,7 @@ public class Button extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fs-formmethod">formmethod</a> attribute.
* HTTP method to use for form submission.
- * @param formmethod - The new value for this attribute.
+ * @param formmethod The new value for this attribute.
* @return This object (for method chaining).
*/
public final Button formmethod(String formmethod) {
@@ -92,7 +92,7 @@ public class Button extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fs-formnovalidate">formnovalidate</a> attribute.
* Bypass form control validation for form submission.
- * @param formnovalidate - The new value for this attribute.
+ * @param formnovalidate The new value for this attribute.
* @return This object (for method chaining).
*/
public final Button formnovalidate(String formnovalidate) {
@@ -103,7 +103,7 @@ public class Button extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fs-formtarget">formtarget</a> attribute.
* Browsing context for form submission.
- * @param formtarget - The new value for this attribute.
+ * @param formtarget The new value for this attribute.
* @return This object (for method chaining).
*/
public final Button formtarget(String formtarget) {
@@ -114,7 +114,7 @@ public class Button extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fs-menu">menu</a> attribute.
* Specifies the element's designated pop-up menu.
- * @param menu - The new value for this attribute.
+ * @param menu The new value for this attribute.
* @return This object (for method chaining).
*/
public final Button menu(String menu) {
@@ -125,7 +125,7 @@ public class Button extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fe-name">name</a> attribute.
* Name of form control to use for form submission and in the form.elements API.
- * @param name - The new value for this attribute.
+ * @param name The new value for this attribute.
* @return This object (for method chaining).
*/
public final Button name(String name) {
@@ -136,7 +136,7 @@ public class Button extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-button-type">type</a> attribute.
* Type of button.
- * @param type - The new value for this attribute.
+ * @param type The new value for this attribute.
* @return This object (for method chaining).
*/
public final Button type(String type) {
@@ -147,7 +147,7 @@ public class Button extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-button-value">value</a> attribute.
* Value to be used for form submission.
- * @param value - The new value for this attribute.
+ * @param value The new value for this attribute.
* Typically a {@link Number} or {@link String}.
* @return This object (for method chaining).
*/
@@ -156,6 +156,7 @@ public class Button extends HtmlElementMixed {
return this;
}
+
//--------------------------------------------------------------------------------
// Overridden methods
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/dto/html5/Canvas.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Canvas.java b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Canvas.java
index 04968c0..013b857 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Canvas.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Canvas.java
@@ -24,7 +24,7 @@ public class Canvas extends HtmlElementContainer {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/scripting-1.html#attr-canvas-height">height</a> attribute.
* Vertical dimension.
- * @param height - The new value for this attribute.
+ * @param height The new value for this attribute.
* Typically a {@link Number} or {@link String}.
* @return This object (for method chaining).
*/
@@ -36,7 +36,7 @@ public class Canvas extends HtmlElementContainer {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/scripting-1.html#attr-canvas-width">width</a> attribute.
* Horizontal dimension.
- * @param width - The new value for this attribute.
+ * @param width The new value for this attribute.
* Typically a {@link Number} or {@link String}.
* @return This object (for method chaining).
*/
@@ -45,6 +45,7 @@ public class Canvas extends HtmlElementContainer {
return this;
}
+
//--------------------------------------------------------------------------------
// Overridden methods
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/dto/html5/Col.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Col.java b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Col.java
index 7f1a766..2cdd46e 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Col.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Col.java
@@ -24,7 +24,7 @@ public class Col extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/tabular-data.html#attr-col-span">span</a> attribute.
* Number of columns spanned by the element.
- * @param span - The new value for this attribute.
+ * @param span The new value for this attribute.
* Typically a {@link Number} or {@link String}.
* @return This object (for method chaining).
*/
@@ -33,6 +33,7 @@ public class Col extends HtmlElementEmpty {
return this;
}
+
//--------------------------------------------------------------------------------
// Overridden methods
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/dto/html5/Colgroup.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Colgroup.java b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Colgroup.java
index cbbf9a0..3bea974 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Colgroup.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Colgroup.java
@@ -24,7 +24,7 @@ public class Colgroup extends HtmlElementContainer {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/tabular-data.html#attr-colgroup-span">span</a> attribute.
* Number of columns spanned by the element.
- * @param span - The new value for this attribute.
+ * @param span The new value for this attribute.
* Typically a {@link Number} or {@link String}.
* @return This object (for method chaining).
*/
@@ -33,6 +33,7 @@ public class Colgroup extends HtmlElementContainer {
return this;
}
+
//--------------------------------------------------------------------------------
// Overridden methods
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/dto/html5/Data.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Data.java b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Data.java
index 616f345..902241d 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Data.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Data.java
@@ -24,7 +24,7 @@ public class Data extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/text-level-semantics.html#attr-data-value">value</a> attribute.
* Machine-readable value.
- * @param value - The new value for this attribute.
+ * @param value The new value for this attribute.
* Typically a {@link Number} or {@link String}.
* @return This object (for method chaining).
*/
@@ -33,6 +33,7 @@ public class Data extends HtmlElementMixed {
return this;
}
+
//--------------------------------------------------------------------------------
// Overridden methods
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/dto/html5/Del.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Del.java b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Del.java
index b2b4155..88778dd 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Del.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Del.java
@@ -24,7 +24,7 @@ public class Del extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/edits.html#attr-mod-cite">cite</a> attribute.
* Link to the source of the quotation or more information about the edit.
- * @param cite - The new value for this attribute.
+ * @param cite The new value for this attribute.
* @return This object (for method chaining).
*/
public final Del cite(String cite) {
@@ -35,7 +35,7 @@ public class Del extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/edits.html#attr-mod-datetime">datetime</a> attribute.
* Date and (optionally) time of the change.
- * @param datetime - The new value for this attribute.
+ * @param datetime The new value for this attribute.
* @return This object (for method chaining).
*/
public final Del datetime(String datetime) {
@@ -43,6 +43,7 @@ public class Del extends HtmlElementMixed {
return this;
}
+
//--------------------------------------------------------------------------------
// Overridden methods
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/dto/html5/Embed.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Embed.java b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Embed.java
index 8108e63..ce5916d 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Embed.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Embed.java
@@ -26,7 +26,7 @@ public class Embed extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-dim-height">height</a> attribute.
* Vertical dimension.
- * @param height - The new value for this attribute.
+ * @param height The new value for this attribute.
* Typically a {@link Number} or {@link String}.
* @return This object (for method chaining).
*/
@@ -38,7 +38,7 @@ public class Embed extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-embed-src">src</a> attribute.
* Address of the resource.
- * @param src - The new value for this attribute.
+ * @param src The new value for this attribute.
* Typically a {@link URL} or {@link String}.
* @return This object (for method chaining).
*/
@@ -50,7 +50,7 @@ public class Embed extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-embed-type">type</a> attribute.
* Type of embedded resource.
- * @param type - The new value for this attribute.
+ * @param type The new value for this attribute.
* @return This object (for method chaining).
*/
public final Embed type(String type) {
@@ -61,7 +61,7 @@ public class Embed extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-dim-width">width</a> attribute.
* Horizontal dimension.
- * @param width - The new value for this attribute.
+ * @param width The new value for this attribute.
* Typically a {@link Number} or {@link String}.
* @return This object (for method chaining).
*/
@@ -70,6 +70,7 @@ public class Embed extends HtmlElementEmpty {
return this;
}
+
//--------------------------------------------------------------------------------
// Overridden methods
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/dto/html5/Fieldset.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Fieldset.java b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Fieldset.java
index 17dca9e..819a736 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Fieldset.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Fieldset.java
@@ -24,7 +24,7 @@ public class Fieldset extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fieldset-disabled">disabled</a> attribute.
* Whether the form control is disabled.
- * @param disabled - The new value for this attribute.
+ * @param disabled The new value for this attribute.
* Typically a {@link Boolean} or {@link String}.
* @return This object (for method chaining).
*/
@@ -36,7 +36,7 @@ public class Fieldset extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fae-form">form</a> attribute.
* Associates the control with a form element.
- * @param form - The new value for this attribute.
+ * @param form The new value for this attribute.
* @return This object (for method chaining).
*/
public final Fieldset form(String form) {
@@ -47,7 +47,7 @@ public class Fieldset extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fe-name">name</a> attribute.
* Name of form control to use for form submission and in the form.elements API.
- * @param name - The new value for this attribute.
+ * @param name The new value for this attribute.
* @return This object (for method chaining).
*/
public final Fieldset name(String name) {
@@ -55,6 +55,7 @@ public class Fieldset extends HtmlElementMixed {
return this;
}
+
//--------------------------------------------------------------------------------
// Overridden methods
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/dto/html5/Form.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Form.java b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Form.java
index f8a68b1..49ca7a2 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Form.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Form.java
@@ -24,7 +24,7 @@ public class Form extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-form-accept-charset">accept-charset</a> attribute.
* Character encodings to use for form submission.
- * @param acceptcharset - The new value for this attribute.
+ * @param acceptcharset The new value for this attribute.
* @return This object (for method chaining).
*/
public final Form acceptcharset(String acceptcharset) {
@@ -35,7 +35,7 @@ public class Form extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fs-action">action</a> attribute.
* URL to use for form submission.
- * @param action - The new value for this attribute.
+ * @param action The new value for this attribute.
* @return This object (for method chaining).
*/
public final Form action(String action) {
@@ -46,7 +46,7 @@ public class Form extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-form-autocomplete">autocomplete</a> attribute.
* Default setting for autofill feature for controls in the form.
- * @param autocomplete - The new value for this attribute.
+ * @param autocomplete The new value for this attribute.
* @return This object (for method chaining).
*/
public final Form autocomplete(String autocomplete) {
@@ -57,7 +57,7 @@ public class Form extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fs-enctype">enctype</a> attribute.
* Form data set encoding type to use for form submission.
- * @param enctype - The new value for this attribute.
+ * @param enctype The new value for this attribute.
* @return This object (for method chaining).
*/
public final Form enctype(String enctype) {
@@ -68,7 +68,7 @@ public class Form extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fs-method">method</a> attribute.
* HTTP method to use for form submission.
- * @param method - The new value for this attribute.
+ * @param method The new value for this attribute.
* @return This object (for method chaining).
*/
public final Form method(String method) {
@@ -79,7 +79,7 @@ public class Form extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-form-name">name</a> attribute.
* Name of form to use in the document.forms API.
- * @param name - The new value for this attribute.
+ * @param name The new value for this attribute.
* @return This object (for method chaining).
*/
public final Form name(String name) {
@@ -90,7 +90,7 @@ public class Form extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fs-novalidate">novalidate</a> attribute.
* Bypass form control validation for form submission.
- * @param novalidate - The new value for this attribute.
+ * @param novalidate The new value for this attribute.
* Typically a {@link Boolean} or {@link String}.
* @return This object (for method chaining).
*/
@@ -102,7 +102,7 @@ public class Form extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fs-target">target</a> attribute.
* Browsing context for form submission.
- * @param target - The new value for this attribute.
+ * @param target The new value for this attribute.
* @return This object (for method chaining).
*/
public final Form target(String target) {
@@ -110,6 +110,7 @@ public class Form extends HtmlElementMixed {
return this;
}
+
//--------------------------------------------------------------------------------
// Overridden methods
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/dto/html5/Html.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Html.java b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Html.java
index 2af5f36..6e7bc19 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Html.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Html.java
@@ -24,7 +24,7 @@ public class Html extends HtmlElementContainer {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/semantics.html#attr-html-manifest">manifest</a> attribute.
* Application cache manifest.
- * @param manifest - The new value for this attribute.
+ * @param manifest The new value for this attribute.
* @return This object (for method chaining).
*/
public final Html manifest(String manifest) {
@@ -32,6 +32,7 @@ public class Html extends HtmlElementContainer {
return this;
}
+
//--------------------------------------------------------------------------------
// Overridden methods
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/dto/html5/HtmlElement.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/html5/HtmlElement.java b/juneau-core/src/main/java/org/apache/juneau/dto/html5/HtmlElement.java
index 7be2c18..d105866 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/html5/HtmlElement.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/html5/HtmlElement.java
@@ -87,7 +87,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/editing.html#the-accesskey-attribute">accesskey</a> attribute.
- * @param accesskey - The new value for this attribute.
+ * @param accesskey The new value for this attribute.
* @return This object (for method chaining).
*/
public final HtmlElement accesskey(String accesskey) {
@@ -97,7 +97,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/dom.html#classes">class</a> attribute.
- * @param _class - The new value for this attribute.
+ * @param _class The new value for this attribute.
* @return This object (for method chaining).
*/
public HtmlElement _class(String _class) {
@@ -107,7 +107,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/editing.html#attr-contenteditable">contenteditable</a> attribute.
- * @param contenteditable - The new value for this attribute.
+ * @param contenteditable The new value for this attribute.
* Typically a {@link Boolean} or {@link String}.
* @return This object (for method chaining).
*/
@@ -118,7 +118,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/dom.html#the-dir-attribute">dir</a> attribute.
- * @param dir - The new value for this attribute.
+ * @param dir The new value for this attribute.
* @return This object (for method chaining).
*/
public HtmlElement dir(String dir) {
@@ -128,7 +128,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/editing.html#the-hidden-attribute">hidden</a> attribute.
- * @param hidden - The new value for this attribute.
+ * @param hidden The new value for this attribute.
* Typically a {@link Boolean} or {@link String}.
* @return This object (for method chaining).
*/
@@ -139,7 +139,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/dom.html#the-id-attribute">id</a> attribute.
- * @param id - The new value for this attribute.
+ * @param id The new value for this attribute.
* @return This object (for method chaining).
*/
public HtmlElement id(String id) {
@@ -149,7 +149,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/dom.html#attr-lang">lang</a> attribute.
- * @param lang - The new value for this attribute.
+ * @param lang The new value for this attribute.
* @return This object (for method chaining).
*/
public final HtmlElement lang(String lang) {
@@ -159,7 +159,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/webappapis.html#handler-onabort">onabort</a> attribute.
- * @param onabort - The new value for this attribute.
+ * @param onabort The new value for this attribute.
* @return This object (for method chaining).
*/
public final HtmlElement onabort(String onabort) {
@@ -169,7 +169,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/webappapis.html#handler-onblur">onblur</a> attribute.
- * @param onblur - The new value for this attribute.
+ * @param onblur The new value for this attribute.
* @return This object (for method chaining).
*/
public final HtmlElement onblur(String onblur) {
@@ -179,7 +179,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/webappapis.html#handler-oncancel">oncancel</a> attribute.
- * @param oncancel - The new value for this attribute.
+ * @param oncancel The new value for this attribute.
* @return This object (for method chaining).
*/
public final HtmlElement oncancel(String oncancel) {
@@ -189,7 +189,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/webappapis.html#handler-oncanplay">oncanplay</a> attribute.
- * @param oncanplay - The new value for this attribute.
+ * @param oncanplay The new value for this attribute.
* @return This object (for method chaining).
*/
public final HtmlElement oncanplay(String oncanplay) {
@@ -199,7 +199,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/webappapis.html#handler-oncanplaythrough">oncanplaythrough</a> attribute.
- * @param oncanplaythrough - The new value for this attribute.
+ * @param oncanplaythrough The new value for this attribute.
* @return This object (for method chaining).
*/
public final HtmlElement oncanplaythrough(String oncanplaythrough) {
@@ -209,7 +209,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/webappapis.html#handler-onchange">onchange</a> attribute.
- * @param onchange - The new value for this attribute.
+ * @param onchange The new value for this attribute.
* @return This object (for method chaining).
*/
public final HtmlElement onchange(String onchange) {
@@ -219,7 +219,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/webappapis.html#handler-onclick">onclick</a> attribute.
- * @param onclick - The new value for this attribute.
+ * @param onclick The new value for this attribute.
* @return This object (for method chaining).
*/
public final HtmlElement onclick(String onclick) {
@@ -229,7 +229,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/webappapis.html#handler-oncuechange">oncuechange</a> attribute.
- * @param oncuechange - The new value for this attribute.
+ * @param oncuechange The new value for this attribute.
* @return This object (for method chaining).
*/
public final HtmlElement oncuechange(String oncuechange) {
@@ -239,7 +239,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/webappapis.html#handler-ondblclick">ondblclick</a> attribute.
- * @param ondblclick - The new value for this attribute.
+ * @param ondblclick The new value for this attribute.
* @return This object (for method chaining).
*/
public final HtmlElement ondblclick(String ondblclick) {
@@ -249,7 +249,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/webappapis.html#handler-ondurationchange">ondurationchange</a> attribute.
- * @param ondurationchange - The new value for this attribute.
+ * @param ondurationchange The new value for this attribute.
* @return This object (for method chaining).
*/
public final HtmlElement ondurationchange(String ondurationchange) {
@@ -259,7 +259,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/webappapis.html#handler-onemptied">onemptied</a> attribute.
- * @param onemptied - The new value for this attribute.
+ * @param onemptied The new value for this attribute.
* @return This object (for method chaining).
*/
public final HtmlElement onemptied(String onemptied) {
@@ -269,7 +269,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/webappapis.html#handler-onended">onended</a> attribute.
- * @param onended - The new value for this attribute.
+ * @param onended The new value for this attribute.
* @return This object (for method chaining).
*/
public final HtmlElement onended(String onended) {
@@ -279,7 +279,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/webappapis.html#handler-onerror">onerror</a> attribute.
- * @param onerror - The new value for this attribute.
+ * @param onerror The new value for this attribute.
* @return This object (for method chaining).
*/
public final HtmlElement onerror(String onerror) {
@@ -289,7 +289,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/webappapis.html#handler-onfocus">onfocus</a> attribute.
- * @param onfocus - The new value for this attribute.
+ * @param onfocus The new value for this attribute.
* @return This object (for method chaining).
*/
public final HtmlElement onfocus(String onfocus) {
@@ -299,7 +299,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/webappapis.html#handler-oninput">oninput</a> attribute.
- * @param oninput - The new value for this attribute.
+ * @param oninput The new value for this attribute.
* @return This object (for method chaining).
*/
public final HtmlElement oninput(String oninput) {
@@ -309,7 +309,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/webappapis.html#handler-oninvalid">oninvalid</a> attribute.
- * @param oninvalid - The new value for this attribute.
+ * @param oninvalid The new value for this attribute.
* @return This object (for method chaining).
*/
public final HtmlElement oninvalid(String oninvalid) {
@@ -319,7 +319,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/webappapis.html#handler-onkeydown">onkeydown</a> attribute.
- * @param onkeydown - The new value for this attribute.
+ * @param onkeydown The new value for this attribute.
* @return This object (for method chaining).
*/
public final HtmlElement onkeydown(String onkeydown) {
@@ -329,7 +329,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/webappapis.html#handler-onkeypress">onkeypress</a> attribute.
- * @param onkeypress - The new value for this attribute.
+ * @param onkeypress The new value for this attribute.
* @return This object (for method chaining).
*/
public final HtmlElement onkeypress(String onkeypress) {
@@ -339,7 +339,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/webappapis.html#handler-onkeyup">onkeyup</a> attribute.
- * @param onkeyup - The new value for this attribute.
+ * @param onkeyup The new value for this attribute.
* @return This object (for method chaining).
*/
public final HtmlElement onkeyup(String onkeyup) {
@@ -349,7 +349,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/webappapis.html#handler-onload">onload</a> attribute.
- * @param onload - The new value for this attribute.
+ * @param onload The new value for this attribute.
* @return This object (for method chaining).
*/
public final HtmlElement onload(String onload) {
@@ -359,7 +359,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/webappapis.html#handler-onloadeddata">onloadeddata</a> attribute.
- * @param onloadeddata - The new value for this attribute.
+ * @param onloadeddata The new value for this attribute.
* @return This object (for method chaining).
*/
public final HtmlElement onloadeddata(String onloadeddata) {
@@ -369,7 +369,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/webappapis.html#handler-onloadedmetadata">onloadedmetadata</a> attribute.
- * @param onloadedmetadata - The new value for this attribute.
+ * @param onloadedmetadata The new value for this attribute.
* @return This object (for method chaining).
*/
public final HtmlElement onloadedmetadata(String onloadedmetadata) {
@@ -379,7 +379,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/webappapis.html#handler-onloadstart">onloadstart</a> attribute.
- * @param onloadstart - The new value for this attribute.
+ * @param onloadstart The new value for this attribute.
* @return This object (for method chaining).
*/
public final HtmlElement onloadstart(String onloadstart) {
@@ -389,7 +389,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/webappapis.html#handler-onmousedown">onmousedown</a> attribute.
- * @param onmousedown - The new value for this attribute.
+ * @param onmousedown The new value for this attribute.
* @return This object (for method chaining).
*/
public final HtmlElement onmousedown(String onmousedown) {
@@ -399,7 +399,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/webappapis.html#handler-onmouseenter">onmouseenter</a> attribute.
- * @param onmouseenter - The new value for this attribute.
+ * @param onmouseenter The new value for this attribute.
* @return This object (for method chaining).
*/
public final HtmlElement onmouseenter(String onmouseenter) {
@@ -409,7 +409,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/webappapis.html#handler-onmouseleave">onmouseleave</a> attribute.
- * @param onmouseleave - The new value for this attribute.
+ * @param onmouseleave The new value for this attribute.
* @return This object (for method chaining).
*/
public final HtmlElement onmouseleave(String onmouseleave) {
@@ -419,7 +419,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/webappapis.html#handler-onmousemove">onmousemove</a> attribute.
- * @param onmousemove - The new value for this attribute.
+ * @param onmousemove The new value for this attribute.
* @return This object (for method chaining).
*/
public final HtmlElement onmousemove(String onmousemove) {
@@ -429,7 +429,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/webappapis.html#handler-onmouseout">onmouseout</a> attribute.
- * @param onmouseout - The new value for this attribute.
+ * @param onmouseout The new value for this attribute.
* @return This object (for method chaining).
*/
public final HtmlElement onmouseout(String onmouseout) {
@@ -439,7 +439,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/webappapis.html#handler-onmouseover">onmouseover</a> attribute.
- * @param onmouseover - The new value for this attribute.
+ * @param onmouseover The new value for this attribute.
* @return This object (for method chaining).
*/
public final HtmlElement onmouseover(String onmouseover) {
@@ -449,7 +449,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/webappapis.html#handler-onmouseup">onmouseup</a> attribute.
- * @param onmouseup - The new value for this attribute.
+ * @param onmouseup The new value for this attribute.
* @return This object (for method chaining).
*/
public final HtmlElement onmouseup(String onmouseup) {
@@ -459,7 +459,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/webappapis.html#handler-onmousewheel">onmousewheel</a> attribute.
- * @param onmousewheel - The new value for this attribute.
+ * @param onmousewheel The new value for this attribute.
* @return This object (for method chaining).
*/
public final HtmlElement onmousewheel(String onmousewheel) {
@@ -469,7 +469,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/webappapis.html#handler-onpause">onpause</a> attribute.
- * @param onpause - The new value for this attribute.
+ * @param onpause The new value for this attribute.
* @return This object (for method chaining).
*/
public final HtmlElement onpause(String onpause) {
@@ -479,7 +479,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/webappapis.html#handler-onplay">onplay</a> attribute.
- * @param onplay - The new value for this attribute.
+ * @param onplay The new value for this attribute.
* @return This object (for method chaining).
*/
public final HtmlElement onplay(String onplay) {
@@ -489,7 +489,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/webappapis.html#handler-onplaying">onplaying</a> attribute.
- * @param onplaying - The new value for this attribute.
+ * @param onplaying The new value for this attribute.
* @return This object (for method chaining).
*/
public final HtmlElement onplaying(String onplaying) {
@@ -499,7 +499,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/webappapis.html#handler-onprogress">onprogress</a> attribute.
- * @param onprogress - The new value for this attribute.
+ * @param onprogress The new value for this attribute.
* @return This object (for method chaining).
*/
public final HtmlElement onprogress(String onprogress) {
@@ -509,7 +509,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/webappapis.html#handler-onratechange">onratechange</a> attribute.
- * @param onratechange - The new value for this attribute.
+ * @param onratechange The new value for this attribute.
* @return This object (for method chaining).
*/
public final HtmlElement onratechange(String onratechange) {
@@ -519,7 +519,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/webappapis.html#handler-onreset">onreset</a> attribute.
- * @param onreset - The new value for this attribute.
+ * @param onreset The new value for this attribute.
* @return This object (for method chaining).
*/
public final HtmlElement onreset(String onreset) {
@@ -529,7 +529,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/webappapis.html#handler-onresize">onresize</a> attribute.
- * @param onresize - The new value for this attribute.
+ * @param onresize The new value for this attribute.
* @return This object (for method chaining).
*/
public final HtmlElement onresize(String onresize) {
@@ -539,7 +539,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/webappapis.html#handler-onscroll">onscroll</a> attribute.
- * @param onscroll - The new value for this attribute.
+ * @param onscroll The new value for this attribute.
* @return This object (for method chaining).
*/
public final HtmlElement onscroll(String onscroll) {
@@ -549,7 +549,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/webappapis.html#handler-onseeked">onseeked</a> attribute.
- * @param onseeked - The new value for this attribute.
+ * @param onseeked The new value for this attribute.
* @return This object (for method chaining).
*/
public final HtmlElement onseeked(String onseeked) {
@@ -559,7 +559,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/webappapis.html#handler-onseeking">onseeking</a> attribute.
- * @param onseeking - The new value for this attribute.
+ * @param onseeking The new value for this attribute.
* @return This object (for method chaining).
*/
public final HtmlElement onseeking(String onseeking) {
@@ -569,7 +569,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/webappapis.html#handler-onselect">onselect</a> attribute.
- * @param onselect - The new value for this attribute.
+ * @param onselect The new value for this attribute.
* @return This object (for method chaining).
*/
public final HtmlElement onselect(String onselect) {
@@ -579,7 +579,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/webappapis.html#handler-onshow">onshow</a> attribute.
- * @param onshow - The new value for this attribute.
+ * @param onshow The new value for this attribute.
* @return This object (for method chaining).
*/
public final HtmlElement onshow(String onshow) {
@@ -589,7 +589,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/webappapis.html#handler-onstalled">onstalled</a> attribute.
- * @param onstalled - The new value for this attribute.
+ * @param onstalled The new value for this attribute.
* @return This object (for method chaining).
*/
public final HtmlElement onstalled(String onstalled) {
@@ -599,7 +599,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/webappapis.html#handler-onsubmit">onsubmit</a> attribute.
- * @param onsubmit - The new value for this attribute.
+ * @param onsubmit The new value for this attribute.
* @return This object (for method chaining).
*/
public final HtmlElement onsubmit(String onsubmit) {
@@ -609,7 +609,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/webappapis.html#handler-onsuspend">onsuspend</a> attribute.
- * @param onsuspend - The new value for this attribute.
+ * @param onsuspend The new value for this attribute.
* @return This object (for method chaining).
*/
public final HtmlElement onsuspend(String onsuspend) {
@@ -619,7 +619,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/webappapis.html#handler-ontimeupdate">ontimeupdate</a> attribute.
- * @param ontimeupdate - The new value for this attribute.
+ * @param ontimeupdate The new value for this attribute.
* @return This object (for method chaining).
*/
public final HtmlElement ontimeupdate(String ontimeupdate) {
@@ -629,7 +629,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/webappapis.html#handler-ontoggle">ontoggle</a> attribute.
- * @param ontoggle - The new value for this attribute.
+ * @param ontoggle The new value for this attribute.
* @return This object (for method chaining).
*/
public final HtmlElement ontoggle(String ontoggle) {
@@ -639,7 +639,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/webappapis.html#handler-onvolumechange">onvolumechange</a> attribute.
- * @param onvolumechange - The new value for this attribute.
+ * @param onvolumechange The new value for this attribute.
* @return This object (for method chaining).
*/
public final HtmlElement onvolumechange(String onvolumechange) {
@@ -649,7 +649,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/webappapis.html#handler-onwaiting">onwaiting</a> attribute.
- * @param onwaiting - The new value for this attribute.
+ * @param onwaiting The new value for this attribute.
* @return This object (for method chaining).
*/
public final HtmlElement onwaiting(String onwaiting) {
@@ -659,7 +659,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/editing.html#attr-spellcheck">spellcheck</a> attribute.
- * @param spellcheck - The new value for this attribute.
+ * @param spellcheck The new value for this attribute.
* Typically a {@link Boolean} or {@link String}.
* @return This object (for method chaining).
*/
@@ -670,7 +670,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/dom.html#the-style-attribute">style</a> attribute.
- * @param style - The new value for this attribute.
+ * @param style The new value for this attribute.
* @return This object (for method chaining).
*/
public HtmlElement style(String style) {
@@ -680,7 +680,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/editing.html#attr-tabindex">tabindex</a> attribute.
- * @param tabindex - The new value for this attribute.
+ * @param tabindex The new value for this attribute.
* Typically a {@link Number} or {@link String}.
* @return This object (for method chaining).
*/
@@ -691,7 +691,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/dom.html#attr-title">title</a> attribute.
- * @param title - The new value for this attribute.
+ * @param title The new value for this attribute.
* @return This object (for method chaining).
*/
public HtmlElement title(String title) {
@@ -701,7 +701,7 @@ public abstract class HtmlElement {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/dom.html#attr-translate">translate</a> attribute.
- * @param translate - The new value for this attribute.
+ * @param translate The new value for this attribute.
* Typically a {@link Number} or {@link String}.
* @return This object (for method chaining).
*/
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/dto/html5/HtmlElementText.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/html5/HtmlElementText.java b/juneau-core/src/main/java/org/apache/juneau/dto/html5/HtmlElementText.java
index 1be7d22..5c66b7e 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/html5/HtmlElementText.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/html5/HtmlElementText.java
@@ -46,7 +46,7 @@ public class HtmlElementText extends HtmlElement {
/**
* Sets the text node on this element.
*
- * @param text - The text node to add to this element.
+ * @param text The text node to add to this element.
* @return This object (for method chaining).
*/
public HtmlElement text(Object text) {
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/dto/html5/Iframe.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Iframe.java b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Iframe.java
index 90db050..ee4bf52 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Iframe.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Iframe.java
@@ -26,7 +26,7 @@ public class Iframe extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-dim-height">height</a> attribute.
* Vertical dimension.
- * @param height - The new value for this attribute.
+ * @param height The new value for this attribute.
* Typically a {@link Number} or {@link String}.
* @return This object (for method chaining).
*/
@@ -38,7 +38,7 @@ public class Iframe extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-iframe-name">name</a> attribute.
* Name of nested browsing context.
- * @param name - The new value for this attribute.
+ * @param name The new value for this attribute.
* @return This object (for method chaining).
*/
public final Iframe name(String name) {
@@ -49,7 +49,7 @@ public class Iframe extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-iframe-sandbox">sandbox</a> attribute.
* Security rules for nested content.
- * @param sandbox - The new value for this attribute.
+ * @param sandbox The new value for this attribute.
* @return This object (for method chaining).
*/
public final Iframe sandbox(String sandbox) {
@@ -60,7 +60,7 @@ public class Iframe extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-iframe-src">src</a> attribute.
* Address of the resource.
- * @param src - The new value for this attribute.
+ * @param src The new value for this attribute.
* Typically a {@link URL} or {@link String}.
* @return This object (for method chaining).
*/
@@ -72,7 +72,7 @@ public class Iframe extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-iframe-srcdoc">srcdoc</a> attribute.
* A document to render in the iframe.
- * @param srcdoc - The new value for this attribute.
+ * @param srcdoc The new value for this attribute.
* @return This object (for method chaining).
*/
public final Iframe srcdoc(String srcdoc) {
@@ -83,7 +83,7 @@ public class Iframe extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-dim-width">width</a> attribute.
* Horizontal dimension.
- * @param width - The new value for this attribute.
+ * @param width The new value for this attribute.
* Typically a {@link Number} or {@link String}.
* @return This object (for method chaining).
*/
@@ -92,6 +92,7 @@ public class Iframe extends HtmlElementMixed {
return this;
}
+
//--------------------------------------------------------------------------------
// Overridden methods
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/dto/html5/Img.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Img.java b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Img.java
index 8fcca78..8b50045 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Img.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Img.java
@@ -25,7 +25,7 @@ public class Img extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-img-alt">alt</a> attribute.
* Replacement text for use when images are not available.
- * @param alt - The new value for this attribute.
+ * @param alt The new value for this attribute.
* @return This object (for method chaining).
*/
public final Img alt(String alt) {
@@ -36,7 +36,7 @@ public class Img extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-img-crossorigin">crossorigin</a> attribute.
* How the element handles crossorigin requests.
- * @param crossorigin - The new value for this attribute.
+ * @param crossorigin The new value for this attribute.
* @return This object (for method chaining).
*/
public final Img crossorigin(String crossorigin) {
@@ -47,7 +47,7 @@ public class Img extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-dim-height">height</a> attribute.
* Vertical dimension.
- * @param height - The new value for this attribute.
+ * @param height The new value for this attribute.
* Typically a {@link Number} or {@link String}.
* @return This object (for method chaining).
*/
@@ -59,7 +59,7 @@ public class Img extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-img-ismap">ismap</a> attribute.
* Whether the image is a server-side image map.
- * @param ismap - The new value for this attribute.
+ * @param ismap The new value for this attribute.
* Typically a {@link Boolean} or {@link String}.
* @return This object (for method chaining).
*/
@@ -71,7 +71,7 @@ public class Img extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-img-src">src</a> attribute.
* Address of the resource.
- * @param src - The new value for this attribute.
+ * @param src The new value for this attribute.
* Typically a {@link URL} or {@link String}.
* @return This object (for method chaining).
*/
@@ -83,7 +83,7 @@ public class Img extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-hyperlink-usemap">usemap</a> attribute.
* Name of image map to use.
- * @param usemap - The new value for this attribute.
+ * @param usemap The new value for this attribute.
* @return This object (for method chaining).
*/
public final Img usemap(String usemap) {
@@ -94,7 +94,7 @@ public class Img extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-dim-width">width</a> attribute.
* Horizontal dimension.
- * @param width - The new value for this attribute.
+ * @param width The new value for this attribute.
* Typically a {@link Number} or {@link String}.
* @return This object (for method chaining).
*/
@@ -103,6 +103,7 @@ public class Img extends HtmlElementEmpty {
return this;
}
+
//--------------------------------------------------------------------------------
// Overridden methods
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/dto/html5/Input.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Input.java b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Input.java
index b509073..fbbfd9b 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Input.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Input.java
@@ -26,7 +26,7 @@ public class Input extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-input-accept">accept</a> attribute.
* Hint for expected file type in file upload controls.
- * @param accept - The new value for this attribute.
+ * @param accept The new value for this attribute.
* @return This object (for method chaining).
*/
public final Input accept(String accept) {
@@ -37,7 +37,7 @@ public class Input extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-input-alt">alt</a> attribute.
* Replacement text for use when images are not available.
- * @param alt - The new value for this attribute.
+ * @param alt The new value for this attribute.
* @return This object (for method chaining).
*/
public final Input alt(String alt) {
@@ -48,7 +48,7 @@ public class Input extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fe-autocomplete">autocomplete</a> attribute.
* Hint for form autofill feature.
- * @param autocomplete - The new value for this attribute.
+ * @param autocomplete The new value for this attribute.
* @return This object (for method chaining).
*/
public final Input autocomplete(String autocomplete) {
@@ -59,7 +59,7 @@ public class Input extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fe-autofocus">autofocus</a> attribute.
* Automatically focus the form control when the page is loaded.
- * @param autofocus - The new value for this attribute.
+ * @param autofocus The new value for this attribute.
* @return This object (for method chaining).
*/
public final Input autofocus(String autofocus) {
@@ -70,7 +70,7 @@ public class Input extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-input-checked">checked</a> attribute.
* Whether the command or control is checked.
- * @param checked - The new value for this attribute.
+ * @param checked The new value for this attribute.
* Typically a {@link Boolean} or {@link String}.
* @return This object (for method chaining).
*/
@@ -82,7 +82,7 @@ public class Input extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fe-dirname">dirname</a> attribute.
* Name of form field to use for sending the element's directionality in form submission.
- * @param dirname - The new value for this attribute.
+ * @param dirname The new value for this attribute.
* @return This object (for method chaining).
*/
public final Input dirname(String dirname) {
@@ -93,7 +93,7 @@ public class Input extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fe-disabled">disabled</a> attribute.
* Whether the form control is disabled.
- * @param disabled - The new value for this attribute.
+ * @param disabled The new value for this attribute.
* Typically a {@link Boolean} or {@link String}.
* @return This object (for method chaining).
*/
@@ -105,7 +105,7 @@ public class Input extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fae-form">form</a> attribute.
* Associates the control with a form element.
- * @param form - The new value for this attribute.
+ * @param form The new value for this attribute.
* @return This object (for method chaining).
*/
public final Input form(String form) {
@@ -116,7 +116,7 @@ public class Input extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fs-formaction">formaction</a> attribute.
* URL to use for form submission.
- * @param formaction - The new value for this attribute.
+ * @param formaction The new value for this attribute.
* @return This object (for method chaining).
*/
public final Input formaction(String formaction) {
@@ -127,7 +127,7 @@ public class Input extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fs-formenctype">formenctype</a> attribute.
* Form data set encoding type to use for form submission.
- * @param formenctype - The new value for this attribute.
+ * @param formenctype The new value for this attribute.
* @return This object (for method chaining).
*/
public final Input formenctype(String formenctype) {
@@ -138,7 +138,7 @@ public class Input extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fs-formmethod">formmethod</a> attribute.
* HTTP method to use for form submission.
- * @param formmethod - The new value for this attribute.
+ * @param formmethod The new value for this attribute.
* @return This object (for method chaining).
*/
public final Input formmethod(String formmethod) {
@@ -149,7 +149,7 @@ public class Input extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fs-formnovalidate">formnovalidate</a> attribute.
* Bypass form control validation for form submission.
- * @param formnovalidate - The new value for this attribute.
+ * @param formnovalidate The new value for this attribute.
* @return This object (for method chaining).
*/
public final Input formnovalidate(String formnovalidate) {
@@ -160,7 +160,7 @@ public class Input extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fs-formtarget">formtarget</a> attribute.
* Browsing context for form submission.
- * @param formtarget - The new value for this attribute.
+ * @param formtarget The new value for this attribute.
* @return This object (for method chaining).
*/
public final Input formtarget(String formtarget) {
@@ -171,7 +171,7 @@ public class Input extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-dim-height">height</a> attribute.
* Vertical dimension.
- * @param height - The new value for this attribute.
+ * @param height The new value for this attribute.
* Typically a {@link Number} or {@link String}.
* @return This object (for method chaining).
*/
@@ -183,7 +183,7 @@ public class Input extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-input-inputmode">inputmode</a> attribute.
* Hint for selecting an input modality.
- * @param inputmode - The new value for this attribute.
+ * @param inputmode The new value for this attribute.
* @return This object (for method chaining).
*/
public final Input inputmode(String inputmode) {
@@ -194,7 +194,7 @@ public class Input extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-input-list">list</a> attribute.
* List of autocomplete options.
- * @param list - The new value for this attribute.
+ * @param list The new value for this attribute.
* @return This object (for method chaining).
*/
public final Input list(String list) {
@@ -205,7 +205,7 @@ public class Input extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-input-max">max</a> attribute.
* Maximum value.
- * @param max - The new value for this attribute.
+ * @param max The new value for this attribute.
* Typically a {@link Number} or {@link String}.
* @return This object (for method chaining).
*/
@@ -217,7 +217,7 @@ public class Input extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-input-maxlength">maxlength</a> attribute.
* Maximum length of value.
- * @param maxlength - The new value for this attribute.
+ * @param maxlength The new value for this attribute.
* Typically a {@link Number} or {@link String}.
* @return This object (for method chaining).
*/
@@ -229,7 +229,7 @@ public class Input extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-input-min">min</a> attribute.
* Minimum value.
- * @param min - The new value for this attribute.
+ * @param min The new value for this attribute.
* Typically a {@link Number} or {@link String}.
* @return This object (for method chaining).
*/
@@ -241,7 +241,7 @@ public class Input extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-input-minlength">minlength</a> attribute.
* Minimum length of value.
- * @param minlength - The new value for this attribute.
+ * @param minlength The new value for this attribute.
* Typically a {@link Number} or {@link String}.
* @return This object (for method chaining).
*/
@@ -253,7 +253,7 @@ public class Input extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-input-multiple">multiple</a> attribute.
* Whether to allow multiple values.
- * @param multiple - The new value for this attribute.
+ * @param multiple The new value for this attribute.
* Typically a {@link Boolean} or {@link String}.
* @return This object (for method chaining).
*/
@@ -265,7 +265,7 @@ public class Input extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fe-name">name</a> attribute.
* Name of form control to use for form submission and in the form.elements API.
- * @param name - The new value for this attribute.
+ * @param name The new value for this attribute.
* @return This object (for method chaining).
*/
public final Input name(String name) {
@@ -276,7 +276,7 @@ public class Input extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-input-pattern">pattern</a> attribute.
* Pattern to be matched by the form control's value.
- * @param pattern - The new value for this attribute.
+ * @param pattern The new value for this attribute.
* @return This object (for method chaining).
*/
public final Input pattern(String pattern) {
@@ -287,7 +287,7 @@ public class Input extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-input-placeholder">placeholder</a> attribute.
* User-visible label to be placed within the form control.
- * @param placeholder - The new value for this attribute.
+ * @param placeholder The new value for this attribute.
* @return This object (for method chaining).
*/
public final Input placeholder(String placeholder) {
@@ -298,7 +298,7 @@ public class Input extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-input-readonly">readonly</a> attribute.
* Whether to allow the value to be edited by the user.
- * @param readonly - The new value for this attribute.
+ * @param readonly The new value for this attribute.
* Typically a {@link Boolean} or {@link String}.
* @return This object (for method chaining).
*/
@@ -310,7 +310,7 @@ public class Input extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-input-readonly">required</a> attribute.
* Whether the control is required for form submission.
- * @param required - The new value for this attribute.
+ * @param required The new value for this attribute.
* Typically a {@link Boolean} or {@link String}.
* @return This object (for method chaining).
*/
@@ -322,7 +322,7 @@ public class Input extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-input-size">size</a> attribute.
* Size of the control.
- * @param size - The new value for this attribute.
+ * @param size The new value for this attribute.
* Typically a {@link Number} or {@link String}.
* @return This object (for method chaining).
*/
@@ -334,7 +334,7 @@ public class Input extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-input-src">src</a> attribute.
* Address of the resource.
- * @param src - The new value for this attribute.
+ * @param src The new value for this attribute.
* Typically a {@link URL} or {@link String}.
* @return This object (for method chaining).
*/
@@ -346,7 +346,7 @@ public class Input extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-input-step">step</a> attribute.
* Granularity to be matched by the form control's value.
- * @param step - The new value for this attribute.
+ * @param step The new value for this attribute.
* @return This object (for method chaining).
*/
public final Input step(String step) {
@@ -357,7 +357,7 @@ public class Input extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-input-type">type</a> attribute.
* Type of form control.
- * @param type - The new value for this attribute.
+ * @param type The new value for this attribute.
* @return This object (for method chaining).
*/
public final Input type(String type) {
@@ -368,7 +368,7 @@ public class Input extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-input-value">value</a> attribute.
* Value of the form control.
- * @param value - The new value for this attribute.
+ * @param value The new value for this attribute.
* Typically a {@link Number} or {@link String}.
* @return This object (for method chaining).
*/
@@ -380,7 +380,7 @@ public class Input extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/embedded-content-0.html#attr-dim-width">width</a> attribute.
* Horizontal dimension.
- * @param width - The new value for this attribute.
+ * @param width The new value for this attribute.
* Typically a {@link Number} or {@link String}.
* @return This object (for method chaining).
*/
@@ -389,6 +389,7 @@ public class Input extends HtmlElementEmpty {
return this;
}
+
//--------------------------------------------------------------------------------
// Overridden methods
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/dto/html5/Ins.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Ins.java b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Ins.java
index 8ed4f2d..0939c50 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Ins.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Ins.java
@@ -24,7 +24,7 @@ public class Ins extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/edits.html#attr-mod-cite">cite</a> attribute.
* Link to the source of the quotation or more information about the edit.
- * @param cite - The new value for this attribute.
+ * @param cite The new value for this attribute.
* @return This object (for method chaining).
*/
public final Ins cite(String cite) {
@@ -35,7 +35,7 @@ public class Ins extends HtmlElementMixed {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/edits.html#attr-mod-datetime">datetime</a> attribute.
* Date and (optionally) time of the change.
- * @param datetime - The new value for this attribute.
+ * @param datetime The new value for this attribute.
* @return This object (for method chaining).
*/
public final Ins datetime(String datetime) {
@@ -43,6 +43,7 @@ public class Ins extends HtmlElementMixed {
return this;
}
+
//--------------------------------------------------------------------------------
// Overridden methods
//--------------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core/src/main/java/org/apache/juneau/dto/html5/Keygen.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Keygen.java b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Keygen.java
index b21e5c0..1ad6617 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Keygen.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Keygen.java
@@ -24,7 +24,7 @@ public class Keygen extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fe-autofocus">autofocus</a> attribute.
* Automatically focus the form control when the page is loaded.
- * @param autofocus - The new value for this attribute.
+ * @param autofocus The new value for this attribute.
* Typically a {@link Boolean} or {@link String}.
* @return This object (for method chaining).
*/
@@ -36,7 +36,7 @@ public class Keygen extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-keygen-challenge">challenge</a> attribute.
* String to package with the generated and signed public key.
- * @param challenge - The new value for this attribute.
+ * @param challenge The new value for this attribute.
* @return This object (for method chaining).
*/
public final Keygen challenge(String challenge) {
@@ -47,7 +47,7 @@ public class Keygen extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fe-disabled">disabled</a> attribute.
* Whether the form control is disabled.
- * @param disabled - The new value for this attribute.
+ * @param disabled The new value for this attribute.
* Typically a {@link Boolean} or {@link String}.
* @return This object (for method chaining).
*/
@@ -59,7 +59,7 @@ public class Keygen extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fae-form">form</a> attribute.
* Associates the control with a form element.
- * @param form - The new value for this attribute.
+ * @param form The new value for this attribute.
* @return This object (for method chaining).
*/
public final Keygen form(String form) {
@@ -70,7 +70,7 @@ public class Keygen extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-keygen-keytype">keytype</a> attribute.
* The type of cryptographic key to generate.
- * @param keytype - The new value for this attribute.
+ * @param keytype The new value for this attribute.
* @return This object (for method chaining).
*/
public final Keygen keytype(String keytype) {
@@ -81,7 +81,7 @@ public class Keygen extends HtmlElementEmpty {
/**
* <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fe-name">name</a> attribute.
* Name of form control to use for form submission and in the form.elements API.
- * @param name - The new value for this attribute.
+ * @param name The new value for this attribute.
* @return This object (for method chaining).
*/
public final Keygen name(String name) {
@@ -89,6 +89,7 @@ public class Keygen extends HtmlElementEmpty {
return this;
}
+
//--------------------------------------------------------------------------------
// Overridden methods
//--------------------------------------------------------------------------------