org.springframework.roo.classpath.customdata.taggers
Class MethodMatcher

java.lang.Object
  extended by org.springframework.roo.classpath.customdata.taggers.MethodMatcher
All Implemented Interfaces:
Matcher<MethodMetadata>

public class MethodMatcher
extends Object
implements Matcher<MethodMetadata>

MethodMetadata specific implementation of Matcher. Matches are based on field name which is dynamically determined based on: the FieldMatchers presented; the type of method (accessor/mutator); the default method name; the user specified method name obtained from a particular Roo annotation; a plural/singular suffix of the referenced entity; and, an additional suffix.

Since:
1.1.3
Author:
James Tyrrell

Constructor Summary
MethodMatcher(Collection<? extends FieldMatcher> fieldTaggers, org.springframework.roo.model.CustomDataKey<MethodMetadata> customDataKey, boolean isAccessor)
          Constructor
MethodMatcher(org.springframework.roo.model.CustomDataKey<MethodMetadata> customDataKey, org.springframework.roo.model.JavaType catalystAnnotationType, org.springframework.roo.model.JavaSymbolName userDefinedNameAttribute, String defaultName)
          Constructor
MethodMatcher(org.springframework.roo.model.CustomDataKey<MethodMetadata> customDataKey, org.springframework.roo.model.JavaType catalystAnnotationType, org.springframework.roo.model.JavaSymbolName userDefinedNameAttribute, String defaultName, boolean suffixPlural, boolean suffixSingular)
          Constructor
MethodMatcher(org.springframework.roo.model.CustomDataKey<MethodMetadata> customDataKey, org.springframework.roo.model.JavaType catalystAnnotationType, org.springframework.roo.model.JavaSymbolName userDefinedNameAttribute, String defaultName, boolean suffixPlural, boolean suffixSingular, String additionalSuffix)
          Constructor
 
Method Summary
 org.springframework.roo.model.CustomDataKey<MethodMetadata> getCustomDataKey()
          Returns a key indicating the type of custom data returned by Matcher.matches(List)
 Object getTagValue(MethodMetadata key)
          Returns the value associated with the given key that should be applied to the matched instance.
 List<MethodMetadata> matches(List<MemberHoldingTypeDetails> memberHoldingTypeDetailsList)
          Returns the CustomDataAccessors for any elements of the given list that meet this matcher's inclusion criteria.
 List<MethodMetadata> matches(List<MemberHoldingTypeDetails> memberHoldingTypeDetailsList, Map<String,String> pluralMap)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MethodMatcher

public MethodMatcher(Collection<? extends FieldMatcher> fieldTaggers,
                     org.springframework.roo.model.CustomDataKey<MethodMetadata> customDataKey,
                     boolean isAccessor)
Constructor

Parameters:
fieldTaggers - can be null for none
customDataKey -
isAccessor -

MethodMatcher

public MethodMatcher(org.springframework.roo.model.CustomDataKey<MethodMetadata> customDataKey,
                     org.springframework.roo.model.JavaType catalystAnnotationType,
                     org.springframework.roo.model.JavaSymbolName userDefinedNameAttribute,
                     String defaultName)
Constructor

Parameters:
customDataKey -
catalystAnnotationType -
userDefinedNameAttribute -
defaultName -

MethodMatcher

public MethodMatcher(org.springframework.roo.model.CustomDataKey<MethodMetadata> customDataKey,
                     org.springframework.roo.model.JavaType catalystAnnotationType,
                     org.springframework.roo.model.JavaSymbolName userDefinedNameAttribute,
                     String defaultName,
                     boolean suffixPlural,
                     boolean suffixSingular)
Constructor

Parameters:
customDataKey -
catalystAnnotationType -
userDefinedNameAttribute -
defaultName -
suffixPlural -
suffixSingular -

MethodMatcher

public MethodMatcher(org.springframework.roo.model.CustomDataKey<MethodMetadata> customDataKey,
                     org.springframework.roo.model.JavaType catalystAnnotationType,
                     org.springframework.roo.model.JavaSymbolName userDefinedNameAttribute,
                     String defaultName,
                     boolean suffixPlural,
                     boolean suffixSingular,
                     String additionalSuffix)
Constructor

Parameters:
customDataKey -
catalystAnnotationType -
userDefinedNameAttribute -
defaultName -
suffixPlural -
suffixSingular -
additionalSuffix -
Method Detail

getCustomDataKey

public org.springframework.roo.model.CustomDataKey<MethodMetadata> getCustomDataKey()
Description copied from interface: Matcher
Returns a key indicating the type of custom data returned by Matcher.matches(List)

Specified by:
getCustomDataKey in interface Matcher<MethodMetadata>
Returns:
a non-null key

getTagValue

public Object getTagValue(MethodMetadata key)
Description copied from interface: Matcher
Returns the value associated with the given key that should be applied to the matched instance.

Specified by:
getTagValue in interface Matcher<MethodMetadata>
Parameters:
key - the custom data key
Returns:
a value (can be null)

matches

public List<MethodMetadata> matches(List<MemberHoldingTypeDetails> memberHoldingTypeDetailsList)
Description copied from interface: Matcher
Returns the CustomDataAccessors for any elements of the given list that meet this matcher's inclusion criteria.

Specified by:
matches in interface Matcher<MethodMetadata>
Parameters:
memberHoldingTypeDetailsList - the list to check for matches
Returns:
a non-null list

matches

public List<MethodMetadata> matches(List<MemberHoldingTypeDetails> memberHoldingTypeDetailsList,
                                    Map<String,String> pluralMap)


Copyright © 2009–2015. All rights reserved.