Clover coverage report -
Coverage timestamp: Sun Nov 1 2009 23:08:24 UTC
file stats: LOC: 71   Methods: 3
NCLOC: 34   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
SymbolTableSymbols.java 100% 87.5% 100% 92.3%
coverage coverage
 1    /*
 2    * Licensed to the Apache Software Foundation (ASF) under one or more
 3    * contributor license agreements. See the NOTICE file distributed with
 4    * this work for additional information regarding copyright ownership.
 5    * The ASF licenses this file to You under the Apache License, Version 2.0
 6    * (the "License"); you may not use this file except in compliance with
 7    * the License. You may obtain a copy of the License at
 8    *
 9    * http://www.apache.org/licenses/LICENSE-2.0
 10    *
 11    * Unless required by applicable law or agreed to in writing, software
 12    * distributed under the License is distributed on an "AS IS" BASIS,
 13    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 14    * See the License for the specific language governing permissions and
 15    * limitations under the License.
 16    *
 17    * $Id: SymbolTableSymbols.java 541508 2007-05-25 01:54:12Z vgritsenko $
 18    */
 19   
 20    package org.apache.xindice.xml;
 21   
 22    import org.apache.commons.logging.Log;
 23    import org.apache.commons.logging.LogFactory;
 24    import org.apache.xindice.xml.dom.DOMParser;
 25   
 26    import org.w3c.dom.Element;
 27   
 28    /**
 29    * SymbolTableSymbols is class that represents the hard-coded definition
 30    * of a compressed symbol table.
 31    *
 32    * @version $Revision: 541508 $, $Date: 2007-05-24 18:54:12 -0700 (Thu, 24 May 2007) $
 33    */
 34    public final class SymbolTableSymbols extends SymbolTable {
 35   
 36    private static final Log log = LogFactory.getLog(SymbolTableSymbols.class);
 37   
 38    private static String SYMBOLS_DEFINITION
 39    = "<symbols>"
 40    + " <symbol name='" + SYMBOLS + "' id='0'/>"
 41    + " <symbol name='" + SYMBOL + "' id='1'/>"
 42    + " <symbol name='" + NAME + "' id='2'/>"
 43    + " <symbol name='" + ID + "' id='3'/>"
 44    + " <symbol name='" + NSURI + "' id='4'/>"
 45    + "</symbols>";
 46   
 47    private static SymbolTableSymbols SYMBOLS_INSTANCE;
 48   
 49   
 50  2 private SymbolTableSymbols() {
 51  2 try {
 52  2 Element symbols = DOMParser.toDocument(SYMBOLS_DEFINITION).getDocumentElement();
 53  2 streamFromXML(symbols);
 54    } catch (Exception e) {
 55    // Should never happen
 56  0 log.fatal("Failed to create SymbolTableSymbols", e);
 57    }
 58    }
 59   
 60  19 public static String getDefinition() {
 61  19 return SYMBOLS_DEFINITION;
 62    }
 63   
 64  507 public static SymbolTableSymbols getInstance() {
 65  507 if (SYMBOLS_INSTANCE == null) {
 66  2 SYMBOLS_INSTANCE = new SymbolTableSymbols();
 67    }
 68   
 69  507 return SYMBOLS_INSTANCE;
 70    }
 71    }