Coverage Report - org.simpleframework.xml.filter.Filter
 
Classes in this File Line Coverage Branch Coverage Complexity
Filter
N/A
N/A
1
 
 1  
 /*
 2  
  * Filter.java May 2006
 3  
  *
 4  
  * Copyright (C) 2006, Niall Gallagher <niallg@users.sf.net>
 5  
  *
 6  
  * This library is free software; you can redistribute it and/or
 7  
  * modify it under the terms of the GNU Lesser General Public
 8  
  * License as published by the Free Software Foundation.
 9  
  *
 10  
  * This library is distributed in the hope that it will be useful,
 11  
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 12  
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 13  
  * GNU Lesser General Public License for more details.
 14  
  *
 15  
  * You should have received a copy of the GNU Lesser General
 16  
  * Public License along with this library; if not, write to the
 17  
  * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
 18  
  * Boston, MA  02111-1307  USA
 19  
  */
 20  
 
 21  
 package org.simpleframework.xml.filter;
 22  
 
 23  
 /**
 24  
  * The <code>Filter</code> object is used to provide replacement string
 25  
  * values for a provided key. This allows values within the XML source
 26  
  * document to be replaced using sources such as OS environment variables
 27  
  * and Java system properties.
 28  
  * <p>
 29  
  * All filtered variables appear within the source text using a template
 30  
  * and variable keys marked like <code>${example}</code>. When the XML 
 31  
  * source file is read all template variables are replaced with the 
 32  
  * values provided by the filter. If no replacement exists then the XML
 33  
  * source text remains unchanged.
 34  
  * 
 35  
  * @author Niall Gallagher
 36  
  */
 37  
 public interface Filter {
 38  
 
 39  
    /**
 40  
     * Replaces the text provided with some property. This method acts
 41  
     * much like a the <code>get</code> method of the <code>Map</code>
 42  
     * object, in that it uses the provided text as a key to some value.
 43  
     *
 44  
     * @param text this is the text value that is to be replaced
 45  
     * @return returns a replacement for the provided text value
 46  
     */
 47  
    public String replace(String text);        
 48  
 }