org.joda.beans.impl.direct
Class DirectMetaBean

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

public abstract class DirectMetaBean
extends BasicMetaBean

A meta-bean implementation designed for use by the code generator.


Constructor Summary
DirectMetaBean()
           
 
Method Summary
<R> MetaProperty<R>
metaProperty(String propertyName)
          Gets a meta-property by name.
protected  MetaProperty<?> metaPropertyGet(String propertyName)
          Gets the meta-property by name.
protected  Object propertyGet(Bean bean, String propertyName, boolean quiet)
          Gets the value of the property.
protected  void propertySet(Bean bean, String propertyName, Object value, boolean quiet)
          Sets the value of the property.
protected  void validate(Bean bean)
          Validates the values of the properties.
 
Methods inherited from class org.joda.beans.impl.BasicMetaBean
beanName, createPropertyMap, metaPropertyCount, metaPropertyExists, metaPropertyIterable, toString
 
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

DirectMetaBean

public DirectMetaBean()
Method Detail

metaProperty

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

Each meta-bean manages a single bean with a known set of properties. This method returns the property with the specified 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
Overrides:
metaProperty in class BasicMetaBean
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

metaPropertyGet

protected MetaProperty<?> metaPropertyGet(String propertyName)
Gets the meta-property by name.

This implementation returns null, and must be overridden in subclasses.

Parameters:
propertyName - the property name, not null
Returns:
the meta-property, null if not found

propertyGet

protected Object propertyGet(Bean bean,
                             String propertyName,
                             boolean quiet)
Gets the value of the property.

Parameters:
bean - the bean to query, not null
propertyName - the property name, not null
quiet - true to return null if unable to read
Returns:
the value of the property, may be null
Throws:
NoSuchElementException - if the property name is invalid

propertySet

protected void propertySet(Bean bean,
                           String propertyName,
                           Object value,
                           boolean quiet)
Sets the value of the property.

Parameters:
bean - the bean to update, not null
propertyName - the property name, not null
value - the value of the property, may be null
quiet - true to take no action if unable to write
Throws:
NoSuchElementException - if the property name is invalid

validate

protected void validate(Bean bean)
Validates the values of the properties.

Parameters:
bean - the bean to validate, not null
Throws:
RuntimeException - if a property is invalid


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