Coverage Report - org.jtheque.primary.utils.web.analyzers.generic.operation.iterator.NextLineFactory
 
Classes in this File Line Coverage Branch Coverage Complexity
NextLineFactory
0 %
0/4
N/A
1
NextLineFactory$1
N/A
N/A
1
NextLineFactory$NextLineIteratorOperation
0 %
0/2
N/A
1
 
 1  
 package org.jtheque.primary.utils.web.analyzers.generic.operation.iterator;
 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  
 import org.jtheque.primary.utils.web.analyzers.generic.operation.ScannerPossessor;
 24  
 import org.jtheque.primary.utils.web.analyzers.generic.value.BuilderPossessor;
 25  
 
 26  
 /**
 27  
  * @author Baptiste Wicht
 28  
  */
 29  0
 final class NextLineFactory implements Factory<IteratorOperation> {
 30  
         @Override
 31  
         public boolean canFactor(Element element, XMLReader reader){
 32  0
                 return "nextLine".equals(element.getName());
 33  
         }
 34  
 
 35  
         @Override
 36  
         public IteratorOperation factor(Element n, XMLReader reader) throws XMLException{
 37  0
                 return new NextLineIteratorOperation();
 38  
         }
 39  
 
 40  
         /**
 41  
          * An operation which pass to the next line.
 42  
          *
 43  
          * @author Baptiste Wicht
 44  
          */
 45  0
         private static final class NextLineIteratorOperation implements IteratorOperation {
 46  
                 @Override
 47  
                 public String perform(String line, ScannerPossessor analyzer, BuilderPossessor iterator){
 48  0
                         return analyzer.getScanner().nextLine();
 49  
                 }
 50  
         }
 51  
 }