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;
017:
018: import java.io.IOException;
019: import java.net.URI;
020:
021: import org.geotools.xml.schema.Element;
022: import org.geotools.xml.schema.Schema;
023: import org.xml.sax.Attributes;
024:
025: /**
026: * PrintHandler accepts SAXish events and generated output.
027: *
028: * @author dzwiers
029: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/xml/src/main/java/org/geotools/xml/PrintHandler.java $
030: */
031: public interface PrintHandler {
032: /**
033: * DOCUMENT ME!
034: *
035: * @param namespaceURI DOCUMENT ME!
036: * @param localName DOCUMENT ME!
037: * @param attributes DOCUMENT ME!
038: *
039: * @throws IOException
040: */
041: public void startElement(URI namespaceURI, String localName,
042: Attributes attributes) throws IOException;
043:
044: /**
045: * DOCUMENT ME!
046: *
047: * @param namespaceURI DOCUMENT ME!
048: * @param localName DOCUMENT ME!
049: * @param attributes DOCUMENT ME!
050: *
051: * @throws IOException
052: */
053: public void element(URI namespaceURI, String localName,
054: Attributes attributes) throws IOException;
055:
056: /**
057: * DOCUMENT ME!
058: *
059: * @param namespaceURI DOCUMENT ME!
060: * @param localName DOCUMENT ME!
061: *
062: * @throws IOException
063: */
064: public void endElement(URI namespaceURI, String localName)
065: throws IOException;
066:
067: /**
068: * DOCUMENT ME!
069: *
070: * @param arg0 DOCUMENT ME!
071: * @param arg1 DOCUMENT ME!
072: * @param arg2 DOCUMENT ME!
073: *
074: * @throws IOException
075: */
076: public void characters(char[] arg0, int arg1, int arg2)
077: throws IOException;
078:
079: /**
080: * DOCUMENT ME!
081: *
082: * @param s DOCUMENT ME!
083: *
084: * @throws IOException
085: */
086: public void characters(String s) throws IOException;
087:
088: /**
089: * DOCUMENT ME!
090: *
091: * @param arg0 DOCUMENT ME!
092: * @param arg1 DOCUMENT ME!
093: * @param arg2 DOCUMENT ME!
094: *
095: * @throws IOException
096: */
097: public void ignorableWhitespace(char[] arg0, int arg1, int arg2)
098: throws IOException;
099:
100: /**
101: * DOCUMENT ME!
102: *
103: * @throws IOException
104: */
105: public void startDocument() throws IOException;
106:
107: /**
108: * DOCUMENT ME!
109: *
110: * @throws IOException
111: */
112: public void endDocument() throws IOException;
113:
114: /**
115: * Returns the default Schema for the document being printed
116: *
117: * @return Schema
118: */
119: public Schema getDocumentSchema();
120:
121: /**
122: * Tries to find an appropriate Element so represent the value.
123: *
124: * @param value The Object being attempted to write
125: * @return Element The element instance found, or null if not found.
126: */
127: public Element findElement(Object value);
128:
129: public Element findElement(String name);
130:
131: public Object getHint(Object key);
132: }
|