001: /*
002: * Copyright (c) 1998-2008 Caucho Technology -- all rights reserved
003: *
004: * This file is part of Resin(R) Open Source
005: *
006: * Each copy or derived work must preserve the copyright notice and this
007: * notice unmodified.
008: *
009: * Resin Open Source is free software; you can redistribute it and/or modify
010: * it under the terms of the GNU General Public License as published by
011: * the Free Software Foundation; either version 2 of the License, or
012: * (at your option) any later version.
013: *
014: * Resin Open Source is distributed in the hope that it will be useful,
015: * but WITHOUT ANY WARRANTY; without even the implied warranty of
016: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
017: * of NON-INFRINGEMENT. See the GNU General Public License for more
018: * details.
019: *
020: * You should have received a copy of the GNU General Public License
021: * along with Resin Open Source; if not, write to the
022: *
023: * Free Software Foundation, Inc.
024: * 59 Temple Place, Suite 330
025: * Boston, MA 02111-1307 USA
026: *
027: * @author Adam Megacz
028: */
029:
030: package javax.xml.stream;
031:
032: import javax.xml.namespace.NamespaceContext;
033: import javax.xml.namespace.QName;
034: import javax.xml.stream.events.*;
035: import java.util.Iterator;
036:
037: public abstract class XMLEventFactory {
038:
039: protected XMLEventFactory() {
040: }
041:
042: public abstract Attribute createAttribute(QName name, String value);
043:
044: public abstract Attribute createAttribute(String localName,
045: String value);
046:
047: public abstract Attribute createAttribute(String prefix,
048: String namespaceURI, String localName, String value);
049:
050: public abstract Characters createCData(String content);
051:
052: public abstract Characters createCharacters(String content);
053:
054: public abstract Comment createComment(String text);
055:
056: public abstract DTD createDTD(String dtd);
057:
058: public abstract EndDocument createEndDocument();
059:
060: public abstract EndElement createEndElement(QName name,
061: Iterator namespaces);
062:
063: public abstract EndElement createEndElement(String prefix,
064: String namespaceUri, String localName);
065:
066: public abstract EndElement createEndElement(String prefix,
067: String namespaceUri, String localName, Iterator namespaces);
068:
069: public abstract EntityReference createEntityReference(String name,
070: EntityDeclaration declaration);
071:
072: public abstract Characters createIgnorableSpace(String content);
073:
074: public abstract Namespace createNamespace(String namespaceURI);
075:
076: public abstract Namespace createNamespace(String prefix,
077: String namespaceUri);
078:
079: public abstract ProcessingInstruction createProcessingInstruction(
080: String target, String data);
081:
082: public abstract Characters createSpace(String content);
083:
084: public abstract StartDocument createStartDocument();
085:
086: public abstract StartDocument createStartDocument(String encoding);
087:
088: public abstract StartDocument createStartDocument(String encoding,
089: String version);
090:
091: public abstract StartDocument createStartDocument(String encoding,
092: String version, boolean standalone);
093:
094: public abstract StartElement createStartElement(QName name,
095: Iterator attributes, Iterator namespaces);
096:
097: public abstract StartElement createStartElement(String prefix,
098: String namespaceUri, String localName);
099:
100: public abstract StartElement createStartElement(String prefix,
101: String namespaceUri, String localName, Iterator attributes,
102: Iterator namespaces);
103:
104: public abstract StartElement createStartElement(String prefix,
105: String namespaceUri, String localName, Iterator attributes,
106: Iterator namespaces, NamespaceContext context);
107:
108: public static XMLEventFactory newInstance()
109: throws FactoryConfigurationError {
110: return newInstance("javax.xml.stream.XMLEventFactory", Thread
111: .currentThread().getContextClassLoader());
112: }
113:
114: public static XMLEventFactory newInstance(String factoryId,
115: ClassLoader classLoader) throws FactoryConfigurationError {
116: return (XMLEventFactory) FactoryLoader.getFactoryLoader(
117: factoryId).newInstance(classLoader);
118: }
119:
120: public abstract void setLocation(Location location);
121:
122: }
|