--- /dev/null 2014-09-08 10:45:56.830930409 -0700 +++ new/test/javax/xml/jaxp/libs/org/apache/qetest/xsl/CheckingContentHandler.java 2014-12-31 11:41:18.229146033 -0800 @@ -0,0 +1,109 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + */ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.qetest.xsl; + +import org.xml.sax.Attributes; +import org.xml.sax.ContentHandler; +import org.xml.sax.Locator; +import org.xml.sax.SAXException; + +/** + * Cheap-o ContentHandler for use by API tests. + *

Implements ContentHandler and a way to debug SAX stuff.

+ */ +public class CheckingContentHandler implements ContentHandler { + /** + * Our default handler that we pass all events through to. + */ + private volatile ContentHandler defaultHandler; + + /** + * Set a default handler for us to wrapper. Set a ContentHandler for us to + * use. + * @param handler Object of the correct type to pass-through to. + */ + public void setDefaultHandler(ContentHandler handler) { + defaultHandler = handler; + + } + + /** + * Accessor method for our default handler. + * @return default (Object) our default handler; null if unset + */ + public ContentHandler getDefaultHandler() { + return defaultHandler; + } + + @Override + public void setDocumentLocator(Locator locator) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void startDocument() throws SAXException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void endDocument() throws SAXException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void startPrefixMapping(String prefix, String uri) throws SAXException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void endPrefixMapping(String prefix) throws SAXException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void endElement(String uri, String localName, String qName) throws SAXException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void characters(char[] ch, int start, int length) throws SAXException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void processingInstruction(String target, String data) throws SAXException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void skippedEntity(String name) throws SAXException { + throw new UnsupportedOperationException("Not supported yet."); + } +}