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 Emil Ong
028: */
029:
030: package com.caucho.xml.stream.events;
031:
032: import javax.xml.stream.XMLStreamException;
033: import javax.xml.stream.events.EntityDeclaration;
034: import java.io.Writer;
035:
036: public class EntityDeclarationImpl extends XMLEventImpl implements
037: EntityDeclaration {
038: private final String _baseURI;
039: private final String _name;
040: private final String _notationName;
041: private final String _publicId;
042: private final String _replacementText;
043: private final String _systemId;
044:
045: public EntityDeclarationImpl(String baseURI, String name,
046: String notationName, String publicId,
047: String replacementText, String systemId) {
048: _baseURI = baseURI;
049: _name = name;
050: _notationName = notationName;
051: _publicId = publicId;
052: _replacementText = replacementText;
053: _systemId = systemId;
054: }
055:
056: public String getBaseURI() {
057: return _baseURI;
058: }
059:
060: public String getName() {
061: return _name;
062: }
063:
064: public String getNotationName() {
065: return _notationName;
066: }
067:
068: public String getPublicId() {
069: return _publicId;
070: }
071:
072: public String getReplacementText() {
073: return _replacementText;
074: }
075:
076: public String getSystemId() {
077: return _systemId;
078: }
079:
080: public int getEventType() {
081: return ENTITY_DECLARATION;
082: }
083:
084: public void writeAsEncodedUnicode(Writer writer)
085: throws XMLStreamException {
086: // XXX
087: }
088:
089: public boolean equals(Object o) {
090: if (!(o instanceof EntityDeclaration))
091: return false;
092: if (o == null)
093: return false;
094: if (this == o)
095: return true;
096:
097: EntityDeclaration entity = (EntityDeclaration) o;
098:
099: return getBaseURI().equals(entity.getBaseURI())
100: && getName().equals(entity.getName())
101: && getNotationName().equals(entity.getNotationName())
102: && getPublicId().equals(entity.getPublicId())
103: && getReplacementText().equals(
104: entity.getReplacementText())
105: && getSystemId().equals(entity.getSystemId());
106: }
107: }
|