Package rife.template

Class InternalValue

java.lang.Object
rife.template.InternalValue

public class InternalValue extends Object
An anonymous value inside a template, which is not referenced anywhere in the template, but can be used to produce intermediate strings using the template engine. To obtain an InternalValue, you should use Template.createInternalValue().
Since:
1.0
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Appends the content of a block to this value.
    void
    appendValue(boolean value)
    Appends "true" or "false" to this value, depending on the given value.
    void
    appendValue(char value)
    Appends the single specified character to this value.
    void
    appendValue(char[] value)
    Appends the given characters to this value.
    void
    appendValue(char[] value, int offset, int count)
    Appends the specified range of the given character string to this value.
    void
    appendValue(double value)
    Appends the given double precision floating point value to this value.
    void
    appendValue(float value)
    Appends the given floating point value to this value.
    void
    appendValue(int value)
    Appends the given integer to this value.
    void
    appendValue(long value)
    Appends the given long to this value.
    void
    Appends the given character sequence to this value.
    void
    Appends the result of calling String.valueOf on the given value to this value in this template.
    void
    Appends the given string to this value.
    void
    Appends to this value the value of the given internal value.
    void
    Removes all content from this value.
    boolean
    equals(Object object)
     
    boolean
    Returns whether this value contains no cnotent.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • appendBlock

      public void appendBlock(String blockId) throws TemplateException
      Appends the content of a block to this value. The values used by the block will be captured when this method is called, so any future changes to template values will not affect text which was appended when this method is called.
      Parameters:
      blockId - the ID of the block whose value should be appended to the specified value
      Throws:
      TemplateException - if the specified block does not exist in the corresponding template
      Since:
      1.0
    • appendValue

      public void appendValue(InternalValue value)
      Appends to this value the value of the given internal value.
      Parameters:
      value - an internal value
      Since:
      1.0
    • appendValue

      public void appendValue(Object value)
      Appends the result of calling String.valueOf on the given value to this value in this template.
      Parameters:
      value - an object
      Since:
      1.0
    • appendValue

      public void appendValue(boolean value)
      Appends "true" or "false" to this value, depending on the given value.
      Parameters:
      value - a boolean value
      Since:
      1.0
    • appendValue

      public void appendValue(char value)
      Appends the single specified character to this value.
      Parameters:
      value - a character
      Since:
      1.0
    • appendValue

      public void appendValue(char[] value)
      Appends the given characters to this value.
      Parameters:
      value - a string of characters
      Since:
      1.0
    • appendValue

      public void appendValue(char[] value, int offset, int count)
      Appends the specified range of the given character string to this value. The specified number of bytes from value will be used, starting at the character specified by offset.
      Parameters:
      value - a character string
      offset - the index in value of the first character to use
      count - the number of characters to use
      Since:
      1.0
    • appendValue

      public void appendValue(double value)
      Appends the given double precision floating point value to this value. This method uses the String.valueOf method to print the given value, which probably prints more digits than you like. You probably want String.format or NumberFormat instead.
      Parameters:
      value - a floating point value
      Since:
      1.0
    • appendValue

      public void appendValue(float value)
      Appends the given floating point value to this value. This method uses the String.valueOf method to print the given value, which probably prints more digits than you like. You probably want String.format or NumberFormat instead.
      Parameters:
      value - a floating point value
      Since:
      1.0
    • appendValue

      public void appendValue(int value)
      Appends the given integer to this value.
      Parameters:
      value - an integer
      Since:
      1.0
    • appendValue

      public void appendValue(long value)
      Appends the given long to this value.
      Parameters:
      value - a long
      Since:
      1.0
    • appendValue

      public void appendValue(String value)
      Appends the given string to this value. The given string cannot be null.
      Parameters:
      value - a string
      Since:
      1.0
    • appendValue

      public void appendValue(CharSequence value)
      Appends the given character sequence to this value. The given character sequence cannot be null.
      Parameters:
      value - a character sequence
      Since:
      1.0
    • isEmpty

      public boolean isEmpty()
      Returns whether this value contains no cnotent. This method will return false for newly created values as well as values for whom clear() has just been called.
      Returns:
      whether this value has no contents
      Since:
      1.0
    • clear

      public void clear()
      Removes all content from this value.
    • equals

      public boolean equals(Object object)
      Overrides:
      equals in class Object