ilog.rules.brl.translation

Class IlrBOMTranslationSupport



  • public class IlrBOMTranslationSupport
    extends IlrTranslationSupport
    Provides services for IRL code generation on a BOM.
    • Constructor Detail

      • IlrBOMTranslationSupport

        public IlrBOMTranslationSupport()
    • Method Detail

      • getTypeString

        public java.lang.String getTypeString(IlrConcept concept)
        Returns the fully-qualified name of the type of a specified concept.
        Specified by:
        getTypeString in class IlrTranslationSupport
        Parameters:
        concept - The concept.
        Returns:
        The fully-qualified name of the type corresponding to this concept.
      • getValueText

        public java.lang.String getValueText(IlrConceptInstance instance)
        Returns the IRL representation of the specified instance. It first looks for a translation property on the static reference in the BOM. If there is none, it returns the fully-qualified name of this static reference.
        Specified by:
        getValueText in class IlrTranslationSupport
        Parameters:
        instance - The concept instance.
        Returns:
        The IRL representation of this instance.
      • getValueType

        public java.lang.String getValueType(IlrConceptInstance instance)
        Returns the type of the class declaring the static reference corresponding to the specified instance.
        Specified by:
        getValueType in class IlrTranslationSupport
        Parameters:
        instance - The concept instance.
        Returns:
        The type of the class declaring the static reference corresponding to the instance.
      • getTranslation

        public java.lang.String getTranslation(IlrSentence sentence,
                                      IlrSyntaxTree.Node node)
        Returns the translation string for the specified sentence, identified at the node node in the Abstract Syntax Tree. It looks for a property translation defined on the member corresponding to the sentence. The search goes up in the class hierarchy from the class on which the method is called from the rule.
        Specified by:
        getTranslation in class IlrTranslationSupport
        Parameters:
        sentence - The sentence.
        node - The Abstract Syntax Tree node.
        Returns:
        The translation template, or null.
      • getTranslation

        public java.lang.String getTranslation(IlrConceptInstance instance,
                                      IlrSyntaxTree.Node node)
        Returns the translation string for the specified instance, identified at the node node in the Abstract Syntax Tree. It looks for a property translation defined on the member corresponding to the instance. The search goes up in the class hierarchy from the class on which the member is used in the rule.
        Specified by:
        getTranslation in class IlrTranslationSupport
        Parameters:
        instance - The concept instance.
        node - The Abstract Syntax Tree node.
        Returns:
        The translation template, or null.
      • getTranslation

        public java.lang.String getTranslation(IlrConcept concept,
                                      IlrSyntaxTree.Node node)
        Returns the translation string for the specified concept, identified at the node node in the Abstract Syntax Tree. It looks for a property translation defined on the type corresponding to concept.
        Specified by:
        getTranslation in class IlrTranslationSupport
        Parameters:
        concept - The concept.
        node - The Abstract Syntax Tree node.
        Returns:
        The translation template, or null.
      • getProperty

        public java.lang.Object getProperty(java.lang.String typeName,
                                   java.lang.String propertyName)
        Retrieves a generic BOM property propertyName on the type named typeName.
        Specified by:
        getProperty in class IlrTranslationSupport
        Parameters:
        typeName - The fully-qualified name of the type.
        propertyName - The name of the BOM property.
        Returns:
        The value of the property found, or null.
      • getValueTranslator

        public IlrValueTranslator getValueTranslator(java.lang.String typeName)
        Gets a value translator for the BOM type typeName.
        Specified by:
        getValueTranslator in class IlrTranslationSupport
        Parameters:
        typeName - The fully-qualified name of the type.
        Returns:
        The instance of IlrValueTranslator registered for this type, or null.
      • getMemberTranslator

        public ilog.rules.brl.translation.codegen.IlrMemberTranslator getMemberTranslator(java.lang.String typeName)
        Gets a value translator for the BOM type typeName.
        Parameters:
        typeName - The fully-qualified name of the type.
        Returns:
        The instance of IlrValueTranslator registered for this type, or null.

© Copyright IBM Corp. 1987, 2017