001: /*
002: * $Id: EntityDeclarationEvent.java,v 1.2 2004/07/15 02:11:01 cniles Exp $
003: *
004: * Copyright (c) 2004, Christian Niles, unit12.net
005: * All rights reserved.
006: *
007: * Redistribution and use in source and binary forms, with or without
008: * modification, are permitted provided that the following conditions are met:
009: *
010: * * Redistributions of source code must retain the above copyright
011: * notice, this list of conditions and the following disclaimer.
012: *
013: * * Redistributions in binary form must reproduce the above copyright
014: * notice, this list of conditions and the following disclaimer in the
015: * documentation and/or other materials provided with the distribution.
016: *
017: * * Neither the name of Christian Niles, Unit12, nor the names of its
018: * contributors may be used to endorse or promote products derived from
019: * this software without specific prior written permission.
020: *
021: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
022: * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
023: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
024: * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
025: * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
026: * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
027: * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
028: * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
029: * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
030: * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
031: * POSSIBILITY OF SUCH DAMAGE.
032: *
033: */
034: package javanet.staxutils.events;
035:
036: import javax.xml.stream.Location;
037: import javax.xml.stream.events.EntityDeclaration;
038:
039: /**
040: * {@link EntityDeclaration} event implementation.
041: *
042: * @author Christian Niles
043: * @version $Revision: 1.2 $
044: */
045: public class EntityDeclarationEvent extends AbstractXMLEvent implements
046: EntityDeclaration {
047:
048: /** The entity name. */
049: protected String name;
050:
051: /**
052: * The replacement text, or <code>null</code> if this isn't an internal entity.
053: */
054: protected String replacementText;
055:
056: /** The entity base URI, or <code>null</code> if this isn't an external entity */
057: protected String baseURI;
058:
059: /** The public id, or <code>null</code> if this isn't an external entity */
060: protected String publicId;
061:
062: /** The system id, or <code>null</code> if this isn't an external entity. */
063: protected String systemId;
064:
065: /**
066: * The optional notation name.
067: */
068: protected String notationName;
069:
070: public EntityDeclarationEvent(String name, String replacementText,
071: Location location) {
072:
073: super (location);
074: this .name = name;
075: this .replacementText = replacementText;
076:
077: }
078:
079: public EntityDeclarationEvent(String name, String replacementText,
080: String notationName, Location location) {
081:
082: super (location);
083: this .name = name;
084: this .replacementText = replacementText;
085: this .notationName = notationName;
086:
087: }
088:
089: public EntityDeclarationEvent(String name, String publicId,
090: String systemId, String baseURI, String notationName,
091: Location location) {
092:
093: super (location);
094: this .name = name;
095: this .publicId = publicId;
096: this .systemId = systemId;
097: this .baseURI = baseURI;
098: this .notationName = notationName;
099:
100: }
101:
102: public EntityDeclarationEvent(EntityDeclaration that) {
103:
104: super (that);
105: this .name = that.getName();
106: this .replacementText = that.getReplacementText();
107: this .publicId = that.getPublicId();
108: this .systemId = that.getSystemId();
109: this .baseURI = that.getBaseURI();
110: this .notationName = that.getNotationName();
111:
112: }
113:
114: /**
115: * Returns {@link #ENTITY_DECLARATION}.
116: */
117: public int getEventType() {
118:
119: return ENTITY_DECLARATION;
120:
121: }
122:
123: public String getBaseURI() {
124:
125: return this .baseURI;
126:
127: }
128:
129: public String getName() {
130:
131: return this .name;
132:
133: }
134:
135: public String getNotationName() {
136:
137: return this .notationName;
138:
139: }
140:
141: public String getPublicId() {
142:
143: return this .publicId;
144:
145: }
146:
147: public String getReplacementText() {
148:
149: return this .replacementText;
150:
151: }
152:
153: public String getSystemId() {
154:
155: return this.systemId;
156:
157: }
158:
159: }
|