org.joda.beans
Class StandardMetaBean<B extends Bean<B>>

java.lang.Object
  extended by org.joda.beans.StandardMetaBean<B>
Type Parameters:
B - the type of the bean
All Implemented Interfaces:
MetaBean<B>

public final class StandardMetaBean<B extends Bean<B>>
extends Object
implements MetaBean<B>

A standard meta-bean implementation.

This is the standard implementation of a meta-bean. It requires that the bean implements Bean and has a no-arguments constructor.

Author:
Stephen Colebourne

Method Summary
 Class<B> beanClass()
          Get the type of the bean represented as a Class.
 Bean<B> createBean()
          Creates a new instance of the bean represented by this meta bean.
 Map<String,Property<B,?>> createPropertyMap(B bean)
          Creates a map of properties for the specified bean.
 MetaProperty<B,?> metaProperty(String propertyName)
          Gets a meta property by name.
 Map<String,MetaProperty<B,?>> metaPropertyMap()
          Gets the map of meta properties, keyed by property name.
 String name()
          Gets the bean name, which is normally the fully qualified class name of the bean.
static
<B extends Bean<B>>
StandardMetaBean<B>
of(Class<B> beanClass)
          Factory to create a meta-bean avoiding duplicate generics.
 String toString()
          Returns a string that summarizes the property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

of

public static <B extends Bean<B>> StandardMetaBean<B> of(Class<B> beanClass)
Factory to create a meta-bean avoiding duplicate generics.

Parameters:
beanClass - the bean class, not null

createBean

public Bean<B> createBean()
Description copied from interface: MetaBean
Creates a new instance of the bean represented by this meta bean.

Specified by:
createBean in interface MetaBean<B extends Bean<B>>
Returns:
the created bean, never null

createPropertyMap

public Map<String,Property<B,?>> createPropertyMap(B bean)
Description copied from interface: MetaBean
Creates a map of properties for the specified bean.

Specified by:
createPropertyMap in interface MetaBean<B extends Bean<B>>
Parameters:
bean - the bean to create the map for, not null
Returns:
the created property map, never null

name

public String name()
Description copied from interface: MetaBean
Gets the bean name, which is normally the fully qualified class name of the bean.

Specified by:
name in interface MetaBean<B extends Bean<B>>
Returns:
the name of the bean, never null

beanClass

public Class<B> beanClass()
Description copied from interface: MetaBean
Get the type of the bean represented as a Class.

Specified by:
beanClass in interface MetaBean<B extends Bean<B>>
Returns:
the type of the bean, never null

metaProperty

public MetaProperty<B,?> metaProperty(String propertyName)
Description copied from interface: MetaBean
Gets a meta property by name.

Specified by:
metaProperty in interface MetaBean<B extends Bean<B>>
Parameters:
propertyName - the property name to retrieve, null throws NoSuchElementException
Returns:
the meta property, never null

metaPropertyMap

public Map<String,MetaProperty<B,?>> metaPropertyMap()
Description copied from interface: MetaBean
Gets the map of meta properties, keyed by property name.

Specified by:
metaPropertyMap in interface MetaBean<B extends Bean<B>>
Returns:
the unmodifiable map of meta property objects, never null

toString

public String toString()
Returns a string that summarizes the property.

Overrides:
toString in class Object
Returns:
a summary string, never null


Copyright © 2007-2010 Joda.org. All Rights Reserved.