ilog.rules.brl.translation

Class IlrTranslationSupport

  • java.lang.Object
    • ilog.rules.brl.translation.IlrTranslationSupport
  • Direct Known Subclasses:
    IlrBOMTranslationSupport


    public abstract class IlrTranslationSupport
    extends java.lang.Object
    This abstract class defines the services that must be provided to an IlrCodeGenerator to generate the appropriate code for vocabulary elements. It provides methods that return:
    • The type of a concept for the target language. For example, in IRL, the 'type' of a concept is the fully-qualified name of the underlying BOM class.
    • The translation template for concepts, instances, and phrases. For example, in IRL, the translation template is found as a translation property in the BOM.
    • The value translators.
    • The text corresponding to values.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      abstract java.lang.Object getProperty(java.lang.String target, java.lang.String propertyName)
      Returns a custom property attached to the specified target..
      java.lang.String getTargetLanguage()
      Returns the target language through the code generator attached to the translator.
      abstract java.lang.String getTranslation(IlrConcept concept, IlrSyntaxTree.Node node)
      Returns the translation template for the specified concept, and the specified node.
      abstract java.lang.String getTranslation(IlrConceptInstance instance, IlrSyntaxTree.Node node)
      Returns the translation template for the specified instance, and the specified node.
      abstract java.lang.String getTranslation(IlrSentence sentence, IlrSyntaxTree.Node node)
      Returns the translation template for the specified sentence, and the specified Abstract Syntax Tree node.
      IlrBRLTranslator getTranslator()
      Returns the translator attached to this translation support.
      abstract java.lang.String getTypeString(IlrConcept concept)
      Returns the string for the type of the specified concept.
      abstract java.lang.String getValueText(IlrConceptInstance instance)
      Returns the value text to be generated, for the specified instance.
      abstract IlrValueTranslator getValueTranslator(java.lang.String target)
      Returns the value translator attached to the specified target.
      abstract java.lang.String getValueType(IlrConceptInstance instance)
      Returns the string for the type of the specified instance.
      void setTranslator(IlrBRLTranslator translator)
      Sets the translator to this translation support.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • IlrTranslationSupport

        public IlrTranslationSupport()
    • Method Detail

      • getTargetLanguage

        public java.lang.String getTargetLanguage()
        Returns the target language through the code generator attached to the translator. This method actually calls IlrCodeGenerator.getTargetLanguage().
        Returns:
        The target language as defined by the code generator.
      • getTranslator

        public IlrBRLTranslator getTranslator()
        Returns the translator attached to this translation support.
        Returns:
        The translator.
      • setTranslator

        public void setTranslator(IlrBRLTranslator translator)
        Sets the translator to this translation support.
        Parameters:
        translator - The new translator.
      • getTypeString

        public abstract java.lang.String getTypeString(IlrConcept concept)
        Returns the string for the type of the specified concept.
        Parameters:
        concept - The concept.
        Returns:
        The type string for concept.
      • getValueText

        public abstract java.lang.String getValueText(IlrConceptInstance instance)
        Returns the value text to be generated, for the specified instance.
        Parameters:
        instance - The concept instance.
        Returns:
        The value text for the instance.
      • getValueType

        public abstract java.lang.String getValueType(IlrConceptInstance instance)
        Returns the string for the type of the specified instance.
        Parameters:
        instance - The concept instance.
        Returns:
        The type string for instance.
      • getTranslation

        public abstract java.lang.String getTranslation(IlrSentence sentence,
                                      IlrSyntaxTree.Node node)
        Returns the translation template for the specified sentence, and the specified Abstract Syntax Tree node.
        Parameters:
        sentence - The sentence.
        node - The AST node.
        Returns:
        The translation template for sentence, or null.
      • getTranslation

        public abstract java.lang.String getTranslation(IlrConceptInstance instance,
                                      IlrSyntaxTree.Node node)
        Returns the translation template for the specified instance, and the specified node.
        Parameters:
        instance - The concept instance.
        node - The AST node.
        Returns:
        The translation template for the instance, or null.
      • getTranslation

        public abstract java.lang.String getTranslation(IlrConcept concept,
                                      IlrSyntaxTree.Node node)
        Returns the translation template for the specified concept, and the specified node.
        Parameters:
        concept - The concept.
        node - The AST node.
        Returns:
        The translation template for the concept, or null.
      • getValueTranslator

        public abstract IlrValueTranslator getValueTranslator(java.lang.String target)
        Returns the value translator attached to the specified target.
        Parameters:
        target - The identifier of an IlrConcept.
        Returns:
        The value translator, or null.
      • getProperty

        public abstract java.lang.Object getProperty(java.lang.String target,
                                   java.lang.String propertyName)
        Returns a custom property attached to the specified target..
        Parameters:
        target - The identifier of an IlrConcept.
        Returns:
        The value found, or null.

© Copyright IBM Corp. 1987, 2017