@@ -0,0 +1,3261 @@
+/*%0A * Copyright (c) 2016, Peter Ansell%0A * All rights reserved.%0A * %0A * Redistribution and use in source and binary forms, with or without%0A * modification, are permitted provided that the following conditions are met:%0A * %0A * * Redistributions of source code must retain the above copyright notice, this%0A *   list of conditions and the following disclaimer.%0A * %0A * * Redistributions in binary form must reproduce the above copyright notice,%0A *   this list of conditions and the following disclaimer in the documentation%0A *   and/or other materials provided with the distribution.%0A * %0A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS %22AS IS%22%0A * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE%0A * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE%0A * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE%0A * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL%0A * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR%0A * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER%0A * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,%0A * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE%0A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.%0A */%0Apackage com.github.ansell.dwca;%0A%0Aimport java.io.IOException;%0Aimport java.io.Reader;%0A%0Aimport org.xml.sax.Attributes;%0Aimport org.xml.sax.InputSource;%0Aimport org.xml.sax.SAXException;%0Aimport org.xml.sax.SAXParseException;%0Aimport org.xml.sax.XMLReader;%0Aimport org.xml.sax.helpers.DefaultHandler;%0Aimport org.xml.sax.helpers.XMLReaderFactory;%0A%0A/**%0A * SAX based parser for Darwin Core Metadata XML files%0A * %0A * @author Peter Ansell p_ansell@yahoo.com%0A */%0Apublic class DarwinCoreMetadataSaxParser extends DefaultHandler %7B%0A%0A%09private final XMLReader xmlReader;%0A%0A%09public DarwinCoreMetadataSaxParser() throws SAXException %7B%0A%09%09this(XMLReaderFactory.createXMLReader());%0A%09%7D%0A%0A%09public DarwinCoreMetadataSaxParser(XMLReader xmlReader) %7B%0A%09%09this.xmlReader = xmlReader;%0A%09%7D%0A%0A%09public void parse(Reader reader) throws IOException, SAXException %7B%0A%09%09parse(new InputSource(reader));%0A%09%7D%0A%0A%09public void parse(InputSource inputSource) throws IOException, SAXException %7B%0A%09%09xmlReader.setContentHandler(this);%0A%09%09xmlReader.parse(inputSource);%0A%09%7D%0A%0A%09@Override%0A%09public void startDocument() throws SAXException %7B%0A%09%7D%0A%0A%09@Override%0A%09public void endDocument() throws SAXException %7B%0A%09%7D%0A%0A%09@Override%0A%09public void startPrefixMapping(String prefix, String uri) throws SAXException %7B%0A%09%7D%0A%0A%09@Override%0A%09public void endPrefixMapping(String prefix) throws SAXException %7B%0A%09%7D%0A%0A%09@Override%0A%09public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException %7B%0A%09%7D%0A%0A%09@Override%0A%09public void endElement(String uri, String localName, String qName) throws SAXException %7B%0A%09%7D%0A%0A%09@Override%0A%09public void characters(char%5B%5D ch, int start, int length) throws SAXException %7B%0A%09%7D%0A%0A%09@Override%0A%09public void warning(SAXParseException e) throws SAXException %7B%0A%09%7D%0A%0A%09@Override%0A%09public void error(SAXParseException e) throws SAXException %7B%0A%09%7D%0A%0A%09@Override%0A%09public void fatalError(SAXParseException e) throws SAXException %7B%0A%09%7D%0A%0A%7D%0A

Add stub SAX parser code