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

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

public class FieldMatcher
extends Object
implements Matcher<FieldMetadata>

A Matcher for FieldMetadata-that matches on the presence of at least one of a given list of annotations.

Since:
1.1.3
Author:
James Tyrrell, Andrew Swan

Field Summary
static FieldMatcher JPA_COLUMN
           
static FieldMatcher JPA_EMBEDDED
           
static FieldMatcher JPA_EMBEDDED_ID
           
static FieldMatcher JPA_ENUMERATED
           
static FieldMatcher JPA_ID
           
static FieldMatcher JPA_LOB
           
static FieldMatcher JPA_MANY_TO_MANY
           
static FieldMatcher JPA_MANY_TO_ONE
           
static FieldMatcher JPA_ONE_TO_MANY
           
static FieldMatcher JPA_ONE_TO_ONE
           
static FieldMatcher JPA_TRANSIENT
           
static FieldMatcher JPA_VERSION
           
 
Constructor Summary
FieldMatcher(org.springframework.roo.model.CustomDataKey<FieldMetadata> customDataKey, AnnotationMetadata... annotations)
          Constructor for matching on any of the given annotations
FieldMatcher(org.springframework.roo.model.CustomDataKey<FieldMetadata> customDataKey, Collection<AnnotationMetadata> annotations)
          Constructor for matching on any of the given annotations
 
Method Summary
 org.springframework.roo.model.CustomDataKey<FieldMetadata> getCustomDataKey()
          Returns a key indicating the type of custom data returned by Matcher.matches(List)
 Object getTagValue(FieldMetadata field)
          Returns the value associated with the given key that should be applied to the matched instance.
 List<FieldMetadata> matches(List<MemberHoldingTypeDetails> memberHoldingTypeDetailsList)
          Returns the CustomDataAccessors for any elements of the given list that meet this matcher's inclusion criteria.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JPA_COLUMN

public static final FieldMatcher JPA_COLUMN

JPA_EMBEDDED

public static final FieldMatcher JPA_EMBEDDED

JPA_EMBEDDED_ID

public static final FieldMatcher JPA_EMBEDDED_ID

JPA_ENUMERATED

public static final FieldMatcher JPA_ENUMERATED

JPA_ID

public static final FieldMatcher JPA_ID

JPA_LOB

public static final FieldMatcher JPA_LOB

JPA_MANY_TO_MANY

public static final FieldMatcher JPA_MANY_TO_MANY

JPA_MANY_TO_ONE

public static final FieldMatcher JPA_MANY_TO_ONE

JPA_ONE_TO_MANY

public static final FieldMatcher JPA_ONE_TO_MANY

JPA_ONE_TO_ONE

public static final FieldMatcher JPA_ONE_TO_ONE

JPA_TRANSIENT

public static final FieldMatcher JPA_TRANSIENT

JPA_VERSION

public static final FieldMatcher JPA_VERSION
Constructor Detail

FieldMatcher

public FieldMatcher(org.springframework.roo.model.CustomDataKey<FieldMetadata> customDataKey,
                    AnnotationMetadata... annotations)
Constructor for matching on any of the given annotations

Parameters:
customDataKey - the custom data key indicating the type of field (required)
annotations - the annotations to match upon
Since:
1.2.0

FieldMatcher

public FieldMatcher(org.springframework.roo.model.CustomDataKey<FieldMetadata> customDataKey,
                    Collection<AnnotationMetadata> annotations)
Constructor for matching on any of the given annotations

Parameters:
customDataKey - the custom data key indicating the type of field (required)
annotations - the annotations to match upon (can be null)
Method Detail

getCustomDataKey

public org.springframework.roo.model.CustomDataKey<FieldMetadata> 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<FieldMetadata>
Returns:
a non-null key

getTagValue

public Object getTagValue(FieldMetadata field)
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<FieldMetadata>
Parameters:
field - the custom data key
Returns:
a value (can be null)

matches

public List<FieldMetadata> 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<FieldMetadata>
Parameters:
memberHoldingTypeDetailsList - the list to check for matches
Returns:
a non-null list


Copyright © 2009–2015. All rights reserved.