org.springframework.roo.classpath.layers
Interface LayerProvider

All Known Implementing Classes:
CoreLayerProvider, LayerAdapter

public interface LayerProvider

Provides persistence-related methods at a given layer of the application.

Since:
1.2.0
Author:
Stefan Schmidt

Field Summary
static int CORE_LAYER_PRIORITY
          The priority of the core layers.
 
Method Summary
 int getLayerPosition()
          Returns the position of this layer relative to others.
 MemberTypeAdditions getMemberTypeAdditions(String callerMID, String methodIdentifier, org.springframework.roo.model.JavaType targetEntity, org.springframework.roo.model.JavaType idType, boolean autowire, MethodParameter... methodParameters)
          A layer provider should determine if it can provide MemberTypeAdditions for a given target entity and construct it accordingly.
 MemberTypeAdditions getMemberTypeAdditions(String callerMID, String methodIdentifier, org.springframework.roo.model.JavaType targetEntity, org.springframework.roo.model.JavaType idType, MethodParameter... methodParameters)
          A layer provider should determine if it can provide MemberTypeAdditions for a given target entity and construct it accordingly.
 int getPriority()
          Returns the priority of this layer relative to other implementations with the same position.
 

Field Detail

CORE_LAYER_PRIORITY

static final int CORE_LAYER_PRIORITY
The priority of the core layers.

See Also:
Constant Field Values
Method Detail

getLayerPosition

int getLayerPosition()
Returns the position of this layer relative to others.

Returns:
a large number for higher-level layers, a smaller number for lower-level layers

getMemberTypeAdditions

MemberTypeAdditions getMemberTypeAdditions(String callerMID,
                                           String methodIdentifier,
                                           org.springframework.roo.model.JavaType targetEntity,
                                           org.springframework.roo.model.JavaType idType,
                                           boolean autowire,
                                           MethodParameter... methodParameters)
A layer provider should determine if it can provide MemberTypeAdditions for a given target entity and construct it accordingly. If it can not provide the requested functionality it should simply return null;

Parameters:
callerMID - the caller's metadata ID
methodIdentifier - specifies the method which is being requested
targetEntity - specifies the target entity
idType - specifies the ID type used by the target entity
autowire - specified where the addition should be autowired (if applicable)
methodParameters - parameters which are passed in to the method
Returns:
MemberTypeAdditions if a layer provider can offer this functionality, null otherwise

getMemberTypeAdditions

MemberTypeAdditions getMemberTypeAdditions(String callerMID,
                                           String methodIdentifier,
                                           org.springframework.roo.model.JavaType targetEntity,
                                           org.springframework.roo.model.JavaType idType,
                                           MethodParameter... methodParameters)
A layer provider should determine if it can provide MemberTypeAdditions for a given target entity and construct it accordingly. If it can not provide the requested functionality it should simply return null;

Parameters:
callerMID - the caller's metadata ID
methodIdentifier - specifies the method which is being requested
targetEntity - specifies the target entity
idType - specifies the ID type used by the target entity
methodParameters - parameters which are passed in to the method
Returns:
MemberTypeAdditions if a layer provider can offer this functionality, null otherwise

getPriority

int getPriority()
Returns the priority of this layer relative to other implementations with the same position.

Returns:
a value greater than CORE_LAYER_PRIORITY in order to take precedence over the core LayerProviders
See Also:
getLayerPosition()


Copyright © 2009–2015. All rights reserved.