org.joda.beans.impl
Class BasicMetaBean

java.lang.Object
  extended by org.joda.beans.impl.BasicMetaBean
All Implemented Interfaces:
MetaBean
Direct Known Subclasses:
DirectMetaBean

public abstract class BasicMetaBean
extends Object
implements MetaBean

Basic implementation of MetaBean.


Constructor Summary
BasicMetaBean()
           
 
Method Summary
 String beanName()
          Gets the bean name, which is normally the fully qualified class name of the bean.
 PropertyMap createPropertyMap(Bean bean)
          Creates a map of properties for the specified bean.
<R> MetaProperty<R>
metaProperty(String propertyName)
          Gets a meta-property by name.
 int metaPropertyCount()
          Counts the number of properties.
 boolean metaPropertyExists(String propertyName)
          Checks if a property exists.
 Iterable<MetaProperty<?>> metaPropertyIterable()
          Gets an iterator of meta-properties.
 String toString()
          Returns a string that summarises the meta-bean.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.joda.beans.MetaBean
beanType, builder, metaPropertyMap
 

Constructor Detail

BasicMetaBean

public BasicMetaBean()
Method Detail

createPropertyMap

public PropertyMap createPropertyMap(Bean bean)
Description copied from interface: MetaBean
Creates a map of properties for the specified bean.

Specified by:
createPropertyMap in interface MetaBean
Parameters:
bean - the bean to create the map for, not null
Returns:
the created property map, not null

beanName

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

Specified by:
beanName in interface MetaBean
Returns:
the name of the bean, not empty

metaPropertyCount

public int metaPropertyCount()
Description copied from interface: MetaBean
Counts the number of properties.

Specified by:
metaPropertyCount in interface MetaBean
Returns:
the number of properties

metaPropertyExists

public boolean metaPropertyExists(String propertyName)
Description copied from interface: MetaBean
Checks if a property exists.

Specified by:
metaPropertyExists in interface MetaBean
Parameters:
propertyName - the property name to check, null returns false
Returns:
true if the property exists

metaProperty

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

The base interface throws an exception if the name is not recognised. By contrast, the DynamicMetaBean subinterface creates the property on demand.

Specified by:
metaProperty in interface MetaBean
Type Parameters:
R - the property type, optional, enabling auto-casting
Parameters:
propertyName - the property name to retrieve, not null
Returns:
the meta property, not null

metaPropertyIterable

public Iterable<MetaProperty<?>> metaPropertyIterable()
Description copied from interface: MetaBean
Gets an iterator of meta-properties.

This method returns an Iterable, which is simpler than a Map. As a result, implementations may be able to optimise, and so this method should be preferred to MetaBean.metaPropertyMap() where a choice is possible.

Specified by:
metaPropertyIterable in interface MetaBean
Returns:
the unmodifiable map of meta property objects, not null

toString

public String toString()
Returns a string that summarises the meta-bean.

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


Copyright © 2007–2013 Joda.org. All rights reserved.