Class TemplateFilter

java.lang.Object
org.simpleframework.xml.core.TemplateFilter
All Implemented Interfaces:
Filter

class TemplateFilter extends Object implements Filter
The TemplateFilter class is used to provide variables to the template engine. This template acquires variables from two different sources. Firstly this will consult the user contextual Context object, which can contain variables that have been added during the deserialization process. If a variable is not present from this context it asks the Filter that has been specified by the user.
  • Field Details

    • context

      private Context context
      This is the template context object used by the persister.
    • filter

      private Filter filter
      This is the filter object provided to the persister.
  • Constructor Details

    • TemplateFilter

      public TemplateFilter(Context context, Filter filter)
      Constructor for the TemplateFilter object. This creates a filter object that acquires template values from two different contexts. Firstly the Context is queried for a variables followed by the Filter.
      Parameters:
      context - this is the context object for the persister
      filter - the filter that has been given to the persister
  • Method Details

    • replace

      public String replace(String name)
      This will acquire the named variable value if it exists. If the named variable cannot be found in either the context or the user specified filter then this returns null.
      Specified by:
      replace in interface Filter
      Parameters:
      name - this is the name of the variable to acquire
      Returns:
      this returns the value mapped to the variable name