@groovy.transform.CompileStatic @java.lang.SuppressWarnings('AbstractClassWithoutAbstractMethod') abstract class AbstractBackendSpec
Base class for simplify implementation of backend specifications.
Modifiers | Name | Description |
---|---|---|
static java.lang.String |
DEFAULT_TOKEN_DELIMITER |
Type | Name and description |
---|---|
Provider<java.io.File> |
templateFile |
Provider<BackendTextTemplate> |
textTemplate |
java.util.Map<java.lang.String, java.lang.Object> |
tokens |
Constructor and description |
---|
protected AbstractBackendSpec
(ProjectOperations po, ObjectFactory objects) |
Type Params | Return Type | Name and description |
---|---|---|
|
void |
addTokenProvider(Provider<java.util.Map<java.lang.String, java.lang.Object>> tokenProvider) Adds a provider of tokens. |
|
void |
allTokenTemplate() The template is simply a dump of all tokens that were set. |
|
void |
clear() Reset all tokens as well as token delimiters. |
|
void |
configure(Action<? extends BackendSpec> configurator) Configures the backend according to a specification |
|
void |
configure(groovy.lang.Closure configurator) Configures the backend according to a specification |
|
void |
delimiterTokenPair(java.lang.String begin, java.lang.String end) Sets new delimiters for tokens. |
<T extends BackendSpec> |
static T |
findExtension(Project project, java.lang.Class<T> clazz) Utility method to find a backend extension on a project. |
<T extends BackendSpec> |
static T |
findExtension(Project project, java.lang.String sourceSetName, java.lang.Class<T> clazz) Utility to find a backend extension on a terraform source set. |
|
Provider<java.lang.String> |
getBeginTokenProvider() Starting delimiter for tokens. |
|
Provider<java.lang.String> |
getEndTokenProvider() Terminating delimiter for tokens |
|
protected ProjectOperations |
getProjectOperations() |
|
Provider<java.io.File> |
getTemplateFile() Returns location of template file. |
|
Provider<BackendTextTemplate> |
getTextTemplate() Returns text template. |
|
Provider<java.util.Map<java.lang.String, ?>> |
getTokenProvider() A provider for all the tokens that were set. |
|
java.util.Map<java.lang.String, java.lang.Object> |
getTokens() Returns the current set of tokens |
|
void |
setTemplateFile(java.lang.Object file) Applies a custom template file for backend configuration. |
|
void |
setTextTemplate(java.lang.Object text) Use a string as a template. |
|
void |
setTokens(java.util.Map<java.lang.String, java.lang.Object> newTokens) Replace all tokens with a new set. |
|
void |
token(java.lang.String key, java.lang.Object value) Set a single token value. |
|
protected void |
tokenPath(java.lang.String key, java.lang.Object p) Adds a token value that will be evaluated to a file path. |
|
void |
tokens(java.util.Map<java.lang.String, java.lang.Object> moreTokens) Adds more tokens. |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Adds a provider of tokens.
These providers are processed before any of the customisations on the class.
tokenProvider
- Addition provider of tokensThe template is simply a dump of all tokens that were set.
Reset all tokens as well as token delimiters.
Configures the backend according to a specification
configurator
- Configurating actionConfigures the backend according to a specification
configurator
- Configurating closureSets new delimiters for tokens.
Only useful when a custom template is used.
begin
- Start delimiter for tokensend
- End delimiter for tokensUtility method to find a backend extension on a project.
project
- Project context.clazz
- The type of the extension.Utility to find a backend extension on a terraform source set.
project
- Project contextsourceSetName
- Name of source set.clazz
- The type of the extension.Starting delimiter for tokens.
Only useful when a custom template is used.
Terminating delimiter for tokens
Only useful when a custom template is used.
Returns location of template file.
Returns text template.
A provider for all the tokens that were set.
Returns the current set of tokens
Applies a custom template file for backend configuration.
file
- Location of template fileUse a string as a template.
text
- Template that can be processed by Ant's ReplaceTokens
.Replace all tokens with a new set.
Only useful when a custom template is used.
newTokens
- New replacement setSet a single token value.
key
- Token namevalue
- Lazy-evaluted value. Anything that can resolve to a string.Adds a token value that will be evaluated to a file path.
key
- Token namep
- Object to be evaluated as a file path.Adds more tokens.
Only useful when a custom template is used.
moreTokens
- Additional tokens for replacement.Groovy Documentation