org.apache.bval.jsr303
Class Jsr303MetaBeanFactory

java.lang.Object
  extended by org.apache.bval.jsr303.Jsr303MetaBeanFactory
All Implemented Interfaces:
MetaBeanFactory
Direct Known Subclasses:
MethodValidatorMetaBeanFactory

public class Jsr303MetaBeanFactory
extends Object
implements MetaBeanFactory

Description: process the class annotations for JSR303 constraint validations to build the MetaBean with information from annotations and JSR303 constraint mappings (defined in xml)


Field Summary
protected  AnnotationProcessor annotationProcessor
          AnnotationProcessor used.
protected  ApacheFactoryContext factoryContext
          ApacheFactoryContext used
protected static Logger log
          Shared log instance
 
Constructor Summary
Jsr303MetaBeanFactory(ApacheFactoryContext factoryContext)
          Create a new Jsr303MetaBeanFactory instance.
 
Method Summary
static MetaProperty addMetaProperty(MetaBean parentMetaBean, AccessStrategy access)
          Add a MetaProperty to a MetaBean.
 void buildMetaBean(MetaBean metabean)
          Initialize the specified MetaBean.
protected  boolean hasValidationConstraintsDefined(Method method)
          Learn whether a given Method has validation constraints defined via JSR303 annotations.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final Logger log
Shared log instance


factoryContext

protected final ApacheFactoryContext factoryContext
ApacheFactoryContext used


annotationProcessor

protected AnnotationProcessor annotationProcessor
AnnotationProcessor used.

Constructor Detail

Jsr303MetaBeanFactory

public Jsr303MetaBeanFactory(ApacheFactoryContext factoryContext)
Create a new Jsr303MetaBeanFactory instance.

Parameters:
factoryContext -
Method Detail

buildMetaBean

public void buildMetaBean(MetaBean metabean)
Initialize the specified MetaBean. Add the validation features to the metabean that come from JSR303 annotations in the beanClass.

Specified by:
buildMetaBean in interface MetaBeanFactory

hasValidationConstraintsDefined

protected boolean hasValidationConstraintsDefined(Method method)
Learn whether a given Method has validation constraints defined via JSR303 annotations.

Parameters:
method -
Returns:
true if constraints detected

addMetaProperty

public static MetaProperty addMetaProperty(MetaBean parentMetaBean,
                                           AccessStrategy access)
Add a MetaProperty to a MetaBean.

Parameters:
parentMetaBean -
access -
Returns:
the created MetaProperty


Copyright © 2010-2012 Apache Software Foundation. All Rights Reserved.