Class Variable

    • Constructor Detail

      • Variable

        public Variable​(java.lang.String variableName)
        Constructs a new Variable.
        Parameters:
        variableName - the variable name (i.e. the key in the data provider key-value mapping); will be considered "special" if the variable name starts with SPECIAL_VARIABLE_PREFIX
    • Method Detail

      • appendText

        public void appendText​(java.lang.StringBuilder result,
                               TemplateEngineDataProvider dataProvider)
        Description copied from interface: TemplateEntry
        Execute this template by generating text for a given data provider.
        Specified by:
        appendText in interface TemplateEntry
        Parameters:
        result - the StringBuilder to append the text to
        dataProvider - the data provider from which information should be compiled to a string
      • isValid

        public boolean isValid​(TemplateEngineDataProvider dataProvider)
        Description copied from interface: TemplateEntry
        Check if this template is applicable to the given data provider.
        Specified by:
        isValid in interface TemplateEntry
        Parameters:
        dataProvider - the data provider to check
        Returns:
        true if all conditions are fulfilled to apply the template (for instance all required key=value mappings are present), false otherwise
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • isSpecial

        public boolean isSpecial()
        Check if this variable is special.
        Returns:
        true if this variable is special
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object