Class AbstractGenerator
- All Implemented Interfaces:
ConfigurableGenerator,StructureGenerator
- Direct Known Subclasses:
AbstractGenerator.Extender,AbstractGenerator.Filter,AbstractGenerator.Grouper,AbstractGenerator.Inserter,AbstractGenerator.Sorter
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classstatic classNested classes/interfaces inherited from interface StructureGenerator
StructureGenerator.ApplicabilityChecker, StructureGenerator.Context, StructureGenerator.EffectContext, StructureGenerator.GenerationContext, StructureGenerator.HandlingContext, StructureGenerator.ItemChangeFilterContext -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDefaultFormParameters(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.voidGiven the generator-specific parameters, fills the parameter map for the summary Velocity template.voidGiven the generator-specific parameters, fills the parameter map for the edit form Velocity template.buildParametersFromForm(Map<String, Object> form, ErrorCollection errors) Validates the parameters from the edit HTML form and constructs a serializable map of generator-specific parameters.booleanChecks if this generator is currently available in the Automation menu on UI.
-
Constructor Details
-
AbstractGenerator
public AbstractGenerator()
-
-
Method Details
-
addDefaultFormParameters
public void addDefaultFormParameters(@NotNull Map<String, Object> form) throws GeneratorUnavailableExceptionDescription copied from interface:StructureGeneratorFills the parameter map for the edit form Velocity template with default values for a new generator item of this type.- Specified by:
addDefaultFormParametersin interfaceStructureGenerator- Parameters:
form- form template parameters (output)- Throws:
GeneratorUnavailableException- if the operation cannot be performed
-
addParametersToForm
public void addParametersToForm(@NotNull Map<String, Object> parameters, @NotNull Map<String, throws GeneratorUnavailableExceptionObject> form) Description copied from interface:StructureGeneratorGiven the generator-specific parameters, fills the parameter map for the edit form Velocity template.- Specified by:
addParametersToFormin interfaceStructureGenerator- Parameters:
parameters- generator parameters (input)form- edit form template parameters (output)- Throws:
GeneratorUnavailableException- if the operation cannot be performed
-
buildParametersFromForm
@NotNull public Map<String,Object> buildParametersFromForm(@NotNull Map<String, Object> form, @NotNull ErrorCollection errors) throws GeneratorUnavailableExceptionDescription copied from interface:StructureGeneratorValidates 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.
- Specified by:
buildParametersFromFormin interfaceStructureGenerator- Parameters:
form- the parameters from the edit HTML form (input)errors- the collector for error messages (output)- Returns:
- serializable map of generator-specific parameters
- Throws:
GeneratorUnavailableException- if the operation cannot be performed
-
addParametersForSummary
public void addParametersForSummary(@NotNull Map<String, Object> parameters, @NotNull Map<String, Object> summaryParameters) Description copied from interface:StructureGeneratorGiven the generator-specific parameters, fills the parameter map for the summary Velocity template.
- Specified by:
addParametersForSummaryin interfaceStructureGenerator- Parameters:
parameters- generator parameters (input)summaryParameters- summary template parameters (output)
-
mapOf
-
mapOf
-
getPresets
- Specified by:
getPresetsin interfaceConfigurableGenerator
-
isAvailable
public boolean isAvailable()Description copied from interface:StructureGeneratorChecks 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.
- Specified by:
isAvailablein interfaceStructureGenerator- Returns:
- true if the generator must be available in the Automation menu
-