org.specrunner.parameters.core
Class AccessFactoryImpl

java.lang.Object
  extended by org.specrunner.parameters.core.AccessFactoryImpl
All Implemented Interfaces:
IAccessFactory

public class AccessFactoryImpl
extends Object
implements IAccessFactory

Default implementation of IAccessFactory.

Author:
Thiago Santos

Field Summary
protected  ICache<String,IAccess> cache
          Cache for access information.
 
Constructor Summary
AccessFactoryImpl()
           
 
Method Summary
protected  IAccess lookupBean(Object target, String name)
          Lookup for a bean property.
protected  IAccess lookupField(Class<?> clazz, String name)
          Lookup for a public attribute.
protected  IAccess lookupMethod(Class<?> clazz, String name)
          Lookup for public method.
 IAccess newAccess(Object target, String name)
          Create access information for a given object and a given feature.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cache

protected ICache<String,IAccess> cache
Cache for access information.

Constructor Detail

AccessFactoryImpl

public AccessFactoryImpl()
Method Detail

newAccess

public IAccess newAccess(Object target,
                         String name)
Description copied from interface: IAccessFactory
Create access information for a given object and a given feature.

Specified by:
newAccess in interface IAccessFactory
Parameters:
target - The target object.
name - The feature name.
Returns:
The access abstraction.

lookupBean

protected IAccess lookupBean(Object target,
                             String name)
Lookup for a bean property.

Parameters:
target - The object instance.
name - The feature name.
Returns:
The access object, if property exists, null, otherwise.

lookupField

protected IAccess lookupField(Class<?> clazz,
                              String name)
Lookup for a public attribute.

Parameters:
clazz - The class.
name - The feature name.
Returns:
The access object, if the field exists, null, otherwise.

lookupMethod

protected IAccess lookupMethod(Class<?> clazz,
                               String name)
Lookup for public method.

Parameters:
clazz - The class.
name - The feature name.
Returns:
The access object, if the method exists, null, otherwise.


Copyright © 2014. All rights reserved.