Coverage Report - org.jtheque.primary.utils.web.analyzers.generic.transform.DeleteFirstCharFactory
 
Classes in this File Line Coverage Branch Coverage Complexity
DeleteFirstCharFactory
0 %
0/4
N/A
1
DeleteFirstCharFactory$1
N/A
N/A
1
DeleteFirstCharFactory$DeleteFirstChar
0 %
0/2
N/A
1
 
 1  
 package org.jtheque.primary.utils.web.analyzers.generic.transform;
 2  
 
 3  
 /*
 4  
  * This file is part of JTheque.
 5  
  *            
 6  
  * JTheque is free software: you can redistribute it and/or modify
 7  
  * it under the terms of the GNU General Public License as published by
 8  
  * the Free Software Foundation, either version 3 of the License. 
 9  
  *
 10  
  * JTheque 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 General Public License for more details.
 14  
  *
 15  
  * You should have received a copy of the GNU General Public License
 16  
  * along with JTheque.  If not, see <http://www.gnu.org/licenses/>.
 17  
  */
 18  
 
 19  
 import org.jdom.Element;
 20  
 import org.jtheque.core.utils.file.XMLException;
 21  
 import org.jtheque.core.utils.file.XMLReader;
 22  
 import org.jtheque.primary.utils.web.analyzers.generic.Factory;
 23  
 
 24  
 /**
 25  
  * @author Baptiste Wicht
 26  
  */
 27  0
 final class DeleteFirstCharFactory implements Factory<Transformer> {
 28  
         @Override
 29  
         public boolean canFactor(Element element, XMLReader reader){
 30  0
                 return "deleteFirstChar".equals(element.getName());
 31  
         }
 32  
 
 33  
         @Override
 34  
         public Transformer factor(Element n, XMLReader reader) throws XMLException{
 35  0
                 return new DeleteFirstChar();
 36  
         }
 37  
 
 38  
         /**
 39  
          * A Transformer who delete the first char of the value.
 40  
          *
 41  
          * @author Baptiste Wicht
 42  
          */
 43  0
         private static final class DeleteFirstChar implements Transformer {
 44  
                 @Override
 45  
                 public String transform(String value){
 46  0
                         return value.substring(1);
 47  
                 }
 48  
         }
 49  
 }