Class AlgorithmBuilderService

java.lang.Object
es.urjc.etsii.grafo.autoconfig.builder.AlgorithmBuilderService

@Service public class AlgorithmBuilderService extends Object
  • Constructor Details

  • Method Details

    • buildAlgorithmComponentByName

      public Object buildAlgorithmComponentByName(String name, Map<String,Object> params)
      Build any algorithm component given its name and a map of parameters
      Parameters:
      name - component name, can be either an alias, a factory reference or a classname
      params - parameter map used to create this component, provides the necessary args to call the constructor
      Returns:
      built component
    • buildAlgorithm

      public Algorithm<?,?> buildAlgorithm(ComponentSpec spec)
      Build an algorithm from a component specification.
      Parameters:
      spec - algorithm component specification
      Returns:
      built algorithm
      Throws:
      AlgorithmParsingException - if the built component is not a valid algorithm
    • buildAlgorithmFromJson

      public Algorithm<?,?> buildAlgorithmFromJson(String json)
      Parse a JSON algorithm description and build it.
      Parameters:
      json - flattened JSON algorithm description
      Returns:
      built algorithm
    • buildAlgorithmComponent

      public Object buildAlgorithmComponent(ComponentSpec spec)
      Build any algorithm component from a component specification.
      Parameters:
      spec - component specification
      Returns:
      built component
    • buildAlgorithmComponentFromJson

      public Object buildAlgorithmComponentFromJson(String json)
      Parse a JSON component description and build it.
      Parameters:
      json - flattened JSON component description
      Returns:
      built component
    • toJson

      public String toJson(ComponentSpec spec)
    • toJsonTree

      public tools.jackson.databind.JsonNode toJsonTree(ComponentSpec spec)