org.springframework.roo.classpath.scanner
Interface MemberDetailsDecorator

All Known Subinterfaces:
CustomDataKeyDecorator
All Known Implementing Classes:
CustomDataKeyDecoratorImpl

public interface MemberDetailsDecorator

Provides the ability to modify or log the result of a MemberDetailsScanner operation before the method returns. This is useful to customize the results for a particular requesting class.

Since:
1.1
Author:
Ben Alex

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.
 

Method Detail

decorate

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.

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.

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

MemberDetails decorateTypes(String requestingClass,
                            MemberDetails memberDetails)
Performs essentially the same function as decorate but only decorates MemberHoldingTypeDetails instances and ignores the type's members.

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)


Copyright © 2009–2015. All rights reserved.