org.specrunner.parameters
Interface IAccess

All Known Implementing Classes:
AccessImpl

public interface IAccess

Abstraction for object feature access. The features can be a public attribute, a bean property, or a single method.

Author:
Thiago Santos

Method Summary
 Class<?>[] expected(Object target, String name, Object... args)
          Get the expected type(s) for a feature.
 Object get(Object target, String name, Object... args)
          Get the feature value.
 Annotation[] getAnnotations()
          Get the annotation information of a given access.
 boolean hasFeature()
          Check if access has feature associated or null.
 void set(Object target, String name, Object... args)
          Set the value to a given feature.
 boolean valid(Object target, String name, Object... args)
          Check if the given arguments are compatible with the feature named.
 

Method Detail

set

void set(Object target,
         String name,
         Object... args)
         throws Exception
Set the value to a given feature.

Parameters:
target - The target object.
name - The feature reference.
args - The arguments.
Throws:
Exception - On processing errors.

get

Object get(Object target,
           String name,
           Object... args)
           throws Exception
Get the feature value.

Parameters:
target - The target object.
name - The feature reference.
args - The arguments, if any.
Returns:
The value of feature.
Throws:
Exception - On processing errors.

valid

boolean valid(Object target,
              String name,
              Object... args)
Check if the given arguments are compatible with the feature named.

Parameters:
target - The target object.
name - The feature reference.
args - The arguments.
Returns:
true, if compatible, false, otherwise.

expected

Class<?>[] expected(Object target,
                    String name,
                    Object... args)
Get the expected type(s) for a feature.

Parameters:
target - The target object.
name - The feature reference.
args - The arguments.
Returns:
true, if compatible, false, otherwise.

hasFeature

boolean hasFeature()
Check if access has feature associated or null.

Returns:
true, for any associated feature, false, otherwise.

getAnnotations

Annotation[] getAnnotations()
Get the annotation information of a given access.

Returns:
The list of annotations associated to the access.


Copyright © 2014. All rights reserved.