You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@juneau.apache.org by ja...@apache.org on 2018/01/07 21:28:36 UTC
[4/5] juneau git commit: Sort methods in builder classes.
http://git-wip-us.apache.org/repos/asf/juneau/blob/45640a1a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanContextBuilder.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanContextBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanContextBuilder.java
index 73784e3..a73b80b 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanContextBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanContextBuilder.java
@@ -56,202 +56,162 @@ public class BeanContextBuilder extends ContextBuilder {
// Properties
//--------------------------------------------------------------------------------
- @Override /* ContextBuilder */
- public BeanContextBuilder set(String name, Object value) {
- super.set(name, value);
- return this;
- }
-
- @Override /* ContextBuilder */
- public BeanContextBuilder set(boolean append, String name, Object value) {
- super.set(append, name, value);
- return this;
- }
-
- @Override /* ContextBuilder */
- public BeanContextBuilder set(Map<String,Object> properties) {
- super.set(properties);
- return this;
- }
-
- @Override /* ContextBuilder */
- public BeanContextBuilder add(Map<String,Object> properties) {
- super.add(properties);
- return this;
- }
-
- @Override /* ContextBuilder */
- public BeanContextBuilder addTo(String name, Object value) {
- super.addTo(name, value);
- return this;
- }
-
- @Override /* ContextBuilder */
- public BeanContextBuilder addTo(String name, String key, Object value) {
- super.addTo(name, key, value);
- return this;
- }
-
- @Override /* ContextBuilder */
- public BeanContextBuilder removeFrom(String name, Object value) {
- super.removeFrom(name, value);
- return this;
- }
-
/**
- * Configuration property: Beans require no-arg constructors.
- *
- * <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 Object#toString()} method.
+ * Configuration property: Look for bean classes with the specified minimum visibility.
*
* <p>
- * The {@link Bean @Bean} annotation can be used on a class to override this setting when <jk>true</jk>.
+ * 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.
*
* <h5 class='section'>Notes:</h5>
* <ul>
- * <li>This is equivalent to calling <code>property(<jsf>BEAN_beansRequireDefaultConstructor</jsf>, value)</code>.
+ * <li>This is equivalent to calling <code>property(<jsf>BEAN_beanClassVisibility</jsf>, value)</code>.
* </ul>
*
* @param value The new value for this property.
* @return This object (for method chaining).
- * @see BeanContext#BEAN_beansRequireDefaultConstructor
+ * @see BeanContext#BEAN_beanClassVisibility
*/
- public BeanContextBuilder beansRequireDefaultConstructor(boolean value) {
- return set(BEAN_beansRequireDefaultConstructor, value);
+ public BeanContextBuilder beanClassVisibility(Visibility value) {
+ return set(BEAN_beanClassVisibility, value);
}
/**
- * Configuration property: Beans require {@link Serializable} interface.
- *
- * <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 Object#toString()} method.
+ * Configuration property: Look for bean constructors with the specified minimum visibility.
*
* <p>
- * The {@link Bean @Bean} annotation can be used on a class to override this setting when <jk>true</jk>.
+ * 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.
*
* <h5 class='section'>Notes:</h5>
* <ul>
- * <li>This is equivalent to calling <code>property(<jsf>BEAN_beansRequireSerializable</jsf>, value)</code>.
+ * <li>This is equivalent to calling <code>property(<jsf>BEAN_beanConstructorVisibility</jsf>, value)</code>.
* </ul>
*
* @param value The new value for this property.
* @return This object (for method chaining).
- * @see BeanContext#BEAN_beansRequireSerializable
+ * @see BeanContext#BEAN_beanConstructorVisibility
*/
- public BeanContextBuilder beansRequireSerializable(boolean value) {
- return set(BEAN_beansRequireSerializable, value);
+ public BeanContextBuilder beanConstructorVisibility(Visibility value) {
+ return set(BEAN_beanConstructorVisibility, value);
}
/**
- * Configuration property: Beans require setters for getters.
- *
- * <p>
- * If <jk>true</jk>, only getters that have equivalent setters will be considered as properties on a bean.
- * Otherwise, they will be ignored.
+ * Configuration property: Bean lookup dictionary.
+ *
+ * <h6 class='figure'>Example:</h6>
*
* <h5 class='section'>Notes:</h5>
* <ul>
- * <li>This is equivalent to calling <code>property(<jsf>BEAN_beansRequireSettersForGetters</jsf>, value)</code>.
+ * <li>This is equivalent to calling <code>property(<jsf>BEAN_beanDictionary</jsf>, values)</code>.
* </ul>
- *
- * @param value The new value for this property.
+ *
+ * @param append
+ * If <jk>true</jk>, the previous value is appended to. Otherwise, the previous value is replaced.
+ * @param values
+ * The new value for this property.
+ * <br>Values can be any of the following types:
+ * <ul>
+ * <li>Any bean class that specifies a value for {@link Bean#typeName() @Bean.typeName()}.
+ * <li>Any subclass of {@link BeanDictionaryList} containing a collection of bean classes with type name
+ * annotations.
+ * <li>Any subclass of {@link BeanDictionaryMap} containing a mapping of type names to classes without type name
+ * annotations.
+ * <li>Any array or collection of the types above:
+ * </ul>
* @return This object (for method chaining).
- * @see BeanContext#BEAN_beansRequireSettersForGetters
+ * @see BeanContext#BEAN_beanDictionary
*/
- public BeanContextBuilder beansRequireSettersForGetters(boolean value) {
- return set(BEAN_beansRequireSettersForGetters, value);
+ public BeanContextBuilder beanDictionary(boolean append, Object...values) {
+ return set(append, BEAN_beanDictionary, values);
}
/**
- * Configuration property: Beans require at least one property.
- *
- * <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 Object#toString()} method.
- *
+ * Configuration property: Bean lookup dictionary.
+ *
* <p>
- * The {@link Bean @Bean} annotation can be used on a class to override this setting when <jk>true</jk>.
- *
- * <h5 class='section'>Notes:</h5>
- * <ul>
- * <li>This is equivalent to calling <code>property(<jsf>BEAN_beansRequireSomeProperties</jsf>, value)</code>.
- * </ul>
+ * Same as calling {@link #beanDictionary(Object...)} but with an array of classes.
*
- * @param value The new value for this property.
+ * @param values The values to add to this property.
* @return This object (for method chaining).
- * @see BeanContext#BEAN_beansRequireSomeProperties
*/
- public BeanContextBuilder beansRequireSomeProperties(boolean value) {
- return set(BEAN_beansRequireSomeProperties, value);
+ public BeanContextBuilder beanDictionary(Class<?>...values) {
+ return addTo(BEAN_beanDictionary, values);
}
/**
- * Configuration property: {@link BeanMap#put(String,Object) BeanMap.put()} method will return old property
- * value.
+ * Configuration property: Bean lookup dictionary.
*
* <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>.
- *
+ * The list of classes that make up the bean dictionary in this bean context.
+ *
* <p>
- * Disabled by default because it introduces a slight performance penalty.
- *
- * <h5 class='section'>Notes:</h5>
- * <ul>
- * <li>This is equivalent to calling <code>property(<jsf>BEAN_beanMapPutReturnsOldValue</jsf>, value)</code>.
- * </ul>
- *
- * @param value The new value for this property.
- * @return This object (for method chaining).
- * @see BeanContext#BEAN_beanMapPutReturnsOldValue
- */
- public BeanContextBuilder beanMapPutReturnsOldValue(boolean value) {
- return set(BEAN_beanMapPutReturnsOldValue, value);
- }
-
- /**
- * Configuration property: Look for bean constructors with the specified minimum visibility.
+ * A dictionary is a name/class mapping used to find class types during parsing when they cannot be inferred
+ * through reflection.
+ * <br>The names are defined through the {@link Bean#typeName()} annotation defined on the bean class.
+ *
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode'>
+ * BeanContext bc = BeanContext.<jsf>create</jsf>().beanDictionary(Bar.<jk>class</jk>, Baz.<jk>class</jk>).build();
+ * </p>
*
* <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.
- *
* <h5 class='section'>Notes:</h5>
- * <ul>
- * <li>This is equivalent to calling <code>property(<jsf>BEAN_beanConstructorVisibility</jsf>, value)</code>.
- * </ul>
+ * <ul class='spaced-list'>
+ * <li>Properties:
+ * <ul>
+ * <li>{@link BeanContext#BEAN_beanDictionary}
+ * <li>{@link BeanContext#BEAN_beanDictionary_add}
+ * <li>{@link BeanContext#BEAN_beanDictionary_remove}
+ * </ul>
+ * <li>Annotations:
+ * <ul>
+ * <li>{@link Bean#beanDictionary()}
+ * <li>{@link BeanProperty#beanDictionary()}
+ * </ul>
+ * <li>Methods:
+ * <ul>
+ * <li>{@link BeanContextBuilder#beanDictionary(Object...)}
+ * <li>{@link BeanContextBuilder#beanDictionary(boolean,Object...)}
+ * <li>{@link BeanContextBuilder#beanDictionaryRemove(Object...)}
+ * </ul>
+ * <li>Values can consist of any of the following types:
+ * <ul>
+ * <li>Any bean class that specifies a value for {@link Bean#typeName() @Bean.typeName()}.
+ * <li>Any subclass of {@link BeanDictionaryList} containing a collection of bean classes with type name
+ * annotations.
+ * <li>Any subclass of {@link BeanDictionaryMap} containing a mapping of type names to classes without type name
+ * annotations.
+ * </ul>
+ * <li>See <a class='doclink' href='../../../overview-summary.html#juneau-marshall.BeanDictionaries'>Bean Names and Dictionaries</a>
+ * for more information.
+ * </ul>
*
- * @param value The new value for this property.
+ * @param values The values to add to this property.
* @return This object (for method chaining).
- * @see BeanContext#BEAN_beanConstructorVisibility
*/
- public BeanContextBuilder beanConstructorVisibility(Visibility value) {
- return set(BEAN_beanConstructorVisibility, value);
+ public BeanContextBuilder beanDictionary(Object...values) {
+ return addTo(BEAN_beanDictionary, values);
}
/**
- * Configuration property: Look for bean classes with the specified minimum visibility.
- *
- * <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.
+ * Configuration property: Remove from bean dictionary.
*
* <h5 class='section'>Notes:</h5>
* <ul>
- * <li>This is equivalent to calling <code>property(<jsf>BEAN_beanClassVisibility</jsf>, value)</code>.
+ * <li>This is equivalent to calling <code>removeFromProperty(<jsf>BEAN_beanDictionary</jsf>, values)</code>
+ * or <code>property(<jsf>BEAN_beanDictionary_remove</jsf>, values)</code>.
* </ul>
*
- * @param value The new value for this property.
+ * @param values The values to remove from this property.
* @return This object (for method chaining).
- * @see BeanContext#BEAN_beanClassVisibility
+ * @see BeanContext#BEAN_beanDictionary
+ * @see BeanContext#BEAN_beanDictionary_remove
*/
- public BeanContextBuilder beanClassVisibility(Visibility value) {
- return set(BEAN_beanClassVisibility, value);
+ public BeanContextBuilder beanDictionaryRemove(Object...values) {
+ return removeFrom(BEAN_beanDictionary, values);
}
/**
@@ -277,524 +237,434 @@ public class BeanContextBuilder extends ContextBuilder {
}
/**
- * Configuration property: Look for bean methods with the specified minimum visibility.
+ * Configuration property: Bean filters to apply to beans.
*
* <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.
- *
- * <h5 class='section'>Notes:</h5>
- * <ul>
- * <li>This is equivalent to calling <code>property(<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).
- * @see BeanContext#BEAN_methodVisibility
- */
- public BeanContextBuilder methodVisibility(Visibility value) {
- return set(BEAN_methodVisibility, value);
- }
-
- /**
- * Configuration property: Use Java {@link Introspector} for determining bean properties.
+ * 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>
- * Using the built-in Java bean introspector will not pick up fields or non-standard getters/setters.
- *
- * <h5 class 'section'>Notes:</h5>
- * <ul>
- * <li>This is equivalent to calling <code>property(<jsf>BEAN_useJavaBeanIntrospector</jsf>, value)</code>.
- * <li>Most {@link Bean @Bean} annotations will be ignored if you enable this setting.
+ * 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>
*
- * @param value The new value for this property.
- * @return This object (for method chaining).
- * @see BeanContext#BEAN_useJavaBeanIntrospector
- */
- public BeanContextBuilder useJavaBeanIntrospector(boolean value) {
- return set(BEAN_useJavaBeanIntrospector, value);
- }
-
- /**
- * Configuration property: Use interface proxies.
- *
- * <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.
- *
* <h5 class='section'>Notes:</h5>
* <ul>
- * <li>This is equivalent to calling <code>property(<jsf>BEAN_useInterfaceProxies</jsf>, value)</code>.
+ * <li>This is equivalent to calling <code>property(<jsf>BEAN_beanFilters</jsf>, values)</code>.
* </ul>
- *
- * @param value The new value for this property.
+ *
+ * @param append
+ * If <jk>true</jk>, the previous value is appended to. Otherwise, the previous value is replaced.
+ * @param values The new value for this property.
* @return This object (for method chaining).
- * @see BeanContext#BEAN_useInterfaceProxies
+ * @see BeanContext#BEAN_beanFilters
*/
- public BeanContextBuilder useInterfaceProxies(boolean value) {
- return set(BEAN_useInterfaceProxies, value);
+ public BeanContextBuilder beanFilters(boolean append, Object...values) {
+ return set(append, BEAN_beanFilters, values);
}
/**
- * Configuration property: Ignore unknown properties.
- *
+ * Configuration property: Add to bean filters.
+ *
* <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.
- *
- * <h5 class='section'>Notes:</h5>
- * <ul>
- * <li>This is equivalent to calling <code>property(<jsf>BEAN_ignoreUnknownBeanProperties</jsf>, value)</code>.
- * </ul>
+ * Same as {@link #beanFilters(Object...)} but takes in an array of classes.
*
- * @param value The new value for this property.
+ * @param values The values to add to this property.
* @return This object (for method chaining).
- * @see BeanContext#BEAN_ignoreUnknownBeanProperties
*/
- public BeanContextBuilder ignoreUnknownBeanProperties(boolean value) {
- return set(BEAN_ignoreUnknownBeanProperties, value);
+ public BeanContextBuilder beanFilters(Class<?>...values) {
+ return addTo(BEAN_beanFilters, values);
}
/**
- * Configuration property: Ignore unknown properties with null values.
- *
- * <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.
+ * Configuration property: Add to bean filters.
*
* <h5 class='section'>Notes:</h5>
* <ul>
- * <li>This is equivalent to calling <code>property(<jsf>BEAN_ignoreUnknownNullBeanProperties</jsf>, value)</code>.
+ * <li>This is equivalent to calling <code>addToProperty(<jsf>BEAN_beanFilters</jsf>, values)</code>
+ * or <code>property(<jsf>BEAN_beanFilters_add</jsf>, values)</code>.
* </ul>
*
- * @param value The new value for this property.
+ * @param values The values to add to this property.
* @return This object (for method chaining).
- * @see BeanContext#BEAN_ignoreUnknownNullBeanProperties
+ * @see BeanContext#BEAN_beanFilters
+ * @see BeanContext#BEAN_beanFilters_add
*/
- public BeanContextBuilder ignoreUnknownNullBeanProperties(boolean value) {
- return set(BEAN_ignoreUnknownNullBeanProperties, value);
+ public BeanContextBuilder beanFilters(Object...values) {
+ return addTo(BEAN_beanFilters, values);
}
/**
- * Configuration property: Ignore properties without setters.
- *
- * <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.
+ * Configuration property: Remove from bean filters.
*
* <h5 class='section'>Notes:</h5>
* <ul>
- * <li>This is equivalent to calling <code>property(<jsf>BEAN_ignorePropertiesWithoutSetters</jsf>, value)</code>.
+ * <li>This is equivalent to calling <code>removeFromProperty(<jsf>BEAN_beanFilters</jsf>, values)</code>
+ * or <code>property(<jsf>BEAN_beanFilters_remove</jsf>, values)</code>.
* </ul>
*
- * @param value The new value for this property.
+ * @param values The values to remove from this property.
* @return This object (for method chaining).
- * @see BeanContext#BEAN_ignorePropertiesWithoutSetters
+ * @see BeanContext#BEAN_beanFilters
+ * @see BeanContext#BEAN_beanFilters_remove
*/
- public BeanContextBuilder ignorePropertiesWithoutSetters(boolean value) {
- return set(BEAN_ignorePropertiesWithoutSetters, value);
+ public BeanContextBuilder beanFiltersRemove(Object...values) {
+ return removeFrom(BEAN_beanFilters, values);
}
/**
- * Configuration property: Ignore invocation errors on getters.
+ * Configuration property: {@link BeanMap#put(String,Object) BeanMap.put()} method will return old property
+ * value.
*
* <p>
- * If <jk>true</jk>, errors thrown when calling bean getter methods will silently be ignored.
- * Otherwise, a {@code BeanRuntimeException} is thrown.
- *
- * <h5 class='section'>Notes:</h5>
- * <ul>
- * <li>This is equivalent to calling <code>property(<jsf>BEAN_ignoreInvocationExceptionsOnGetters</jsf>, value)</code>.
- * </ul>
- *
- * @param value The new value for this property.
- * @return This object (for method chaining).
- * @see BeanContext#BEAN_ignoreInvocationExceptionsOnGetters
- */
- public BeanContextBuilder ignoreInvocationExceptionsOnGetters(boolean value) {
- return set(BEAN_ignoreInvocationExceptionsOnGetters, value);
- }
-
- /**
- * Configuration property: Ignore invocation errors on setters.
+ * 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>
- * If <jk>true</jk>, errors thrown when calling bean setter methods will silently be ignored.
- * Otherwise, a {@code BeanRuntimeException} is thrown.
+ * Disabled by default because it introduces a slight performance penalty.
*
* <h5 class='section'>Notes:</h5>
* <ul>
- * <li>This is equivalent to calling <code>property(<jsf>BEAN_ignoreInvocationExceptionsOnSetters</jsf>, value)</code>.
+ * <li>This is equivalent to calling <code>property(<jsf>BEAN_beanMapPutReturnsOldValue</jsf>, value)</code>.
* </ul>
*
* @param value The new value for this property.
* @return This object (for method chaining).
- * @see BeanContext#BEAN_ignoreInvocationExceptionsOnSetters
+ * @see BeanContext#BEAN_beanMapPutReturnsOldValue
*/
- public BeanContextBuilder ignoreInvocationExceptionsOnSetters(boolean value) {
- return set(BEAN_ignoreInvocationExceptionsOnSetters, value);
+ public BeanContextBuilder beanMapPutReturnsOldValue(boolean value) {
+ return set(BEAN_beanMapPutReturnsOldValue, value);
}
/**
- * Configuration property: Sort bean properties in alphabetical order.
+ * Configuration property: Beans require no-arg constructors.
*
* <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 official JVM specs).
- *
- * <h5 class='section'>Notes:</h5>
- * <ul>
- * <li>
- * This is equivalent to calling <code>property(<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).
- * @see BeanContext#BEAN_sortProperties
- */
- public BeanContextBuilder sortProperties(boolean value) {
- return set(BEAN_sortProperties, value);
- }
-
- /**
- * Configuration property: Add to packages whose classes should not be considered beans.
- *
- * <h5 class='section'>Notes:</h5>
- * <ul>
- * <li>This is equivalent to calling <code>addToProperty(<jsf>BEAN_notBeanPackages</jsf>, values)</code>
- * or <code>property(<jsf>BEAN_notBeanPackages_add</jsf>, s)</code>.
- * </ul>
+ * 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 Object#toString()} method.
*
- * @param values The values to add to this property.
- * @return This object (for method chaining).
- * @see BeanContext#BEAN_notBeanPackages_add
- */
- public BeanContextBuilder notBeanPackages(Object...values) {
- return addTo(BEAN_notBeanPackages, values);
- }
-
- /**
- * Configuration property: Add to packages whose classes should not be considered beans.
+ * <p>
+ * The {@link Bean @Bean} annotation can be used on a class to override this setting when <jk>true</jk>.
*
* <h5 class='section'>Notes:</h5>
* <ul>
- * <li>This is equivalent to calling <code>addToProperty(<jsf>BEAN_notBeanPackages</jsf>, values)</code>
- * or <code>property(<jsf>BEAN_notBeanPackages_add</jsf>, s)</code>.
+ * <li>This is equivalent to calling <code>property(<jsf>BEAN_beansRequireDefaultConstructor</jsf>, value)</code>.
* </ul>
*
- * @param values The values to add to this property.
+ * @param value The new value for this property.
* @return This object (for method chaining).
- * @see BeanContext#BEAN_notBeanPackages_add
+ * @see BeanContext#BEAN_beansRequireDefaultConstructor
*/
- public BeanContextBuilder notBeanPackages(String...values) {
- return addTo(BEAN_notBeanPackages, values);
+ public BeanContextBuilder beansRequireDefaultConstructor(boolean value) {
+ return set(BEAN_beansRequireDefaultConstructor, value);
}
/**
- * Configuration property: Packages whose classes should not be considered beans.
- *
- * <p>
- * When specified, the current list of ignore packages are appended to.
+ * Configuration property: Beans require {@link Serializable} interface.
*
* <p>
- * Any classes within these packages will be serialized to strings using {@link Object#toString()}.
+ * 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 Object#toString()} method.
*
* <p>
- * Note that you can specify prefix patterns to include all subpackages.
+ * The {@link Bean @Bean} annotation can be used on a class to override this setting when <jk>true</jk>.
*
* <h5 class='section'>Notes:</h5>
* <ul>
- * <li>This is equivalent to calling <code>property(<jsf>BEAN_notBeanPackages</jsf>, values)</code>.
+ * <li>This is equivalent to calling <code>property(<jsf>BEAN_beansRequireSerializable</jsf>, value)</code>.
* </ul>
- *
- * @param append
- * If <jk>true</jk>, the previous value is appended to. Otherwise, the previous value is replaced.
- * @param values The new value for this property.
+ *
+ * @param value The new value for this property.
* @return This object (for method chaining).
- * @see BeanContext#BEAN_notBeanPackages
+ * @see BeanContext#BEAN_beansRequireSerializable
*/
- public BeanContextBuilder notBeanPackages(boolean append, Object...values) {
- return set(append, BEAN_notBeanPackages, values);
+ public BeanContextBuilder beansRequireSerializable(boolean value) {
+ return set(BEAN_beansRequireSerializable, value);
}
/**
- * Configuration property: Remove from packages whose classes should not be considered beans.
+ * Configuration property: Beans require setters for getters.
+ *
+ * <p>
+ * If <jk>true</jk>, only getters that have equivalent setters will be considered as properties on a bean.
+ * Otherwise, they will be ignored.
*
* <h5 class='section'>Notes:</h5>
* <ul>
- * <li>This is equivalent to calling <code>removeFromProperty(<jsf>BEAN_notBeanPackages</jsf>, values)</code>
- * or <code>property(<jsf>BEAN_notBeanPackages_remove</jsf>, s)</code>.
+ * <li>This is equivalent to calling <code>property(<jsf>BEAN_beansRequireSettersForGetters</jsf>, value)</code>.
* </ul>
*
- * @param values The values to remove from this property.
+ * @param value The new value for this property.
* @return This object (for method chaining).
- * @see BeanContext#BEAN_notBeanPackages
- * @see BeanContext#BEAN_notBeanPackages_remove
+ * @see BeanContext#BEAN_beansRequireSettersForGetters
*/
- public BeanContextBuilder notBeanPackagesRemove(Object...values) {
- return removeFrom(BEAN_notBeanPackages, values);
+ public BeanContextBuilder beansRequireSettersForGetters(boolean value) {
+ return set(BEAN_beansRequireSettersForGetters, value);
}
/**
- * Configuration property: Add to classes that should not be considered beans.
+ * Configuration property: Beans require at least one property.
+ *
+ * <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 Object#toString()} method.
+ *
+ * <p>
+ * The {@link Bean @Bean} annotation can be used on a class to override this setting when <jk>true</jk>.
*
* <h5 class='section'>Notes:</h5>
* <ul>
- * <li>This is equivalent to calling <code>addToProperty(<jsf>BEAN_notBeanClasses</jsf>, values)</code>
- * or <code>property(<jsf>BEAN_notBeanClasses_add</jsf>, values)</code>.
+ * <li>This is equivalent to calling <code>property(<jsf>BEAN_beansRequireSomeProperties</jsf>, value)</code>.
* </ul>
*
- * @param values The values to add to this property.
+ * @param value The new value for this property.
* @return This object (for method chaining).
- * @see BeanContext#BEAN_notBeanClasses
- * @see BeanContext#BEAN_notBeanClasses_add
+ * @see BeanContext#BEAN_beansRequireSomeProperties
*/
- public BeanContextBuilder notBeanClasses(Object...values) {
- return addTo(BEAN_notBeanClasses, values);
+ public BeanContextBuilder beansRequireSomeProperties(boolean value) {
+ return set(BEAN_beansRequireSomeProperties, value);
}
/**
- * Configuration property: Add to classes that should not be considered beans.
+ * Configuration property: Name to use for the bean type properties used to represent a bean type.
*
* <h5 class='section'>Notes:</h5>
* <ul>
- * <li>This is equivalent to calling <code>addToProperty(<jsf>BEAN_notBeanClasses</jsf>, values)</code>
- * or <code>property(<jsf>BEAN_notBeanClasses_add</jsf>, values)</code>.
+ * <li>This is equivalent to calling <code>property(<jsf>BEAN_beanTypePropertyName</jsf>, value)</code>.
* </ul>
*
- * @param values The values to add to this property.
+ * @param value The new value for this property.
* @return This object (for method chaining).
- * @see BeanContext#BEAN_notBeanClasses
- * @see BeanContext#BEAN_notBeanClasses_add
+ * @see BeanContext#BEAN_beanTypePropertyName
*/
- public BeanContextBuilder notBeanClasses(Class<?>...values) {
- return addTo(BEAN_notBeanClasses, values);
+ public BeanContextBuilder beanTypePropertyName(String value) {
+ return set(BEAN_beanTypePropertyName, value);
}
/**
- * Configuration property: Classes to be excluded from consideration as being beans.
+ * Configuration property: Debug mode.
*
* <p>
- * Not-bean classes are typically converted to <code>Strings</code> during serialization even if they appear to be
- * bean-like.
+ * 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 Serializer#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>
*
* <h5 class='section'>Notes:</h5>
* <ul>
- * <li>This is equivalent to calling <code>property(<jsf>BEAN_notBeanClasses</jsf>, values)</code>.
+ * <li>This is equivalent to calling <code>property(<jsf>BEAN_debug</jsf>, value)</code>.
* </ul>
- *
- * @param append
- * If <jk>true</jk>, the previous value is appended to. Otherwise, the previous value is replaced.
- * @param values The new value for this property.
+ *
* @return This object (for method chaining).
- * @see BeanContext#BEAN_notBeanClasses
+ * @see BeanContext#BEAN_debug
*/
- public BeanContextBuilder notBeanClasses(boolean append, Object...values) {
- return set(append, BEAN_notBeanClasses, values);
+ public BeanContextBuilder debug() {
+ return set(BEAN_debug, true);
}
/**
- * Configuration property: Remove from classes that should not be considered beans.
+ * Configuration property: Exclude specified properties from beans.
*
* <h5 class='section'>Notes:</h5>
* <ul>
- * <li>This is equivalent to calling <code>removeFromProperty(<jsf>BEAN_notBeanClasses</jsf>, values)</code>
- * or <code>property(<jsf>BEAN_notBeanClasses_remove</jsf>, values)</code>.
+ * <li>This is equivalent to calling <code>putToProperty(<jsf>BEAN_excludeProperties</jsf>, beanClass.getName(), properties)</code>
+ * or <code>property(<jsf>BEAN_excludeProperties_put</jsf>, beanClass.getName(), properties)</code>.
* </ul>
*
- * @param values The values to remove from this property.
+ * @param beanClass The bean class.
+ * @param properties Comma-delimited list of property names.
* @return This object (for method chaining).
- * @see BeanContext#BEAN_notBeanClasses
- * @see BeanContext#BEAN_notBeanClasses_remove
+ * @see BeanContext#BEAN_excludeProperties
*/
- public BeanContextBuilder notBeanClassesRemove(Object...values) {
- return removeFrom(BEAN_notBeanClasses, values);
+ public BeanContextBuilder excludeProperties(Class<?> beanClass, String properties) {
+ return addTo(BEAN_excludeProperties, beanClass.getName(), properties);
}
/**
- * Configuration property: Bean filters to apply to beans.
+ * Configuration property: Exclude specified properties from beans.
*
* <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.
+ * Specifies to exclude the specified list of properties for the specified 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>
+ * The keys are either fully-qualified or simple class names, and the values are comma-delimited lists of property
+ * names.
+ * The key <js>"*"</js> means all bean classes.
+ *
+ * <p>
+ * For example, <code>{Bean1:<js>"foo,bar"</js>}</code> means don't serialize the <code>foo</code> and <code>bar</code>
+ * properties on the specified bean.
*
* <h5 class='section'>Notes:</h5>
* <ul>
- * <li>This is equivalent to calling <code>property(<jsf>BEAN_beanFilters</jsf>, values)</code>.
+ * <li>This is equivalent to calling <code>property(<jsf>BEAN_excludeProperties</jsf>, values)</code>.
* </ul>
- *
- * @param append
- * If <jk>true</jk>, the previous value is appended to. Otherwise, the previous value is replaced.
+ *
* @param values The new value for this property.
* @return This object (for method chaining).
- * @see BeanContext#BEAN_beanFilters
+ * @see BeanContext#BEAN_excludeProperties
*/
- public BeanContextBuilder beanFilters(boolean append, Object...values) {
- return set(append, BEAN_beanFilters, values);
+ public BeanContextBuilder excludeProperties(Map<String,String> values) {
+ return set(BEAN_excludeProperties, values);
}
/**
- * Configuration property: Add to bean filters.
+ * Configuration property: Exclude specified properties from beans.
*
* <h5 class='section'>Notes:</h5>
* <ul>
- * <li>This is equivalent to calling <code>addToProperty(<jsf>BEAN_beanFilters</jsf>, values)</code>
- * or <code>property(<jsf>BEAN_beanFilters_add</jsf>, values)</code>.
+ * <li>This is equivalent to calling <code>putToProperty(<jsf>BEAN_excludeProperties</jsf>, beanClassName, properties)</code>
+ * or <code>property(<jsf>BEAN_excludeProperties_put</jsf>, beanClassName, properties)</code>.
* </ul>
*
- * @param values The values to add to this property.
+ * @param beanClassName The bean class name. Can be a simple name, fully-qualified name, or <js>"*"</js>.
+ * @param properties Comma-delimited list of property names.
* @return This object (for method chaining).
- * @see BeanContext#BEAN_beanFilters
- * @see BeanContext#BEAN_beanFilters_add
+ * @see BeanContext#BEAN_excludeProperties
*/
- public BeanContextBuilder beanFilters(Object...values) {
- return addTo(BEAN_beanFilters, values);
+ public BeanContextBuilder excludeProperties(String beanClassName, String properties) {
+ return addTo(BEAN_excludeProperties, beanClassName, properties);
}
/**
- * Configuration property: Add to bean filters.
- *
- * <p>
- * Same as {@link #beanFilters(Object...)} but takes in an array of classes.
+ * Configuration property: Ignore invocation errors on getters.
*
- * @param values The values to add to this property.
- * @return This object (for method chaining).
- */
- public BeanContextBuilder beanFilters(Class<?>...values) {
- return addTo(BEAN_beanFilters, values);
- }
-
- /**
- * Configuration property: Remove from bean filters.
+ * <p>
+ * If <jk>true</jk>, errors thrown when calling bean getter methods will silently be ignored.
+ * Otherwise, a {@code BeanRuntimeException} is thrown.
*
* <h5 class='section'>Notes:</h5>
* <ul>
- * <li>This is equivalent to calling <code>removeFromProperty(<jsf>BEAN_beanFilters</jsf>, values)</code>
- * or <code>property(<jsf>BEAN_beanFilters_remove</jsf>, values)</code>.
+ * <li>This is equivalent to calling <code>property(<jsf>BEAN_ignoreInvocationExceptionsOnGetters</jsf>, value)</code>.
* </ul>
*
- * @param values The values to remove from this property.
+ * @param value The new value for this property.
* @return This object (for method chaining).
- * @see BeanContext#BEAN_beanFilters
- * @see BeanContext#BEAN_beanFilters_remove
+ * @see BeanContext#BEAN_ignoreInvocationExceptionsOnGetters
*/
- public BeanContextBuilder beanFiltersRemove(Object...values) {
- return removeFrom(BEAN_beanFilters, values);
+ public BeanContextBuilder ignoreInvocationExceptionsOnGetters(boolean value) {
+ return set(BEAN_ignoreInvocationExceptionsOnGetters, value);
}
/**
- * Configuration property: Add to POJO swaps.
+ * Configuration property: Ignore invocation errors on setters.
+ *
+ * <p>
+ * If <jk>true</jk>, errors thrown when calling bean setter methods will silently be ignored.
+ * Otherwise, a {@code BeanRuntimeException} is thrown.
*
* <h5 class='section'>Notes:</h5>
* <ul>
- * <li>This is equivalent to calling <code>addToProperty(<jsf>BEAN_pojoSwaps</jsf>, values)</code>
- * or <code>property(<jsf>BEAN_pojoSwaps_add</jsf>, values)</code>.
+ * <li>This is equivalent to calling <code>property(<jsf>BEAN_ignoreInvocationExceptionsOnSetters</jsf>, value)</code>.
* </ul>
*
- * @param values The values to add to this property.
+ * @param value The new value for this property.
* @return This object (for method chaining).
- * @see BeanContext#BEAN_pojoSwaps
- * @see BeanContext#BEAN_pojoSwaps_add
+ * @see BeanContext#BEAN_ignoreInvocationExceptionsOnSetters
*/
- public BeanContextBuilder pojoSwaps(Object...values) {
- return addTo(BEAN_pojoSwaps, values);
+ public BeanContextBuilder ignoreInvocationExceptionsOnSetters(boolean value) {
+ return set(BEAN_ignoreInvocationExceptionsOnSetters, value);
}
/**
- * Configuration property: Add to POJO swaps.
+ * Configuration property: Ignore properties without setters.
+ *
+ * <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.
*
* <h5 class='section'>Notes:</h5>
* <ul>
- * <li>This is equivalent to calling <code>addToProperty(<jsf>BEAN_pojoSwaps</jsf>, values)</code>
- * or <code>property(<jsf>BEAN_pojoSwaps_add</jsf>, values)</code>.
+ * <li>This is equivalent to calling <code>property(<jsf>BEAN_ignorePropertiesWithoutSetters</jsf>, value)</code>.
* </ul>
*
- * @param values The values to add to this property.
+ * @param value The new value for this property.
* @return This object (for method chaining).
- * @see BeanContext#BEAN_pojoSwaps
- * @see BeanContext#BEAN_pojoSwaps_add
+ * @see BeanContext#BEAN_ignorePropertiesWithoutSetters
*/
- public BeanContextBuilder pojoSwaps(Class<?>...values) {
- return addTo(BEAN_pojoSwaps, values);
+ public BeanContextBuilder ignorePropertiesWithoutSetters(boolean value) {
+ return set(BEAN_ignorePropertiesWithoutSetters, value);
}
/**
- * Configuration property: POJO swaps to apply to Java objects.
+ * Configuration property: Ignore unknown properties.
*
* <p>
- * There are two category of classes that can be passed in through this method:
- * <ul>
- * <li>Subclasses of {@link PojoSwap}.
- * <li>Implementations of {@link Surrogate}.
- * </ul>
+ * 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.
*
* <h5 class='section'>Notes:</h5>
* <ul>
- * <li>This is equivalent to calling <code>property(<jsf>BEAN_pojoSwaps</jsf>, values)</code>.
+ * <li>This is equivalent to calling <code>property(<jsf>BEAN_ignoreUnknownBeanProperties</jsf>, value)</code>.
* </ul>
- *
- * @param append
- * If <jk>true</jk>, the previous value is appended to. Otherwise, the previous value is replaced.
- * @param values The new value for this property.
+ *
+ * @param value The new value for this property.
* @return This object (for method chaining).
- * @see BeanContext#BEAN_pojoSwaps
+ * @see BeanContext#BEAN_ignoreUnknownBeanProperties
*/
- public BeanContextBuilder pojoSwaps(boolean append, Object...values) {
- return set(append, BEAN_pojoSwaps, values);
+ public BeanContextBuilder ignoreUnknownBeanProperties(boolean value) {
+ return set(BEAN_ignoreUnknownBeanProperties, value);
}
/**
- * Configuration property: Remove from POJO swaps.
+ * Configuration property: Ignore unknown properties with null values.
+ *
+ * <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.
*
* <h5 class='section'>Notes:</h5>
* <ul>
- * <li>This is equivalent to calling <code>removeFromProperty(<jsf>BEAN_pojoSwaps</jsf>, values)</code>
- * or <code>property(<jsf>BEAN_pojoSwaps_remove</jsf>, values)</code>.
+ * <li>This is equivalent to calling <code>property(<jsf>BEAN_ignoreUnknownNullBeanProperties</jsf>, value)</code>.
* </ul>
*
- * @param values The values to remove from this property.
+ * @param value The new value for this property.
* @return This object (for method chaining).
- * @see BeanContext#BEAN_pojoSwaps
- * @see BeanContext#BEAN_pojoSwaps_remove
+ * @see BeanContext#BEAN_ignoreUnknownNullBeanProperties
*/
- public BeanContextBuilder pojoSwapsRemove(Object...values) {
- return removeFrom(BEAN_pojoSwaps, values);
+ public BeanContextBuilder ignoreUnknownNullBeanProperties(boolean value) {
+ return set(BEAN_ignoreUnknownNullBeanProperties, value);
}
/**
- * Configuration property: Bean property namer
+ * Configuration property: Implementation classes for interfaces and abstract classes.
*
- * <p>
- * The class to use for calculating bean property names.
- *
- * @param value The new value for this setting.
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>putToProperty(<jsf>BEAN_implClasses</jsf>, interfaceClass, implClass)</code>
+ * or <code>property(<jsf>BEAN_implClasses_put</jsf>, interfaceClass, implClass)</code>.
+ * </ul>
+ *
+ * @param interfaceClass The interface class.
+ * @param implClass The implementation class.
+ * @param <I> The class type of the interface.
* @return This object (for method chaining).
+ * @see BeanContext#BEAN_implClasses
*/
- public BeanContextBuilder propertyNamer(Class<? extends PropertyNamer> value) {
- return set(BEAN_propertyNamer, value);
+ public <I> BeanContextBuilder implClass(Class<I> interfaceClass, Class<? extends I> implClass) {
+ return addTo(BEAN_implClasses, interfaceClass.getName(), implClass);
}
/**
@@ -819,22 +689,21 @@ public class BeanContextBuilder extends ContextBuilder {
}
/**
- * Configuration property: Implementation classes for interfaces and abstract classes.
+ * Configuration property: Explicitly specify visible bean properties.
*
* <h5 class='section'>Notes:</h5>
* <ul>
- * <li>This is equivalent to calling <code>putToProperty(<jsf>BEAN_implClasses</jsf>, interfaceClass, implClass)</code>
- * or <code>property(<jsf>BEAN_implClasses_put</jsf>, interfaceClass, implClass)</code>.
+ * <li>This is equivalent to calling <code>putToProperty(<jsf>BEAN_includeProperties</jsf>, beanClass.getName(), properties)</code>
+ * or <code>property(<jsf>BEAN_includeProperties_put</jsf>, beanClass.getName(), properties)</code>.
* </ul>
*
- * @param interfaceClass The interface class.
- * @param implClass The implementation class.
- * @param <I> The class type of the interface.
+ * @param beanClass The bean class.
+ * @param properties Comma-delimited list of property names.
* @return This object (for method chaining).
- * @see BeanContext#BEAN_implClasses
+ * @see BeanContext#BEAN_includeProperties
*/
- public <I> BeanContextBuilder implClass(Class<I> interfaceClass, Class<? extends I> implClass) {
- return addTo(BEAN_implClasses, interfaceClass.getName(), implClass);
+ public BeanContextBuilder includeProperties(Class<?> beanClass, String properties) {
+ return addTo(BEAN_includeProperties, beanClass.getName(), properties);
}
/**
@@ -884,233 +753,334 @@ public class BeanContextBuilder extends ContextBuilder {
}
/**
- * Configuration property: Explicitly specify visible bean properties.
+ * Configuration property: Locale.
*
* <h5 class='section'>Notes:</h5>
* <ul>
- * <li>This is equivalent to calling <code>putToProperty(<jsf>BEAN_includeProperties</jsf>, beanClass.getName(), properties)</code>
- * or <code>property(<jsf>BEAN_includeProperties_put</jsf>, beanClass.getName(), properties)</code>.
+ * <li>This is equivalent to calling <code>property(<jsf>BEAN_locale</jsf>, value)</code>.
* </ul>
*
- * @param beanClass The bean class.
- * @param properties Comma-delimited list of property names.
+ * @param value The new value for this property.
* @return This object (for method chaining).
- * @see BeanContext#BEAN_includeProperties
+ * @see BeanContext#BEAN_locale
*/
- public BeanContextBuilder includeProperties(Class<?> beanClass, String properties) {
- return addTo(BEAN_includeProperties, beanClass.getName(), properties);
+ public BeanContextBuilder locale(Locale value) {
+ return set(BEAN_locale, value);
}
/**
- * Configuration property: Exclude specified properties from beans.
+ * Configuration property: Media type.
*
* <p>
- * Specifies to exclude the specified list of properties for the specified bean classes.
+ * Specifies a default media type value for serializer and parser sessions.
+ *
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>property(<jsf>BEAN_mediaType</jsf>, value)</code>.
+ * </ul>
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ * @see BeanContext#BEAN_mediaType
+ */
+ public BeanContextBuilder mediaType(MediaType value) {
+ return set(BEAN_mediaType, value);
+ }
+
+ /**
+ * Configuration property: Look for bean methods with the specified minimum visibility.
*
* <p>
- * The keys are either fully-qualified or simple class names, and the values are comma-delimited lists of property
- * names.
- * The key <js>"*"</js> means all bean classes.
+ * 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.
+ *
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>property(<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).
+ * @see BeanContext#BEAN_methodVisibility
+ */
+ public BeanContextBuilder methodVisibility(Visibility value) {
+ return set(BEAN_methodVisibility, value);
+ }
+
+ /**
+ * Configuration property: Classes to be excluded from consideration as being beans.
*
* <p>
- * For example, <code>{Bean1:<js>"foo,bar"</js>}</code> means don't serialize the <code>foo</code> and <code>bar</code>
- * properties on the specified bean.
+ * Not-bean classes are typically converted to <code>Strings</code> during serialization even if they appear to be
+ * bean-like.
*
* <h5 class='section'>Notes:</h5>
* <ul>
- * <li>This is equivalent to calling <code>property(<jsf>BEAN_excludeProperties</jsf>, values)</code>.
+ * <li>This is equivalent to calling <code>property(<jsf>BEAN_notBeanClasses</jsf>, values)</code>.
+ * </ul>
+ *
+ * @param append
+ * If <jk>true</jk>, the previous value is appended to. Otherwise, the previous value is replaced.
+ * @param values The new value for this property.
+ * @return This object (for method chaining).
+ * @see BeanContext#BEAN_notBeanClasses
+ */
+ public BeanContextBuilder notBeanClasses(boolean append, Object...values) {
+ return set(append, BEAN_notBeanClasses, values);
+ }
+
+ /**
+ * Configuration property: Add to classes that should not be considered beans.
+ *
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>addToProperty(<jsf>BEAN_notBeanClasses</jsf>, values)</code>
+ * or <code>property(<jsf>BEAN_notBeanClasses_add</jsf>, values)</code>.
+ * </ul>
+ *
+ * @param values The values to add to this property.
+ * @return This object (for method chaining).
+ * @see BeanContext#BEAN_notBeanClasses
+ * @see BeanContext#BEAN_notBeanClasses_add
+ */
+ public BeanContextBuilder notBeanClasses(Class<?>...values) {
+ return addTo(BEAN_notBeanClasses, values);
+ }
+
+ /**
+ * Configuration property: Add to classes that should not be considered beans.
+ *
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>addToProperty(<jsf>BEAN_notBeanClasses</jsf>, values)</code>
+ * or <code>property(<jsf>BEAN_notBeanClasses_add</jsf>, values)</code>.
+ * </ul>
+ *
+ * @param values The values to add to this property.
+ * @return This object (for method chaining).
+ * @see BeanContext#BEAN_notBeanClasses
+ * @see BeanContext#BEAN_notBeanClasses_add
+ */
+ public BeanContextBuilder notBeanClasses(Object...values) {
+ return addTo(BEAN_notBeanClasses, values);
+ }
+
+ /**
+ * Configuration property: Remove from classes that should not be considered beans.
+ *
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>removeFromProperty(<jsf>BEAN_notBeanClasses</jsf>, values)</code>
+ * or <code>property(<jsf>BEAN_notBeanClasses_remove</jsf>, values)</code>.
* </ul>
*
+ * @param values The values to remove from this property.
+ * @return This object (for method chaining).
+ * @see BeanContext#BEAN_notBeanClasses
+ * @see BeanContext#BEAN_notBeanClasses_remove
+ */
+ public BeanContextBuilder notBeanClassesRemove(Object...values) {
+ return removeFrom(BEAN_notBeanClasses, values);
+ }
+
+ /**
+ * Configuration property: Packages whose classes should not be considered beans.
+ *
+ * <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.
+ *
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>property(<jsf>BEAN_notBeanPackages</jsf>, values)</code>.
+ * </ul>
+ *
+ * @param append
+ * If <jk>true</jk>, the previous value is appended to. Otherwise, the previous value is replaced.
* @param values The new value for this property.
* @return This object (for method chaining).
- * @see BeanContext#BEAN_excludeProperties
+ * @see BeanContext#BEAN_notBeanPackages
*/
- public BeanContextBuilder excludeProperties(Map<String,String> values) {
- return set(BEAN_excludeProperties, values);
+ public BeanContextBuilder notBeanPackages(boolean append, Object...values) {
+ return set(append, BEAN_notBeanPackages, values);
}
/**
- * Configuration property: Exclude specified properties from beans.
+ * Configuration property: Add to packages whose classes should not be considered beans.
*
* <h5 class='section'>Notes:</h5>
* <ul>
- * <li>This is equivalent to calling <code>putToProperty(<jsf>BEAN_excludeProperties</jsf>, beanClassName, properties)</code>
- * or <code>property(<jsf>BEAN_excludeProperties_put</jsf>, beanClassName, properties)</code>.
+ * <li>This is equivalent to calling <code>addToProperty(<jsf>BEAN_notBeanPackages</jsf>, values)</code>
+ * or <code>property(<jsf>BEAN_notBeanPackages_add</jsf>, s)</code>.
* </ul>
*
- * @param beanClassName The bean class name. Can be a simple name, fully-qualified name, or <js>"*"</js>.
- * @param properties Comma-delimited list of property names.
+ * @param values The values to add to this property.
* @return This object (for method chaining).
- * @see BeanContext#BEAN_excludeProperties
+ * @see BeanContext#BEAN_notBeanPackages_add
*/
- public BeanContextBuilder excludeProperties(String beanClassName, String properties) {
- return addTo(BEAN_excludeProperties, beanClassName, properties);
+ public BeanContextBuilder notBeanPackages(Object...values) {
+ return addTo(BEAN_notBeanPackages, values);
}
/**
- * Configuration property: Exclude specified properties from beans.
+ * Configuration property: Add to packages whose classes should not be considered beans.
*
* <h5 class='section'>Notes:</h5>
* <ul>
- * <li>This is equivalent to calling <code>putToProperty(<jsf>BEAN_excludeProperties</jsf>, beanClass.getName(), properties)</code>
- * or <code>property(<jsf>BEAN_excludeProperties_put</jsf>, beanClass.getName(), properties)</code>.
+ * <li>This is equivalent to calling <code>addToProperty(<jsf>BEAN_notBeanPackages</jsf>, values)</code>
+ * or <code>property(<jsf>BEAN_notBeanPackages_add</jsf>, s)</code>.
+ * </ul>
+ *
+ * @param values The values to add to this property.
+ * @return This object (for method chaining).
+ * @see BeanContext#BEAN_notBeanPackages_add
+ */
+ public BeanContextBuilder notBeanPackages(String...values) {
+ return addTo(BEAN_notBeanPackages, values);
+ }
+
+ /**
+ * Configuration property: Remove from packages whose classes should not be considered beans.
+ *
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>removeFromProperty(<jsf>BEAN_notBeanPackages</jsf>, values)</code>
+ * or <code>property(<jsf>BEAN_notBeanPackages_remove</jsf>, s)</code>.
* </ul>
*
- * @param beanClass The bean class.
- * @param properties Comma-delimited list of property names.
+ * @param values The values to remove from this property.
* @return This object (for method chaining).
- * @see BeanContext#BEAN_excludeProperties
+ * @see BeanContext#BEAN_notBeanPackages
+ * @see BeanContext#BEAN_notBeanPackages_remove
*/
- public BeanContextBuilder excludeProperties(Class<?> beanClass, String properties) {
- return addTo(BEAN_excludeProperties, beanClass.getName(), properties);
+ public BeanContextBuilder notBeanPackagesRemove(Object...values) {
+ return removeFrom(BEAN_notBeanPackages, values);
}
/**
- * Configuration property: Bean lookup dictionary.
- *
- * <h6 class='figure'>Example:</h6>
+ * Configuration property: POJO swaps to apply to Java objects.
+ *
+ * <p>
+ * There are two category of classes that can be passed in through this method:
+ * <ul>
+ * <li>Subclasses of {@link PojoSwap}.
+ * <li>Implementations of {@link Surrogate}.
+ * </ul>
*
* <h5 class='section'>Notes:</h5>
* <ul>
- * <li>This is equivalent to calling <code>property(<jsf>BEAN_beanDictionary</jsf>, values)</code>.
+ * <li>This is equivalent to calling <code>property(<jsf>BEAN_pojoSwaps</jsf>, values)</code>.
* </ul>
*
* @param append
* If <jk>true</jk>, the previous value is appended to. Otherwise, the previous value is replaced.
- * @param values
- * The new value for this property.
- * <br>Values can be any of the following types:
- * <ul>
- * <li>Any bean class that specifies a value for {@link Bean#typeName() @Bean.typeName()}.
- * <li>Any subclass of {@link BeanDictionaryList} containing a collection of bean classes with type name
- * annotations.
- * <li>Any subclass of {@link BeanDictionaryMap} containing a mapping of type names to classes without type name
- * annotations.
- * <li>Any array or collection of the types above:
- * </ul>
+ * @param values The new value for this property.
* @return This object (for method chaining).
- * @see BeanContext#BEAN_beanDictionary
+ * @see BeanContext#BEAN_pojoSwaps
*/
- public BeanContextBuilder beanDictionary(boolean append, Object...values) {
- return set(append, BEAN_beanDictionary, values);
+ public BeanContextBuilder pojoSwaps(boolean append, Object...values) {
+ return set(append, BEAN_pojoSwaps, values);
}
/**
- * Configuration property: Bean lookup dictionary.
- *
- * <p>
- * The list of classes that make up the bean dictionary in this bean context.
- *
- * <p>
- * A dictionary is a name/class mapping used to find class types during parsing when they cannot be inferred
- * through reflection.
- * <br>The names are defined through the {@link Bean#typeName()} annotation defined on the bean class.
- *
- * <h5 class='section'>Example:</h5>
- * <p class='bcode'>
- * BeanContext bc = BeanContext.<jsf>create</jsf>().beanDictionary(Bar.<jk>class</jk>, Baz.<jk>class</jk>).build();
- * </p>
+ * Configuration property: Add to POJO swaps.
*
- * <p>
* <h5 class='section'>Notes:</h5>
- * <ul class='spaced-list'>
- * <li>Properties:
- * <ul>
- * <li>{@link BeanContext#BEAN_beanDictionary}
- * <li>{@link BeanContext#BEAN_beanDictionary_add}
- * <li>{@link BeanContext#BEAN_beanDictionary_remove}
- * </ul>
- * <li>Annotations:
- * <ul>
- * <li>{@link Bean#beanDictionary()}
- * <li>{@link BeanProperty#beanDictionary()}
- * </ul>
- * <li>Methods:
- * <ul>
- * <li>{@link BeanContextBuilder#beanDictionary(Object...)}
- * <li>{@link BeanContextBuilder#beanDictionary(boolean,Object...)}
- * <li>{@link BeanContextBuilder#beanDictionaryRemove(Object...)}
- * </ul>
- * <li>Values can consist of any of the following types:
- * <ul>
- * <li>Any bean class that specifies a value for {@link Bean#typeName() @Bean.typeName()}.
- * <li>Any subclass of {@link BeanDictionaryList} containing a collection of bean classes with type name
- * annotations.
- * <li>Any subclass of {@link BeanDictionaryMap} containing a mapping of type names to classes without type name
- * annotations.
- * </ul>
- * <li>See <a class='doclink' href='../../../overview-summary.html#juneau-marshall.BeanDictionaries'>Bean Names and Dictionaries</a>
- * for more information.
- * </ul>
+ * <ul>
+ * <li>This is equivalent to calling <code>addToProperty(<jsf>BEAN_pojoSwaps</jsf>, values)</code>
+ * or <code>property(<jsf>BEAN_pojoSwaps_add</jsf>, values)</code>.
+ * </ul>
*
* @param values The values to add to this property.
* @return This object (for method chaining).
+ * @see BeanContext#BEAN_pojoSwaps
+ * @see BeanContext#BEAN_pojoSwaps_add
*/
- public BeanContextBuilder beanDictionary(Object...values) {
- return addTo(BEAN_beanDictionary, values);
+ public BeanContextBuilder pojoSwaps(Class<?>...values) {
+ return addTo(BEAN_pojoSwaps, values);
}
/**
- * Configuration property: Bean lookup dictionary.
- *
- * <p>
- * Same as calling {@link #beanDictionary(Object...)} but with an array of classes.
+ * Configuration property: Add to POJO swaps.
+ *
+ * <h5 class='section'>Notes:</h5>
+ * <ul>
+ * <li>This is equivalent to calling <code>addToProperty(<jsf>BEAN_pojoSwaps</jsf>, values)</code>
+ * or <code>property(<jsf>BEAN_pojoSwaps_add</jsf>, values)</code>.
+ * </ul>
*
* @param values The values to add to this property.
* @return This object (for method chaining).
+ * @see BeanContext#BEAN_pojoSwaps
+ * @see BeanContext#BEAN_pojoSwaps_add
*/
- public BeanContextBuilder beanDictionary(Class<?>...values) {
- return addTo(BEAN_beanDictionary, values);
+ public BeanContextBuilder pojoSwaps(Object...values) {
+ return addTo(BEAN_pojoSwaps, values);
}
/**
- * Configuration property: Remove from bean dictionary.
+ * Configuration property: Remove from POJO swaps.
*
* <h5 class='section'>Notes:</h5>
* <ul>
- * <li>This is equivalent to calling <code>removeFromProperty(<jsf>BEAN_beanDictionary</jsf>, values)</code>
- * or <code>property(<jsf>BEAN_beanDictionary_remove</jsf>, values)</code>.
+ * <li>This is equivalent to calling <code>removeFromProperty(<jsf>BEAN_pojoSwaps</jsf>, values)</code>
+ * or <code>property(<jsf>BEAN_pojoSwaps_remove</jsf>, values)</code>.
* </ul>
*
* @param values The values to remove from this property.
* @return This object (for method chaining).
- * @see BeanContext#BEAN_beanDictionary
- * @see BeanContext#BEAN_beanDictionary_remove
+ * @see BeanContext#BEAN_pojoSwaps
+ * @see BeanContext#BEAN_pojoSwaps_remove
*/
- public BeanContextBuilder beanDictionaryRemove(Object...values) {
- return removeFrom(BEAN_beanDictionary, values);
+ public BeanContextBuilder pojoSwapsRemove(Object...values) {
+ return removeFrom(BEAN_pojoSwaps, values);
}
/**
- * Configuration property: Name to use for the bean type properties used to represent a bean type.
- *
- * <h5 class='section'>Notes:</h5>
- * <ul>
- * <li>This is equivalent to calling <code>property(<jsf>BEAN_beanTypePropertyName</jsf>, value)</code>.
- * </ul>
+ * Configuration property: Bean property namer
*
- * @param value The new value for this property.
+ * <p>
+ * The class to use for calculating bean property names.
+ *
+ * @param value The new value for this setting.
* @return This object (for method chaining).
- * @see BeanContext#BEAN_beanTypePropertyName
*/
- public BeanContextBuilder beanTypePropertyName(String value) {
- return set(BEAN_beanTypePropertyName, value);
+ public BeanContextBuilder propertyNamer(Class<? extends PropertyNamer> value) {
+ return set(BEAN_propertyNamer, value);
}
/**
- * Configuration property: Locale.
+ * Configuration property: Sort bean properties in alphabetical order.
+ *
+ * <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 official JVM specs).
*
* <h5 class='section'>Notes:</h5>
* <ul>
- * <li>This is equivalent to calling <code>property(<jsf>BEAN_locale</jsf>, value)</code>.
+ * <li>
+ * This is equivalent to calling <code>property(<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).
- * @see BeanContext#BEAN_locale
+ * @see BeanContext#BEAN_sortProperties
*/
- public BeanContextBuilder locale(Locale value) {
- return set(BEAN_locale, value);
+ public BeanContextBuilder sortProperties(boolean value) {
+ return set(BEAN_sortProperties, value);
}
/**
@@ -1128,57 +1098,87 @@ public class BeanContextBuilder extends ContextBuilder {
public BeanContextBuilder timeZone(TimeZone value) {
return set(BEAN_timeZone, value);
}
-
+
/**
- * Configuration property: Media type.
+ * Configuration property: Use interface proxies.
*
* <p>
- * Specifies a default media type value for serializer and parser sessions.
+ * 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.
*
* <h5 class='section'>Notes:</h5>
* <ul>
- * <li>This is equivalent to calling <code>property(<jsf>BEAN_mediaType</jsf>, value)</code>.
+ * <li>This is equivalent to calling <code>property(<jsf>BEAN_useInterfaceProxies</jsf>, value)</code>.
* </ul>
*
* @param value The new value for this property.
* @return This object (for method chaining).
- * @see BeanContext#BEAN_mediaType
+ * @see BeanContext#BEAN_useInterfaceProxies
*/
- public BeanContextBuilder mediaType(MediaType value) {
- return set(BEAN_mediaType, value);
+ public BeanContextBuilder useInterfaceProxies(boolean value) {
+ return set(BEAN_useInterfaceProxies, value);
}
-
+
/**
- * Configuration property: Debug mode.
- *
- * <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 Serializer#SERIALIZER_detectRecursions}.
- * </ul>
+ * Configuration property: Use Java {@link Introspector} for determining bean properties.
*
* <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>
+ * Using the built-in Java bean introspector will not pick up fields or non-standard getters/setters.
*
- * <h5 class='section'>Notes:</h5>
+ * <h5 class 'section'>Notes:</h5>
* <ul>
- * <li>This is equivalent to calling <code>property(<jsf>BEAN_debug</jsf>, value)</code>.
+ * <li>This is equivalent to calling <code>property(<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).
- * @see BeanContext#BEAN_debug
+ * @see BeanContext#BEAN_useJavaBeanIntrospector
*/
- public BeanContextBuilder debug() {
- return set(BEAN_debug, true);
+ public BeanContextBuilder useJavaBeanIntrospector(boolean value) {
+ return set(BEAN_useJavaBeanIntrospector, value);
+ }
+
+ @Override /* ContextBuilder */
+ public BeanContextBuilder set(String name, Object value) {
+ super.set(name, value);
+ return this;
+ }
+
+ @Override /* ContextBuilder */
+ public BeanContextBuilder set(boolean append, String name, Object value) {
+ super.set(append, name, value);
+ return this;
+ }
+
+ @Override /* ContextBuilder */
+ public BeanContextBuilder set(Map<String,Object> properties) {
+ super.set(properties);
+ return this;
+ }
+
+ @Override /* ContextBuilder */
+ public BeanContextBuilder add(Map<String,Object> properties) {
+ super.add(properties);
+ return this;
+ }
+
+ @Override /* ContextBuilder */
+ public BeanContextBuilder addTo(String name, Object value) {
+ super.addTo(name, value);
+ return this;
+ }
+
+ @Override /* ContextBuilder */
+ public BeanContextBuilder addTo(String name, String key, Object value) {
+ super.addTo(name, key, value);
+ return this;
+ }
+
+ @Override /* ContextBuilder */
+ public BeanContextBuilder removeFrom(String name, Object value) {
+ super.removeFrom(name, value);
+ return this;
}
@Override /* ContextBuilder */
http://git-wip-us.apache.org/repos/asf/juneau/blob/45640a1a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/CsvParserBuilder.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/CsvParserBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/CsvParserBuilder.java
index d908d72..5e597af 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/CsvParserBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/CsvParserBuilder.java
@@ -49,38 +49,38 @@ public class CsvParserBuilder extends ParserBuilder {
//--------------------------------------------------------------------------------
@Override /* ParserBuilder */
- public CsvParserBuilder trimStrings(boolean value) {
- super.trimStrings(value);
+ public CsvParserBuilder fileCharset(String value) {
+ super.fileCharset(value);
return this;
}
@Override /* ParserBuilder */
- public CsvParserBuilder strict(boolean value) {
- super.strict(value);
+ public CsvParserBuilder inputStreamCharset(String value) {
+ super.inputStreamCharset(value);
return this;
}
@Override /* ParserBuilder */
- public CsvParserBuilder strict() {
- super.strict();
+ public CsvParserBuilder listener(Class<? extends ParserListener> value) {
+ super.listener(value);
return this;
}
@Override /* ParserBuilder */
- public CsvParserBuilder inputStreamCharset(String value) {
- super.inputStreamCharset(value);
+ public CsvParserBuilder strict() {
+ super.strict();
return this;
}
@Override /* ParserBuilder */
- public CsvParserBuilder fileCharset(String value) {
- super.fileCharset(value);
+ public CsvParserBuilder strict(boolean value) {
+ super.strict(value);
return this;
}
@Override /* ParserBuilder */
- public CsvParserBuilder listener(Class<? extends ParserListener> value) {
- super.listener(value);
+ public CsvParserBuilder trimStrings(boolean value) {
+ super.trimStrings(value);
return this;
}
http://git-wip-us.apache.org/repos/asf/juneau/blob/45640a1a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/CsvSerializerBuilder.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/CsvSerializerBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/CsvSerializerBuilder.java
index bfede9a..8bce8ac 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/CsvSerializerBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/CsvSerializerBuilder.java
@@ -50,14 +50,14 @@ public class CsvSerializerBuilder extends SerializerBuilder {
//--------------------------------------------------------------------------------
@Override /* SerializerBuilder */
- public CsvSerializerBuilder maxDepth(int value) {
- super.maxDepth(value);
+ public CsvSerializerBuilder abridged(boolean value) {
+ super.abridged(value);
return this;
}
@Override /* SerializerBuilder */
- public CsvSerializerBuilder initialDepth(int value) {
- super.initialDepth(value);
+ public CsvSerializerBuilder addBeanTypeProperties(boolean value) {
+ super.addBeanTypeProperties(value);
return this;
}
@@ -74,26 +74,26 @@ public class CsvSerializerBuilder extends SerializerBuilder {
}
@Override /* SerializerBuilder */
- public CsvSerializerBuilder useWhitespace(boolean value) {
- super.useWhitespace(value);
+ public CsvSerializerBuilder initialDepth(int value) {
+ super.initialDepth(value);
return this;
}
@Override /* SerializerBuilder */
- public CsvSerializerBuilder ws() {
- super.ws();
+ public CsvSerializerBuilder listener(Class<? extends SerializerListener> value) {
+ super.listener(value);
return this;
}
@Override /* SerializerBuilder */
- public CsvSerializerBuilder maxIndent(int value) {
- super.maxIndent(value);
+ public CsvSerializerBuilder maxDepth(int value) {
+ super.maxDepth(value);
return this;
}
@Override /* SerializerBuilder */
- public CsvSerializerBuilder addBeanTypeProperties(boolean value) {
- super.addBeanTypeProperties(value);
+ public CsvSerializerBuilder maxIndent(int value) {
+ super.maxIndent(value);
return this;
}
@@ -104,14 +104,20 @@ public class CsvSerializerBuilder extends SerializerBuilder {
}
@Override /* SerializerBuilder */
- public CsvSerializerBuilder sq() {
- super.sq();
+ public CsvSerializerBuilder sortCollections(boolean value) {
+ super.sortCollections(value);
return this;
}
@Override /* SerializerBuilder */
- public CsvSerializerBuilder trimNullProperties(boolean value) {
- super.trimNullProperties(value);
+ public CsvSerializerBuilder sortMaps(boolean value) {
+ super.sortMaps(value);
+ return this;
+ }
+
+ @Override /* SerializerBuilder */
+ public CsvSerializerBuilder sq() {
+ super.sq();
return this;
}
@@ -128,20 +134,20 @@ public class CsvSerializerBuilder extends SerializerBuilder {
}
@Override /* SerializerBuilder */
- public CsvSerializerBuilder trimStrings(boolean value) {
- super.trimStrings(value);
+ public CsvSerializerBuilder trimNullProperties(boolean value) {
+ super.trimNullProperties(value);
return this;
}
@Override /* SerializerBuilder */
- public CsvSerializerBuilder uriContext(UriContext value) {
- super.uriContext(value);
+ public CsvSerializerBuilder trimStrings(boolean value) {
+ super.trimStrings(value);
return this;
}
@Override /* SerializerBuilder */
- public CsvSerializerBuilder uriResolution(UriResolution value) {
- super.uriResolution(value);
+ public CsvSerializerBuilder uriContext(UriContext value) {
+ super.uriContext(value);
return this;
}
@@ -152,26 +158,20 @@ public class CsvSerializerBuilder extends SerializerBuilder {
}
@Override /* SerializerBuilder */
- public CsvSerializerBuilder sortCollections(boolean value) {
- super.sortCollections(value);
- return this;
- }
-
- @Override /* SerializerBuilder */
- public CsvSerializerBuilder sortMaps(boolean value) {
- super.sortMaps(value);
+ public CsvSerializerBuilder uriResolution(UriResolution value) {
+ super.uriResolution(value);
return this;
}
@Override /* SerializerBuilder */
- public CsvSerializerBuilder abridged(boolean value) {
- super.abridged(value);
+ public CsvSerializerBuilder useWhitespace(boolean value) {
+ super.useWhitespace(value);
return this;
}
@Override /* SerializerBuilder */
- public CsvSerializerBuilder listener(Class<? extends SerializerListener> value) {
- super.listener(value);
+ public CsvSerializerBuilder ws() {
+ super.ws();
return this;
}
@@ -386,42 +386,6 @@ public class CsvSerializerBuilder extends SerializerBuilder {
}
@Override /* BeanContextBuilder */
- public CsvSerializerBuilder includeProperties(Map<String,String> values) {
- super.includeProperties(values);
- return this;
- }
-
- @Override /* BeanContextBuilder */
- public CsvSerializerBuilder includeProperties(String beanClassName, String properties) {
- super.includeProperties(beanClassName, properties);
- return this;
- }
-
- @Override /* BeanContextBuilder */
- public CsvSerializerBuilder includeProperties(Class<?> beanClass, String properties) {
- super.includeProperties(beanClass, properties);
- return this;
- }
-
- @Override /* BeanContextBuilder */
- public CsvSerializerBuilder excludeProperties(Map<String,String> values) {
- super.excludeProperties(values);
- return this;
- }
-
- @Override /* BeanContextBuilder */
- public CsvSerializerBuilder excludeProperties(String beanClassName, String properties) {
- super.excludeProperties(beanClassName, properties);
- return this;
- }
-
- @Override /* BeanContextBuilder */
- public CsvSerializerBuilder excludeProperties(Class<?> beanClass, String properties) {
- super.excludeProperties(beanClass, properties);
- return this;
- }
-
- @Override /* BeanContextBuilder */
public CsvSerializerBuilder beanDictionary(Object...values) {
super.beanDictionary(values);
return this;
http://git-wip-us.apache.org/repos/asf/juneau/blob/45640a1a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlParserBuilder.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlParserBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlParserBuilder.java
index 06f2dab..e676fcb 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlParserBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlParserBuilder.java
@@ -78,38 +78,38 @@ public class HtmlParserBuilder extends XmlParserBuilder {
}
@Override /* ParserBuilder */
- public HtmlParserBuilder trimStrings(boolean value) {
- super.trimStrings(value);
+ public HtmlParserBuilder fileCharset(String value) {
+ super.fileCharset(value);
return this;
}
@Override /* ParserBuilder */
- public HtmlParserBuilder strict(boolean value) {
- super.strict(value);
+ public HtmlParserBuilder inputStreamCharset(String value) {
+ super.inputStreamCharset(value);
return this;
}
@Override /* ParserBuilder */
- public HtmlParserBuilder strict() {
- super.strict();
+ public HtmlParserBuilder listener(Class<? extends ParserListener> value) {
+ super.listener(value);
return this;
}
@Override /* ParserBuilder */
- public HtmlParserBuilder inputStreamCharset(String value) {
- super.inputStreamCharset(value);
+ public HtmlParserBuilder strict() {
+ super.strict();
return this;
}
@Override /* ParserBuilder */
- public HtmlParserBuilder fileCharset(String value) {
- super.fileCharset(value);
+ public HtmlParserBuilder strict(boolean value) {
+ super.strict(value);
return this;
}
@Override /* ParserBuilder */
- public HtmlParserBuilder listener(Class<? extends ParserListener> value) {
- super.listener(value);
+ public HtmlParserBuilder trimStrings(boolean value) {
+ super.trimStrings(value);
return this;
}