Package de.ubs.xdm3
Class ProcessorFactory
java.lang.Object
de.ubs.xdm3.ProcessorFactory
Factory class for creating various types of processors.
This class is responsible for managing the definitions of attribute generators,
entity generators, and entity scenario generators,
and for creating instances of these processors.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionProcessorFactory(List<AttributeGeneratorDefinition> attributeGeneratorDefinitions, List<EntityGeneratorDefinition> entityGeneratorDefinitions, List<EntityScenarioGeneratorDefinition> entityScenarioGeneratorDefinitions, EntityInstanceHandler entityInstanceHandler, ChatClientService chatClientService) Constructs a new ProcessorFactory with the specified definitions and services. -
Method Summary
Modifier and TypeMethodDescriptioncreateAttributeGenerator(Processor parent, String name) Create an attribute generator processor with the given name.Create an attribute generator processor with the given name.createEntityGenerator(Processor parent, String name) Create an entity generator processor for the given entity generator.Creates an entity generator processor for the given entity generator with parameters.createEntityScenarioGenerator(Processor parent, String name) Create a scenario generator processor for the given name.Creates a scenario generator processor for the given name with parameters.createEntityScenarioGenerator(Processor parent, String name, Map<String, Object> parameters, EntityInstanceHandler entityInstanceHandler) Creates a scenario generator processor for the given name with parameters and a custom entity instance handler.static StringwrapInClass(String code, String wrapperClassName, List<String> additionalVariables) Wrap the given code in a class that extends the given wrapper class.
-
Field Details
-
IMPORT
- See Also:
-
-
Constructor Details
-
ProcessorFactory
public ProcessorFactory(List<AttributeGeneratorDefinition> attributeGeneratorDefinitions, List<EntityGeneratorDefinition> entityGeneratorDefinitions, List<EntityScenarioGeneratorDefinition> entityScenarioGeneratorDefinitions, EntityInstanceHandler entityInstanceHandler, @Autowired(required=false) ChatClientService chatClientService) Constructs a new ProcessorFactory with the specified definitions and services.- Parameters:
attributeGeneratorDefinitions- the list of attribute generator definitionsentityGeneratorDefinitions- the list of entity generator definitionsentityScenarioGeneratorDefinitions- the list of entity scenario generator definitionsentityInstanceHandler- the handler for entity instanceschatClientService- the chat client service
-
-
Method Details
-
createAttributeGenerator
Create an attribute generator processor with the given name. The name must match the display name of an attribute generator definition. Used by the internal script and typically not by external processes.- Parameters:
name- the display name of the attribute generator.- Returns:
- the attribute generator processor
-
createAttributeGenerator
public AttributeGeneratorProcessor createAttributeGenerator(Processor parent, String name, Map<String, Object> parameters) Create an attribute generator processor with the given name. The name must match the display name of an attribute generator definition. Used by the internal script and typically not by external processes.- Parameters:
name- the display name of the attribute generator.parameters- the parameters to set in the attribute generator definition.- Returns:
- the attribute generator processor
-
createEntityGenerator
Create an entity generator processor for the given entity generator. Used by the internal script and typically not by external processes.- Parameters:
parent- the parent processorname- the name of the entity generator- Returns:
- the entity generator processor
-
createEntityGenerator
public EntityGeneratorProcessor createEntityGenerator(Processor parent, String name, Map<String, Object> parameters) Creates an entity generator processor for the given entity generator with parameters.- Parameters:
parent- the parent processorname- the name of the entity generatorparameters- the parameters to set in the entity generator definition- Returns:
- the entity generator processor
-
createEntityScenarioGenerator
public EntityScenarioGeneratorProcessor createEntityScenarioGenerator(Processor parent, String name) Create a scenario generator processor for the given name. Used by the internal script and typically not by external processes.- Parameters:
parent- the parent processorname- the name of the scenario generator- Returns:
- the entity generator processor
-
createEntityScenarioGenerator
public EntityScenarioGeneratorProcessor createEntityScenarioGenerator(Processor parent, String name, Map<String, Object> parameters) Creates a scenario generator processor for the given name with parameters.- Parameters:
parent- the parent processorname- the name of the scenario generatorparameters- the parameters to set in the scenario generator definition- Returns:
- the entity scenario generator processor
-
createEntityScenarioGenerator
public EntityScenarioGeneratorProcessor createEntityScenarioGenerator(Processor parent, String name, Map<String, Object> parameters, EntityInstanceHandler entityInstanceHandler) Creates a scenario generator processor for the given name with parameters and a custom entity instance handler.- Parameters:
parent- the parent processorname- the name of the scenario generatorparameters- the parameters to set in the scenario generator definitionentityInstanceHandler- the handler for entity instances- Returns:
- the entity scenario generator processor
-
wrapInClass
public static String wrapInClass(String code, String wrapperClassName, List<String> additionalVariables) Wrap the given code in a class that extends the given wrapper class. The imports of the code will be moved to the top of the class.- Parameters:
code- the code to wrapwrapperClassName- the name of the wrapper class to extendadditionalVariables- additional variables to add to the class as separate fields.- Returns:
- the code wrapped in a class
-