public final class PropertyCriteria extends java.lang.Object implements java.util.function.Predicate<PropertyInfo>
For the built-in Boolean criteria, the value from the PropertyInfo must match the criteria value. For example with the "derived" criteria:
Boolean.TRUE - will only match derived properties
Boolean.FALSE - will only match non-derived properties
null - will match properties regardless of derived status| Constructor and Description |
|---|
PropertyCriteria()
Creates a PropertyCriteria that by default excludes deprecated and
internal properties.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addPredicate(java.util.function.Predicate<PropertyInfo> predicate)
Adds an extra criteria in the form of a predicate.
|
static PropertyCriteria |
createEmptyCriteria()
Creates an explictly empty criteria that allows all properties.
|
void |
setDeprecated(java.lang.Boolean deprecated)
Sets the deprecated criteria - i.e.
|
void |
setDerived(java.lang.Boolean derived)
Sets the derived criteria - i.e.
|
void |
setIncludeBean(boolean includeBean)
Sets the bean property criteria - i.e whether to include properties
that are defined on the bean.
|
void |
setIncludeExtra(boolean includeExtra)
Sets the extra property criteria - i.e whether to include properties
that are not defined on the bean, but are extra properties registered
by the metadata.
|
void |
setInternal(java.lang.Boolean internal)
Sets the internal criteria - i.e.
|
boolean |
test(PropertyInfo info) |
public PropertyCriteria()
createEmptyCriteria()public void setDerived(java.lang.Boolean derived)
derived - true to only include deprecated properties, false to
only include non-derived properties.public void setDeprecated(java.lang.Boolean deprecated)
Boolean.FALSE by default (i.e. deprecated properties will not
be included).deprecated - null to include deprecated properties, true to only
include deprecated propertiespublic void setInternal(java.lang.Boolean internal)
Boolean.FALSE by default (i.e. internal properties will not
be included).internal - null to include internal properties, true to only
include internal propertiespublic void setIncludeBean(boolean includeBean)
includeBean - false to exclude bean propertiespublic void setIncludeExtra(boolean includeExtra)
includeExtra - false to exclude extra propertiespublic void addPredicate(java.util.function.Predicate<PropertyInfo> predicate)
predicate - an extra criteria test that each PropertyInfo must
match.public boolean test(PropertyInfo info)
test in interface java.util.function.Predicate<PropertyInfo>public static PropertyCriteria createEmptyCriteria()