net.sf.qualitytest.blueprint
Interface MatchingStrategy

All Known Implementing Classes:
AbstractTypeMatchingStrategy, ArrayTypeMatchingStrategy, BuilderMethodMatchingStrategy, CaseInsensitiveMethodNameMatchingStrategy, InstanceOfTypeMatchingStrategy, SetterMethodMatchingStrategy, TypeMatchingStrategy

public interface MatchingStrategy

Strategy to determine if an attribute matches and should be replaced with a certain value. An attribute can be matched by name or type. A MatchingStrategy should implement hashCode so that matching strategies for the same object/type can be detected and the last one added can be used.

Author:
Dominik Seichter
See Also:
ValueCreationStrategy

Method Summary
 boolean matchesByField(Field field)
          Test if a field matches this strategy.
 boolean matchesByMethod(Method method)
          Test if a method matches this strategy.
 boolean matchesByType(Class<?> clazz)
          Test if a type matches this strategy.
 

Method Detail

matchesByField

boolean matchesByField(@Nonnull
                       Field field)
Test if a field matches this strategy.

Parameters:
field - A field
Returns:
true if the strategy matches and the ValueCreationStrategy should be applied

matchesByMethod

boolean matchesByMethod(@Nonnull
                        Method method)
Test if a method matches this strategy.

Parameters:
method - A method
Returns:
true if the strategy matches and the ValueCreationStrategy should be applied

matchesByType

boolean matchesByType(@Nonnull
                      Class<?> clazz)
Test if a type matches this strategy.

Parameters:
clazz - a clazz type
Returns:
true if the strategy matches and the ValueCreationStrategy should be applied


Copyright © 2012-2013. All Rights Reserved.