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

java.lang.Object
  extended by org.springframework.roo.classpath.customdata.taggers.CustomDataKeyDecoratorImpl
All Implemented Interfaces:
CustomDataKeyDecorator, MemberDetailsDecorator

@Service
public class CustomDataKeyDecoratorImpl
extends Object
implements CustomDataKeyDecorator

An implementation of CustomDataKeyDecorator.

Since:
1.1.3
Author:
James Tyrrell

Constructor Summary
CustomDataKeyDecoratorImpl()
           
 
Method Summary
 MemberDetails decorate(String requestingClass, MemberDetails memberDetails)
          Evaluates the incoming MemberDetails and either (a) returns the same instance if no changes are necessary or (b) returns a new instance of MemberDetails if changes are needed.
 MemberDetails decorateTypes(String requestingClass, MemberDetails memberDetails)
          Performs essentially the same function as decorate but only decorates MemberHoldingTypeDetails instances and ignores the type's members.
 List<ConstructorMatcher> getConstructorTaggers()
           
 List<FieldMatcher> getFieldTaggers()
           
 String getInflectorPlural(String term, Locale locale)
          This method returns the plural term as per inflector.
 List<MethodMatcher> getMethodTaggers()
           
 List<TypeMatcher> getTypeTaggers()
           
 void registerMatcher(String addingClass, Matcher<? extends org.springframework.roo.model.CustomDataAccessor> matcher)
          Registers the given matcher on behalf of the class with the given fully- qualified name.
 void registerMatchers(Class<?> addingClass, Matcher<? extends org.springframework.roo.model.CustomDataAccessor>... matchers)
          Registers the given matchers on behalf of the given class
 void unregisterMatchers(Class<?> addingClass)
          Unregisters any matchers registered by the given class
 void unregisterMatchers(String addingClass)
          Unregisters any matchers registered by the given class
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CustomDataKeyDecoratorImpl

public CustomDataKeyDecoratorImpl()
Method Detail

decorate

public MemberDetails decorate(String requestingClass,
                              MemberDetails memberDetails)
Description copied from interface: MemberDetailsDecorator
Evaluates the incoming MemberDetails and either (a) returns the same instance if no changes are necessary or (b) returns a new instance of MemberDetails if changes are needed.

This method will be called repeatedly until such time as every MemberDetailsDecorator returns the same MemberDetails instance as was passed. It is therefore essential that a new instance is only returned if an actual change to the result is required. An implementation can safely return the same MemberDetails as it was passed if in doubt, as it will always be re-invoked later on if another decorator changes the MemberDetails instance. Thus even decorators that depend on other decorators populating the MemberDetails (eg with new CustomDataAccessor information) can be executed in any order whatsoever, as they need only look for the expected data and return the same MemberDetails if it is not found.

Specified by:
decorate in interface MemberDetailsDecorator
Parameters:
requestingClass - the fully-qualified class name requesting the member details (required)
memberDetails - the current member holders (required)
Returns:
the originally-passed details (where possible) or a replacement details (never returns null)

decorateTypes

public MemberDetails decorateTypes(String requestingClass,
                                   MemberDetails memberDetails)
Description copied from interface: MemberDetailsDecorator
Performs essentially the same function as decorate but only decorates MemberHoldingTypeDetails instances and ignores the type's members.

Specified by:
decorateTypes in interface MemberDetailsDecorator
Parameters:
requestingClass - the fully-qualified class name requesting the member details (required)
memberDetails - the current member holders (required)
Returns:
the originally-passed details (where possible) or a replacement details (never returns null)

getConstructorTaggers

public List<ConstructorMatcher> getConstructorTaggers()

getFieldTaggers

public List<FieldMatcher> getFieldTaggers()

getInflectorPlural

public String getInflectorPlural(String term,
                                 Locale locale)
This method returns the plural term as per inflector. ATTENTION: this method does NOT take @RooPlural into account. Use getPlural(..) instead!

Parameters:
term - The term to be pluralized
locale - Locale
Returns:
pluralized term

getMethodTaggers

public List<MethodMatcher> getMethodTaggers()

getTypeTaggers

public List<TypeMatcher> getTypeTaggers()

registerMatcher

public void registerMatcher(String addingClass,
                            Matcher<? extends org.springframework.roo.model.CustomDataAccessor> matcher)
Description copied from interface: CustomDataKeyDecorator
Registers the given matcher on behalf of the class with the given fully- qualified name.

Specified by:
registerMatcher in interface CustomDataKeyDecorator
Parameters:
addingClass - the name of the class registering the matcher (required)
matcher - the matcher to register (required)

registerMatchers

public void registerMatchers(Class<?> addingClass,
                             Matcher<? extends org.springframework.roo.model.CustomDataAccessor>... matchers)
Description copied from interface: CustomDataKeyDecorator
Registers the given matchers on behalf of the given class

Specified by:
registerMatchers in interface CustomDataKeyDecorator
Parameters:
addingClass - the class registering the matchers (can be null not to register any matchers)
matchers - the matchers to register (can be none)

unregisterMatchers

public void unregisterMatchers(Class<?> addingClass)
Description copied from interface: CustomDataKeyDecorator
Unregisters any matchers registered by the given class

Specified by:
unregisterMatchers in interface CustomDataKeyDecorator
Parameters:
addingClass - the class whose matchers are to be unregistered (required)

unregisterMatchers

public void unregisterMatchers(String addingClass)
Description copied from interface: CustomDataKeyDecorator
Unregisters any matchers registered by the given class

Specified by:
unregisterMatchers in interface CustomDataKeyDecorator
Parameters:
addingClass - the fully-qualified name of the class whose matchers are to be unregistered (required)


Copyright © 2009–2015. All rights reserved.