Clover coverage report - QedeqKernelSe Coverage Report
Coverage timestamp: Sa Jan 26 2008 14:11:34 CET
file stats: LOC: 82   Methods: 2
NCLOC: 35   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
Context2SimpleXPathOld.java 0% 0% 0% 0%
coverage
 1    /* $Id: Context2SimpleXPathOld.java,v 1.4 2008/01/26 12:39:09 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.IOException;
 21   
 22    import javax.xml.parsers.ParserConfigurationException;
 23   
 24    import org.qedeq.kernel.bo.module.ModuleContext;
 25    import org.qedeq.kernel.context.KernelContext;
 26    import org.qedeq.kernel.xml.tracker.SimpleXPath;
 27    import org.qedeq.kernel.xml.tracker.XPathLocationParser;
 28    import org.xml.sax.SAXException;
 29   
 30    /**
 31    * Parses complete QEDEQ modules to find a context location..
 32    *
 33    * <p>
 34    * Not in use any more.
 35    *
 36    * @version $Revision: 1.4 $
 37    * @author Michael Meyling
 38    * @deprecated
 39    */
 40    public final class Context2SimpleXPathOld {
 41   
 42    /**
 43    * Constructor.
 44    */
 45  0 private Context2SimpleXPathOld() {
 46    // nothing to do
 47    }
 48   
 49    /**
 50    * Transform context information into XML specific location information.
 51    *
 52    * @param context Abstract context description.
 53    * @return Information where the context could be found.
 54    * @throws RuntimeException Don't!
 55    * @deprecated
 56    */
 57  0 public static final SimpleXPath getXPath(final ModuleContext context) {
 58  0 String xpath = Context2XPathOld.getXPath(context);
 59  0 try {
 60  0 final SimpleXPath find = XPathLocationParser.getXPathLocation(
 61    // FIXME mime 20071218: hard coded transformation of context into file location
 62    KernelContext.getInstance().getLocalFilePath(
 63    context.getModuleLocation()), xpath, context.getModuleLocation().getURL());
 64  0 if (find.getStartLocation() == null) {
 65  0 System.out.println(context);
 66  0 throw new RuntimeException("start not found: " + find);
 67    }
 68  0 if (find.getEndLocation() == null) {
 69  0 System.out.println(context);
 70  0 throw new RuntimeException("end not found: " + find);
 71    }
 72  0 return find;
 73    } catch (ParserConfigurationException e) {
 74  0 throw new RuntimeException(e);
 75    } catch (SAXException e) {
 76  0 throw new RuntimeException(e);
 77    } catch (IOException e) {
 78  0 throw new RuntimeException(e);
 79    }
 80    }
 81   
 82    }