public abstract class AbstractGenerator extends Object implements ConfigurableGenerator
Modifier and Type | Class and Description |
---|---|
static class |
AbstractGenerator.Extender |
static class |
AbstractGenerator.Filter |
static class |
AbstractGenerator.Grouper |
static class |
AbstractGenerator.Inserter |
static class |
AbstractGenerator.Sorter |
StructureGenerator.ApplicabilityChecker, StructureGenerator.Context, StructureGenerator.EffectContext, StructureGenerator.GenerationContext, StructureGenerator.HandlingContext, StructureGenerator.ItemChangeFilterContext
Constructor and Description |
---|
AbstractGenerator() |
Modifier and Type | Method and Description |
---|---|
void |
addDefaultFormParameters(Map<String,Object> form)
Fills the parameter map for the edit form Velocity template with default
values for a new generator item of this type.
|
void |
addParametersForSummary(Map<String,Object> parameters,
Map<String,Object> summaryParameters)
Given the generator-specific parameters, fills the parameter map for
the summary Velocity template.
|
void |
addParametersToForm(Map<String,Object> parameters,
Map<String,Object> form)
Given the generator-specific parameters, fills the parameter map for
the edit form Velocity template.
|
Map<String,Object> |
buildParametersFromForm(Map<String,Object> form,
ErrorCollection errors)
Validates the parameters from the edit HTML form and constructs a
serializable map of generator-specific parameters.
|
List<GeneratorPreset> |
getPresets() |
boolean |
isAvailable()
Checks if this generator is currently available in the Automation menu on UI.
|
protected static Map<String,Object> |
mapOf(String key,
Object value) |
protected static Map<String,Object> |
mapOf(String key1,
Object value1,
String key2,
Object value2) |
public void addDefaultFormParameters(@NotNull Map<String,Object> form) throws GeneratorUnavailableException
StructureGenerator
addDefaultFormParameters
in interface StructureGenerator
form
- form template parameters (output)GeneratorUnavailableException
- if the operation cannot be performedpublic void addParametersToForm(@NotNull Map<String,Object> parameters, @NotNull Map<String,Object> form) throws GeneratorUnavailableException
StructureGenerator
addParametersToForm
in interface StructureGenerator
parameters
- generator parameters (input)form
- edit form template parameters (output)GeneratorUnavailableException
- if the operation cannot be performed@NotNull public Map<String,Object> buildParametersFromForm(@NotNull Map<String,Object> form, @NotNull ErrorCollection errors) throws GeneratorUnavailableException
StructureGenerator
Validates the parameters from the edit HTML form and constructs a serializable map of generator-specific parameters.
Any errors for invalid input parameters must be reported to the provided
ErrorCollection
; if it contains any error messages after this
method is called, they are reported to the user and the resulting map
is ignored.
The resulting parameter map could be stored in the database or transferred over the wire, so it must be serializable to JSON. We advise that you put in only simple objects (strings, numbers, booleans), serializable maps, or lists thereof.
buildParametersFromForm
in interface StructureGenerator
form
- the parameters from the edit HTML form (input)errors
- the collector for error messages (output)GeneratorUnavailableException
- if the operation cannot be performedpublic void addParametersForSummary(@NotNull Map<String,Object> parameters, @NotNull Map<String,Object> summaryParameters)
StructureGenerator
Given the generator-specific parameters, fills the parameter map for the summary Velocity template.
addParametersForSummary
in interface StructureGenerator
parameters
- generator parameters (input)summaryParameters
- summary template parameters (output)protected static Map<String,Object> mapOf(String key1, Object value1, String key2, Object value2)
@Nullable public List<GeneratorPreset> getPresets()
getPresets
in interface ConfigurableGenerator
public boolean isAvailable()
StructureGenerator
Checks if this generator is currently available in the Automation menu on UI.
For example, a generator can be unavailable when a certain plug-in is missing, or a certain application feature is disabled.
Note that Structure doesn't stop work of existing generator items if the generator is unavailable. Structure only hides the generator from the Automation menu so users can't create new items from UI.
isAvailable
in interface StructureGenerator
Copyright © 2024 Tempo Software. All Rights Reserved.