org.springframework.roo.classpath.layers
Class LayerTypeMatcher

java.lang.Object
  extended by org.springframework.roo.classpath.customdata.taggers.TypeMatcher
      extended by org.springframework.roo.classpath.customdata.taggers.AnnotatedTypeMatcher
          extended by org.springframework.roo.classpath.layers.LayerTypeMatcher
All Implemented Interfaces:
Matcher<MemberHoldingTypeDetails>

public class LayerTypeMatcher
extends AnnotatedTypeMatcher

A Matcher used for layering support; identifies layer components (services, repositories, etc) by the presence of a given tag, and sets each such component's CustomDataKeys.LAYER_TYPE tag to a list of the domain types managed by that component (as a List<JavaType>).

Since:
1.2.0
Author:
Stefan Schmidt

Constructor Summary
LayerTypeMatcher(org.springframework.roo.model.JavaType layerAnnotation, org.springframework.roo.model.JavaSymbolName domainTypesAttribute)
          Constructor
 
Method Summary
 Object getTagValue(MemberHoldingTypeDetails type)
          Returns the value associated with the given key that should be applied to the matched instance.
 
Methods inherited from class org.springframework.roo.classpath.customdata.taggers.AnnotatedTypeMatcher
getCustomDataKey, matches
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LayerTypeMatcher

public LayerTypeMatcher(org.springframework.roo.model.JavaType layerAnnotation,
                        org.springframework.roo.model.JavaSymbolName domainTypesAttribute)
Constructor

Parameters:
layerAnnotation - the annotation type to match on and read attributes of (required)
domainTypesAttribute - the attribute of the above annotation that identifies the domain type(s) being managed (required)
Method Detail

getTagValue

public Object getTagValue(MemberHoldingTypeDetails type)
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<MemberHoldingTypeDetails>
Overrides:
getTagValue in class AnnotatedTypeMatcher
Parameters:
type - the custom data key
Returns:
a value (can be null)


Copyright © 2009–2015. All rights reserved.