T - the type of the beanMetaBean, TypedMetaBean<T>public final class MinimalMetaBean<T extends Bean> extends java.lang.Object implements TypedMetaBean<T>
| Modifier and Type | Method | Description |
|---|---|---|
java.lang.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(java.lang.Object obj) |
|
int |
hashCode() |
|
boolean |
isBuildable() |
Checks whether this bean is buildable or not.
|
java.util.Map<java.lang.String,MetaProperty<?>> |
metaPropertyMap() |
Gets the map of meta-properties, keyed by property name.
|
static <B extends Bean> |
of(java.lang.Class<B> beanType,
java.lang.String[] fieldNames,
java.util.function.Supplier<BeanBuilder<B>> builderSupplier,
java.util.function.Function<B,java.lang.Object>... getters) |
Obtains an instance of the meta-bean for immutable beans.
|
static <B extends Bean> |
of(java.lang.Class<B> beanType,
java.lang.String[] fieldNames,
java.util.function.Supplier<BeanBuilder<B>> builderSupplier,
java.util.List<java.util.function.Function<B,java.lang.Object>> getters,
java.util.List<java.util.function.BiConsumer<B,java.lang.Object>> setters) |
Obtains an instance of the meta-bean for mutable beans.
|
static <B extends Bean> |
of(java.lang.Class<B> beanType,
java.util.function.Supplier<BeanBuilder<B>> builderSupplier,
java.util.function.Function<B,java.lang.Object>... getters) |
Deprecated.
Use version that takes the field names
|
static <B extends Bean> |
of(java.lang.Class<B> beanType,
java.util.function.Supplier<BeanBuilder<B>> builderSupplier,
java.util.List<java.util.function.Function<B,java.lang.Object>> getters,
java.util.List<java.util.function.BiConsumer<B,java.lang.Object>> setters) |
Deprecated.
Use version that takes the field names
|
java.lang.String |
toString() |
Returns a string that summarises the meta-bean.
|
annotation, annotations, beanName, metaProperty, metaPropertyCount, metaPropertyExists, metaPropertyIterable, of, register@Deprecated @SafeVarargs public static <B extends Bean> MinimalMetaBean<B> of(java.lang.Class<B> beanType, java.util.function.Supplier<BeanBuilder<B>> builderSupplier, java.util.function.Function<B,java.lang.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(java.lang.Class<B> beanType, java.lang.String[] fieldNames, java.util.function.Supplier<BeanBuilder<B>> builderSupplier, java.util.function.Function<B,java.lang.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(java.lang.Class<B> beanType, java.util.function.Supplier<BeanBuilder<B>> builderSupplier, java.util.List<java.util.function.Function<B,java.lang.Object>> getters, java.util.List<java.util.function.BiConsumer<B,java.lang.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(java.lang.Class<B> beanType, java.lang.String[] fieldNames, java.util.function.Supplier<BeanBuilder<B>> builderSupplier, java.util.List<java.util.function.Function<B,java.lang.Object>> getters, java.util.List<java.util.function.BiConsumer<B,java.lang.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 java.lang.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 java.util.Map<java.lang.String,MetaProperty<?>> metaPropertyMap()
MetaBean
Where possible, use MetaBean.metaPropertyIterable() instead as it typically has better performance.
metaPropertyMap in interface MetaBeanpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2007–2018 Joda.org. All rights reserved.