1 /*
   2  * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
   3  */
   4 /*
   5  * Licensed to the Apache Software Foundation (ASF) under one or more
   6  * contributor license agreements.  See the NOTICE file distributed with
   7  * this work for additional information regarding copyright ownership.
   8  * The ASF licenses this file to You under the Apache License, Version 2.0
   9  * (the "License"); you may not use this file except in compliance with
  10  * the License.  You may obtain a copy of the License at
  11  *
  12  *      http://www.apache.org/licenses/LICENSE-2.0
  13  *
  14  * Unless required by applicable law or agreed to in writing, software
  15  * distributed under the License is distributed on an "AS IS" BASIS,
  16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  17  * See the License for the specific language governing permissions and
  18  * limitations under the License.
  19  */
  20 package org.apache.qetest.xsl;
  21 
  22 import org.xml.sax.Attributes;
  23 import org.xml.sax.ContentHandler;
  24 import org.xml.sax.Locator;
  25 import org.xml.sax.SAXException;
  26 
  27 /**
  28  * Cheap-o ContentHandler for use by API tests.
  29  * <p>Implements ContentHandler and a way to debug SAX stuff.</p>
  30  */
  31 public class CheckingContentHandler implements ContentHandler  {
  32     /**
  33      * Our default handler that we pass all events through to.
  34      */
  35     private volatile ContentHandler defaultHandler;
  36 
  37     /**
  38      * Set a default handler for us to wrapper. Set a ContentHandler for us to
  39      * use.
  40      * @param handler Object of the correct type to pass-through to.
  41      */
  42     public void setDefaultHandler(ContentHandler handler) {
  43         defaultHandler = handler;
  44 
  45     }
  46 
  47     /**
  48      * Accessor method for our default handler.
  49      * @return default (Object) our default handler; null if unset
  50      */
  51     public ContentHandler getDefaultHandler() {
  52         return defaultHandler;
  53     }
  54     
  55     @Override
  56     public void setDocumentLocator(Locator locator) {
  57         throw new UnsupportedOperationException("Not supported yet.");
  58     }
  59 
  60     @Override
  61     public void startDocument() throws SAXException {
  62         throw new UnsupportedOperationException("Not supported yet.");
  63     }
  64 
  65     @Override
  66     public void endDocument() throws SAXException {
  67         throw new UnsupportedOperationException("Not supported yet.");
  68     }
  69 
  70     @Override
  71     public void startPrefixMapping(String prefix, String uri) throws SAXException {
  72         throw new UnsupportedOperationException("Not supported yet.");
  73     }
  74 
  75     @Override
  76     public void endPrefixMapping(String prefix) throws SAXException {
  77         throw new UnsupportedOperationException("Not supported yet.");
  78     }
  79 
  80     @Override
  81     public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException {
  82         throw new UnsupportedOperationException("Not supported yet.");
  83     }
  84 
  85     @Override
  86     public void endElement(String uri, String localName, String qName) throws SAXException {
  87         throw new UnsupportedOperationException("Not supported yet.");
  88     }
  89 
  90     @Override
  91     public void characters(char[] ch, int start, int length) throws SAXException {
  92         throw new UnsupportedOperationException("Not supported yet.");
  93     }
  94 
  95     @Override
  96     public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException {
  97         throw new UnsupportedOperationException("Not supported yet.");
  98     }
  99 
 100     @Override
 101     public void processingInstruction(String target, String data) throws SAXException {
 102         throw new UnsupportedOperationException("Not supported yet.");
 103     }
 104 
 105     @Override
 106     public void skippedEntity(String name) throws SAXException {
 107         throw new UnsupportedOperationException("Not supported yet.");
 108     }   
 109 }