Package de.ubs.xdm3

Class ProcessorFactory

java.lang.Object
de.ubs.xdm3.ProcessorFactory

public class ProcessorFactory extends Object
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 Details

  • 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 definitions
      entityGeneratorDefinitions - the list of entity generator definitions
      entityScenarioGeneratorDefinitions - the list of entity scenario generator definitions
      entityInstanceHandler - the handler for entity instances
      chatClientService - the chat client service
  • Method Details

    • createAttributeGenerator

      public AttributeGeneratorProcessor createAttributeGenerator(Processor parent, String name)
      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

      public EntityGeneratorProcessor createEntityGenerator(Processor parent, String name)
      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 processor
      name - 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 processor
      name - the name of the entity generator
      parameters - 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 processor
      name - 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 processor
      name - the name of the scenario generator
      parameters - 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 processor
      name - the name of the scenario generator
      parameters - the parameters to set in the scenario generator definition
      entityInstanceHandler - 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 wrap
      wrapperClassName - the name of the wrapper class to extend
      additionalVariables - additional variables to add to the class as separate fields.
      Returns:
      the code wrapped in a class