Coverage Report - org.jtheque.primary.utils.web.analyzers.generic.operation.iterator.IteratorOperationFactory
 
Classes in this File Line Coverage Branch Coverage Complexity
IteratorOperationFactory
0 %
0/10
N/A
1
 
 1  
 package org.jtheque.primary.utils.web.analyzers.generic.operation.iterator;
 2  
 
 3  
 import org.jdom.Element;
 4  
 import org.jtheque.core.utils.file.XMLException;
 5  
 import org.jtheque.core.utils.file.XMLReader;
 6  
 import org.jtheque.primary.utils.web.analyzers.generic.FactoryContainer;
 7  
 
 8  
 /*
 9  
  * This file is part of JTheque.
 10  
  *            
 11  
  * JTheque is free software: you can redistribute it and/or modify
 12  
  * it under the terms of the GNU General Public License as published by
 13  
  * the Free Software Foundation, either version 3 of the License. 
 14  
  *
 15  
  * JTheque is distributed in the hope that it will be useful,
 16  
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 17  
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 18  
  * GNU General Public License for more details.
 19  
  *
 20  
  * You should have received a copy of the GNU General Public License
 21  
  * along with JTheque.  If not, see <http://www.gnu.org/licenses/>.
 22  
  */
 23  
 
 24  
 /**
 25  
  * A factory for iterator operations.
 26  
  *
 27  
  * @author Baptiste Wicht
 28  
  */
 29  
 public final class IteratorOperationFactory {
 30  0
         private static final FactoryContainer<IteratorOperation> FACTORY = new FactoryContainer<IteratorOperation>();
 31  
 
 32  
         /**
 33  
          * This an utility class, not instanciable.
 34  
          */
 35  
         private IteratorOperationFactory(){
 36  0
                 super();
 37  0
         }
 38  
 
 39  
         static{
 40  0
                 FACTORY.add(new NextLineFactory());
 41  0
                 FACTORY.add(new TrimFactory());
 42  0
                 FACTORY.add(new AppendLineFactory());
 43  0
                 FACTORY.add(new AppendTextFactory());
 44  0
                 FACTORY.add(new AppendFactory());
 45  0
         }
 46  
 
 47  
         /**
 48  
          * Return the iterator operation on the element.
 49  
          *
 50  
          * @param element The element to get the value getter for.
 51  
          * @param reader The reader to use.
 52  
          *
 53  
          * @return The factored IteratorOperation to use.
 54  
          *
 55  
          * @throws XMLException If an error occurs during the XML processing.
 56  
          */
 57  
         public static IteratorOperation getPosition(Element element, XMLReader reader) throws XMLException{
 58  0
                 return FACTORY.getFactoredObject(element, reader);
 59  
         }
 60  
 }