Clover coverage report - QedeqKernelSe Coverage Report
Coverage timestamp: Sa Dez 22 2007 01:35:21 CET
file stats: LOC: 84   Methods: 2
NCLOC: 37   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
Context2SimpleXPathOld.java 0% 0% 0% 0%
coverage
 1    /* $Id: Context2SimpleXPathOld.java,v 1.3 2007/12/21 23:33:47 m31 Exp $
 2    *
 3    * This file is part of the project "Hilbert II" - http://www.qedeq.org
 4    *
 5    * Copyright 2000-2007, Michael Meyling <mime@qedeq.org>.
 6    *
 7    * "Hilbert II" is free software; you can redistribute
 8    * it and/or modify it under the terms of the GNU General Public
 9    * License as published by the Free Software Foundation; either
 10    * version 2 of the License, or (at your option) any later version.
 11    *
 12    * This program is distributed in the hope that it will be useful,
 13    * but WITHOUT ANY WARRANTY; without even the implied warranty of
 14    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 15    * GNU General Public License for more details.
 16    */
 17   
 18    package org.qedeq.kernel.xml.mapper;
 19   
 20    import java.io.File;
 21    import java.io.IOException;
 22   
 23    import javax.xml.parsers.ParserConfigurationException;
 24   
 25    import org.qedeq.kernel.bo.load.DefaultModuleAddress;
 26    import org.qedeq.kernel.bo.module.ModuleContext;
 27    import org.qedeq.kernel.context.KernelContext;
 28    import org.qedeq.kernel.xml.tracker.SimpleXPath;
 29    import org.qedeq.kernel.xml.tracker.XPathLocationFinder;
 30    import org.xml.sax.SAXException;
 31   
 32    /**
 33    * Parses complete QEDEQ modules to find a context location..
 34    *
 35    * <p>
 36    * Not in use any more.
 37    *
 38    * @version $Revision: 1.3 $
 39    * @author Michael Meyling
 40    * @deprecated
 41    */
 42    public final class Context2SimpleXPathOld {
 43   
 44    /**
 45    * Constructor.
 46    */
 47  0 private Context2SimpleXPathOld() {
 48    // nothing to do
 49    }
 50   
 51    /**
 52    * Transform context information into XML specific location information.
 53    *
 54    * @param context Abstract context description.
 55    * @return Information where the context could be found.
 56    * @throws RuntimeException Don't!
 57    * @deprecated
 58    */
 59  0 public static final SimpleXPath getXPath(final ModuleContext context) {
 60  0 String xpath = Context2XPathOld.getXPath(context);
 61  0 try {
 62  0 final SimpleXPath find = XPathLocationFinder.getXPathLocation(
 63    // FIXME mime 20071218: hard coded transformation of context into file location
 64    new File(KernelContext.getInstance().getLocalFilePath(new DefaultModuleAddress(
 65    context.getModuleLocation()))), xpath, context.getModuleLocation());
 66  0 if (find.getStartLocation() == null) {
 67  0 System.out.println(context);
 68  0 throw new RuntimeException("start not found: " + find);
 69    }
 70  0 if (find.getEndLocation() == null) {
 71  0 System.out.println(context);
 72  0 throw new RuntimeException("end not found: " + find);
 73    }
 74  0 return find;
 75    } catch (ParserConfigurationException e) {
 76  0 throw new RuntimeException(e);
 77    } catch (SAXException e) {
 78  0 throw new RuntimeException(e);
 79    } catch (IOException e) {
 80  0 throw new RuntimeException(e);
 81    }
 82    }
 83   
 84    }