Class SystemFilter

  • All Implemented Interfaces:
    Filter

    public class SystemFilter
    extends java.lang.Object
    implements Filter
    The SystemFilter object is used to provide a filter that will replace the specified values with system properties. This can be given a delegate filter which can be used to resolve replacements should the value requested not match a property.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private Filter filter
      Filter delegated to if no system property can be resolved.
    • Constructor Summary

      Constructors 
      Constructor Description
      SystemFilter()
      Constructor for the SystemFilter object.
      SystemFilter​(Filter filter)
      Constructor for the SystemFilter object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String replace​(java.lang.String text)
      Replaces the text provided with the value resolved from the system properties.
      • Methods inherited from class java.lang.Object

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

      • filter

        private Filter filter
        Filter delegated to if no system property can be resolved.
    • Constructor Detail

      • SystemFilter

        public SystemFilter()
        Constructor for the SystemFilter object. This creates a filter that will resolve replacements using system properties. Should the system properties not contain the requested mapping this will return a null value.
      • SystemFilter

        public SystemFilter​(Filter filter)
        Constructor for the SystemFilter object. This creates a filter that will resolve replacements using system properties. Should the system properties not contain the requested mapping this delegates to the specified filter.
        Parameters:
        filter - the filter delegated to if resolution fails
    • Method Detail

      • replace

        public java.lang.String replace​(java.lang.String text)
        Replaces the text provided with the value resolved from the system properties. If the system properties fails this will delegate to the specified Filter if it is not a null object. If no match is found a null is returned.
        Specified by:
        replace in interface Filter
        Parameters:
        text - this is the text value to be replaced
        Returns:
        this will return the replacement text resolved