T - the type of the beanpublic final class MinimalMetaBean<T extends Bean> extends Object implements TypedMetaBean<T>
| Modifier and Type | Method and Description |
|---|---|
Class<T> |
beanType()
Get the type of the bean, represented as a
Class. |
BeanBuilder<T> |
builder()
Creates a bean builder that can be used to create an instance of this bean.
|
boolean |
equals(Object obj) |
int |
hashCode() |
boolean |
isBuildable()
Checks whether this bean is buildable or not.
|
Map<String,MetaProperty<?>> |
metaPropertyMap()
Gets the map of meta-properties, keyed by property name.
|
static <B extends Bean> |
of(Class<B> beanType,
String[] fieldNames,
Supplier<BeanBuilder<B>> builderSupplier,
Function<B,Object>... getters)
Obtains an instance of the meta-bean for immutable beans.
|
static <B extends Bean> |
of(Class<B> beanType,
String[] fieldNames,
Supplier<BeanBuilder<B>> builderSupplier,
List<Function<B,Object>> getters,
List<BiConsumer<B,Object>> setters)
Obtains an instance of the meta-bean for mutable beans.
|
static <B extends Bean> |
of(Class<B> beanType,
Supplier<BeanBuilder<B>> builderSupplier,
Function<B,Object>... getters)
Deprecated.
Use version that takes the field names
|
static <B extends Bean> |
of(Class<B> beanType,
Supplier<BeanBuilder<B>> builderSupplier,
List<Function<B,Object>> getters,
List<BiConsumer<B,Object>> setters)
Deprecated.
Use version that takes the field names
|
String |
toString()
Returns a string that summarises the meta-bean.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, waitannotation, annotations, beanName, metaProperty, metaPropertyCount, metaPropertyExists, metaPropertyIterable, of, register@Deprecated @SafeVarargs public static <B extends Bean> MinimalMetaBean<B> of(Class<B> beanType, Supplier<BeanBuilder<B>> builderSupplier, Function<B,Object>... getters)
The properties will be determined using reflection to find the
PropertyDefinition annotation.
B - the type of the beanbeanType - the bean type, not nullbuilderSupplier - the supplier of bean builders, not nullgetters - the getter functions, not null@SafeVarargs public static <B extends Bean> MinimalMetaBean<B> of(Class<B> beanType, String[] fieldNames, Supplier<BeanBuilder<B>> builderSupplier, Function<B,Object>... getters)
The properties will be determined using reflection to find the
PropertyDefinition annotation.
The field names must be specified as reflection does not return fields in source code order.
B - the type of the beanbeanType - the bean type, not nullfieldNames - the field names, not nullbuilderSupplier - the supplier of bean builders, not nullgetters - the getter functions, not null@Deprecated public static <B extends Bean> MinimalMetaBean<B> of(Class<B> beanType, Supplier<BeanBuilder<B>> builderSupplier, List<Function<B,Object>> getters, List<BiConsumer<B,Object>> setters)
The properties will be determined using reflection to find the
PropertyDefinition annotation.
B - the type of the beanbeanType - the bean type, not nullbuilderSupplier - the supplier of bean builders, not nullgetters - the getter functions, not nullsetters - the setter functions, not nullpublic static <B extends Bean> MinimalMetaBean<B> of(Class<B> beanType, String[] fieldNames, Supplier<BeanBuilder<B>> builderSupplier, List<Function<B,Object>> getters, List<BiConsumer<B,Object>> setters)
The properties will be determined using reflection to find the
PropertyDefinition annotation.
The field names must be specified as reflection does not return fields in source code order.
B - the type of the beanbeanType - the bean type, not nullfieldNames - the field names, not nullbuilderSupplier - the supplier of bean builders, not nullgetters - the getter functions, not nullsetters - the setter functions, not nullpublic boolean isBuildable()
MetaBean
A buildable bean can be constructed using MetaBean.builder().
If this method returns true then builder() must return a valid builder.
If this method returns false then builder() must throw UnsupportedOperationException.
isBuildable in interface MetaBeanpublic BeanBuilder<T> builder()
MetaBeanThe builder is used in two main ways. The first is to allow immutable beans to be constructed. The second is to enable automated tools like serialization/deserialization.
The builder can be thought of as a Map of MetaProperty to value.
Note that the implementation is not necessarily an actual map.
public Class<T> beanType()
MetaBeanClass.
A MetaBean can be thought of as the equivalent of Class but for beans.
This method allows the actual Class instance of the bean to be obtained.
public Map<String,MetaProperty<?>> metaPropertyMap()
MetaBean
Where possible, use MetaBean.metaPropertyIterable() instead as it typically has better performance.
metaPropertyMap in interface MetaBeanCopyright © 2007–2017 Joda.org. All rights reserved.