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  
  * Licensed under the Apache License, Version 2.0 (the "License");
 7  
  * you may not use this file except in compliance with the License.
 8  
  * You may obtain a copy of the License at
 9  
  *
 10  
  *     http://www.apache.org/licenses/LICENSE-2.0
 11  
  *
 12  
  * Unless required by applicable law or agreed to in writing, software
 13  
  * distributed under the License is distributed on an "AS IS" BASIS,
 14  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 
 15  
  * implied. See the License for the specific language governing 
 16  
  * permissions and limitations under the License.
 17  
  */
 18  
 
 19  
 package org.simpleframework.xml.filter;
 20  
 
 21  
 /**
 22  
  * The <code>Filter</code> object is used to provide replacement string
 23  
  * values for a provided key. This allows values within the XML source
 24  
  * document to be replaced using sources such as OS environment variables
 25  
  * and Java system properties.
 26  
  * <p>
 27  
  * All filtered variables appear within the source text using a template
 28  
  * and variable keys marked like <code>${example}</code>. When the XML 
 29  
  * source file is read all template variables are replaced with the 
 30  
  * values provided by the filter. If no replacement exists then the XML
 31  
  * source text remains unchanged.
 32  
  * 
 33  
  * @author Niall Gallagher
 34  
  */
 35  
 public interface Filter {
 36  
 
 37  
    /**
 38  
     * Replaces the text provided with some property. This method 
 39  
     * acts much like a the get method of the <code>Map</code>
 40  
     * object, in that it uses the provided text as a key to some 
 41  
     * value. However it can also be used to evaluate expressions
 42  
     * and output the result for inclusion in the generated XML.
 43  
     *
 44  
     * @param text this is the text value that is to be replaced
 45  
     * 
 46  
     * @return returns a replacement for the provided text value
 47  
     */
 48  
    String replace(String text);        
 49  
 }