Coverage Report - org.simpleframework.xml.stream.IdentityStyle
 
Classes in this File Line Coverage Branch Coverage Complexity
IdentityStyle
100%
3/3
N/A
1
 
 1  
 /*
 2  
  * IdentityStyle.java July 2008
 3  
  *
 4  
  * Copyright (C) 2008, 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.stream;
 20  
 
 21  
 /**
 22  
  * The <code>IdentityStyle</code> object is used to represent a style
 23  
  * that does not modify the tokens passed in to it. This is used if
 24  
  * there is no style specified or if there is no need to convert the
 25  
  * XML elements an attributes to a particular style. This is also 
 26  
  * the most performant style as it does not require cache lookups.
 27  
  * 
 28  
  * @author Niall Gallagher
 29  
  */
 30  547
 class IdentityStyle implements Style {
 31  
 
 32  
    /**
 33  
     * This is basically a pass through method. It will return the
 34  
     * same string as is passed in to it. This ensures the best
 35  
     * performant when no styling is required for the XML document.
 36  
     * 
 37  
     * @param name this is the token that is to be styled by this
 38  
     * 
 39  
     * @return this returns the same string that is passed in
 40  
     */
 41  
    public String getAttribute(String name) {
 42  710875
       return name;
 43  
    }
 44  
 
 45  
    /**
 46  
     * This is basically a pass through method. It will return the
 47  
     * same string as is passed in to it. This ensures the best
 48  
     * performant when no styling is required for the XML document.
 49  
     * 
 50  
     * @param name this is the token that is to be styled by this
 51  
     * 
 52  
     * @return this returns the same string that is passed in
 53  
     */
 54  
    public String getElement(String name) {
 55  2317635
       return name;
 56  
    }
 57  
 }