org.jboss.wsf.common.injection.finders
Class ResourceFieldFinder
java.lang.Object
org.jboss.wsf.common.reflection.AccessibleObjectProcessorAdapter<A>
org.jboss.wsf.common.reflection.AbstractClassProcessor<AO>
org.jboss.wsf.common.reflection.AbstractAnnotatedClassProcessor<java.lang.reflect.Field,A>
org.jboss.wsf.common.reflection.AnnotatedFieldFinder<javax.annotation.Resource>
org.jboss.wsf.common.injection.finders.ResourceFieldFinder
- All Implemented Interfaces:
- AccessibleObjectProcessor<java.lang.reflect.Field>, AnnotationAware<javax.annotation.Resource>, ClassProcessor<java.lang.reflect.Field>
public final class ResourceFieldFinder
- extends AnnotatedFieldFinder<javax.annotation.Resource>
Field based resource injection.
To access a resource a developer declares a setter method and annotates it as being a
resource reference. The name and type of resource maybe inferred by inspecting the
method declaration if necessary. The name of the resource, if not declared, is the
name of the JavaBeans property as determined starting from the name of the setter
method in question. The setter method must follow the standard JavaBeans
convention - name starts with a “set”, void return type and only one parameter.
Additionally, the type of the parameter must be compatible with the type specified
as a property of the Resource if present.
- Author:
- Richard Opalka
Constructor Summary |
ResourceFieldFinder(java.lang.Class<?> accept,
boolean include)
Constructor. |
Method Summary |
boolean |
matches(java.lang.reflect.Field field)
By default accessible object always matches all criteria. |
void |
validate(java.lang.reflect.Field field)
By default validation of accessible object passes. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ResourceFieldFinder
public ResourceFieldFinder(java.lang.Class<?> accept,
boolean include)
- Constructor.
- Parameters:
accept
- filtering classinclude
- whether include/exclude filtering class
validate
public void validate(java.lang.reflect.Field field)
- Description copied from class:
AccessibleObjectProcessorAdapter
- By default validation of accessible object passes.
- Specified by:
validate
in interface AccessibleObjectProcessor<java.lang.reflect.Field>
- Overrides:
validate
in class AccessibleObjectProcessorAdapter<java.lang.reflect.Field>
- Parameters:
field
- object to validate
matches
public boolean matches(java.lang.reflect.Field field)
- Description copied from class:
AccessibleObjectProcessorAdapter
- By default accessible object always matches all criteria.
- Specified by:
matches
in interface AccessibleObjectProcessor<java.lang.reflect.Field>
- Overrides:
matches
in class AbstractAnnotatedClassProcessor<java.lang.reflect.Field,javax.annotation.Resource>
- Parameters:
field
- to check
- Returns:
- true if accessible object matches the criteria, false otherwise
Copyright © 2009 JBoss, a division of Red Hat. All Rights Reserved.