Interface ISSSOMTransformApplication<T>

Type Parameters:
T - The type of object that should be produced by the SSSOM/Transform-described processing rules.
All Known Implementing Classes:
SSSOMTOwlApplication, SSSOMTransformApplication

public interface ISSSOMTransformApplication<T>
Represents a specialised application of the SSSOM/Transform language. An implementation of that interface provides the SSSOM/Transform parser with the necessary informations to fully parse a SSSOM/Transform file into a set of mapping processing rules.
  • Method Details

    • onInit

      void onInit(PrefixManager prefixManager)
      Initialises the application. This method is called by the SSSOM/Transform parser when all rules have been syntaxically parsed, before the parser attempts to process the action part of each rule.
      Parameters:
      prefixManager - A prefix manager initialised with all the prefix declarations found in the SSSOM/Transform file.
    • onFilter

      IMappingFilter onFilter(String name, List<String> arguments, Map<String,String> keyedArguments) throws SSSOMTransformError
      Processes an application-specific filter. This method is called when the parser finds a function call within the filter part of a rule. If the application recognises the function, it must return a mapping filter; otherwise, it must return null or throw a SSSOMTransformError.
      Parameters:
      name - The name of the function.
      arguments - The list of arguments passed to the function.
      keyedArguments - The map of keyed arguments (/key=...) passed to the function.
      Returns:
      A mapping filter that filters mappings according to the application’s needs, or null if the name is not a valid filter name for this application.
      Throws:
      SSSOMTransformError - If the application cannot process the filer (e.g., the arguments are invalid).
    • onDirectiveAction

      boolean onDirectiveAction(String name, List<String> arguments, Map<String,String> keyedArguments) throws SSSOMTransformError
      Processes a directive action. This method is called when the parser finds a function call that is not associated with any filter. Such calls (which can only happen at the beginning of a SSSOM/T file, after the prefix declarations but before any other rule) cannot produce mapping processing rules but may otherwise influence the behaviour of the application. They are executed as soon as they are encountered when parsing the abstract tree.
      Parameters:
      name - The name of the function.
      arguments - The list of arguments passed to the function.
      keyedArguments - The map of keyed arguments (/key=...) passed to the function.
      Returns:
      true if the name is a valid directive for this application, otherwise false/
      Throws:
      SSSOMTransformError - If the application cannot process the action (e.g. the arguments are invalid).
    • onCallback

      IMappingProcessorCallback onCallback(String name, List<String> arguments, Map<String,String> keyedArguments) throws SSSOMTransformError
      Processes a callback action. This method is the first one called when the parser finds a normal action (any action associated with a filter). If the application recognises the function as a callback function, it must return the corresponding callback object; otherwise, it must return null.
      Parameters:
      name - The name of the function.
      arguments - The list of arguments passed to the function.
      keyedArguments - The map of keyed arguments (/key=...) passed to the function.
      Returns:
      A callback object implementing the action according to the application’s needs, or null if the name is not a valid callback function name for this application.
      Throws:
      SSSOMTransformError - If the application cannot process the action (e.g., the arguments are invalid).
    • onPreprocessingAction

      IMappingTransformer<Mapping> onPreprocessingAction(String name, List<String> arguments, Map<String,String> keyedArguments) throws SSSOMTransformError
      Processes a preprocessing action. This method is called when the parser finds a normal action that is not recognised as a callback action (i.e. onCallback(String, List, Map) returned null). It the application recognises the function, it must return a mapping preprocessor; otherwise, it must return null.
      Parameters:
      name - The name of the function.
      arguments - The list of arguments passed to the function.
      keyedArguments - The map of keyed arguments (/key=...) passed to the function.
      Returns:
      A mapping preprocessor implementing the action according to the application’s needs, or null if the name is not a valid preprocessing function name for this application.
      Throws:
      SSSOMTransformError - If the application cannot process the action (e.g., the arguments are invalid).
    • onGeneratingAction

      IMappingTransformer<T> onGeneratingAction(String name, List<String> arguments, Map<String,String> keyedArguments) throws SSSOMTransformError
      Processes a generating action. This method is called when the parser finds a normal action that is not recognised as a callback action nor as a preprocessing action (i.e. both onCallback(String, List, Map) and onPreprocessingAction(String, List, Map) returned null). If the application recognises the function, it must return a mapping transformer that produces the kind of objects desired by the application.
      Parameters:
      name - The name of the function.
      arguments - The list of arguments passed to the function.
      keyedArguments - The map of keyed arguments (/key=...) passed to the function.
      Returns:
      A mapping transformer implementing the action according to the application’s needs.
      Throws:
      SSSOMTransformError - If the application cannot process the action (e.g. the name is not recognised or the arguments are invalid).