001: /*
002: * GeoTools - OpenSource mapping toolkit
003: * http://geotools.org
004: * (C) 2004-2006, GeoTools Project Managment Committee (PMC)
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation;
009: * version 2.1 of the License.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: */
016: package org.geotools.xml.handlers;
017:
018: import java.net.URI;
019: import java.util.Map;
020:
021: import org.geotools.xml.XMLElementHandler;
022: import org.geotools.xml.schema.Element;
023: import org.xml.sax.Attributes;
024:
025: /**
026: * <p>
027: * This is a default Handler which is used in case a handler cannot be created
028: * for an arbitry element. Note: this handler does not perform and parsing on
029: * the current element or it's children.
030: * </p>
031: *
032: * @author dzwiers, Refractions Research, Inc. http://www.refractions.net
033: * @author $Author:$ (last modification)
034: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/xml/src/main/java/org/geotools/xml/handlers/IgnoreHandler.java $
035: * @version $Id: IgnoreHandler.java 22347 2006-10-24 01:57:23Z jdeolive $
036: */
037: public class IgnoreHandler extends XMLElementHandler {
038:
039: public static final String NAME = "IGNORE_HANDLER";
040:
041: private Element elem;
042:
043: public IgnoreHandler() {
044: elem = null;
045: }
046:
047: public IgnoreHandler(Element igElem) {
048: elem = igElem;
049: }
050:
051: /**
052: * @see org.geotools.xml.XMLElementHandler#getElement()
053: */
054: public Element getElement() {
055: return elem;
056: }
057:
058: /**
059: * @see org.geotools.xml.XMLElementHandler#characters(java.lang.String)
060: */
061: public void characters(String text) {
062: // do nothing
063: }
064:
065: /**
066: * @see schema.XSIElementHandler#getHandler(java.lang.String,
067: * java.lang.String)
068: */
069: public XMLElementHandler getHandler(URI namespaceURI,
070: String localName, Map hints) {
071: return this ;
072: }
073:
074: /**
075: * @see org.geotools.xml.XMLElementHandler#getValue()
076: */
077: public Object getValue() {
078: return null;
079: }
080:
081: /**
082: * @see org.geotools.xml.XMLElementHandler#getName()
083: */
084: public String getName() {
085: return NAME;
086: }
087:
088: /**
089: * @see org.geotools.xml.XMLElementHandler#endElement(java.lang.String,
090: * java.lang.String)
091: */
092: public void endElement(URI namespaceURI, String localName, Map hints) {
093: // do nothing
094: }
095:
096: /**
097: * @see org.geotools.xml.XMLElementHandler#startElement(java.lang.String,
098: * java.lang.String, org.xml.sax.Attributes)
099: */
100: public void startElement(URI namespaceURI, String localName,
101: Attributes attr) {
102: // do nothing
103: }
104: }
|