001: /*
002: * Fast Infoset ver. 0.1 software ("Software")
003: *
004: * Copyright, 2004-2005 Sun Microsystems, Inc. All Rights Reserved.
005: *
006: * Software is licensed under the Apache License, Version 2.0 (the "License");
007: * you may not use this file except in compliance with the License. You may
008: * obtain a copy of the License at:
009: *
010: * http://www.apache.org/licenses/LICENSE-2.0
011: *
012: * Unless required by applicable law or agreed to in writing, software
013: * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
014: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
015: * License for the specific language governing permissions and limitations.
016: *
017: * Sun supports and benefits from the global community of open source
018: * developers, and thanks the community for its important contributions and
019: * open standards-based technology, which Sun has adopted into many of its
020: * products.
021: *
022: * Please note that portions of Software may be provided with notices and
023: * open source licenses from such communities and third parties that govern the
024: * use of those portions, and any licenses granted hereunder do not alter any
025: * rights and obligations you may have under such open source licenses,
026: * however, the disclaimer of warranty and limitation of liability provisions
027: * in this License will apply to all Software in this distribution.
028: *
029: * You acknowledge that the Software is not designed, licensed or intended
030: * for use in the design, construction, operation or maintenance of any nuclear
031: * facility.
032: *
033: * Apache License
034: * Version 2.0, January 2004
035: * http://www.apache.org/licenses/
036: *
037: */
038:
039: package com.sun.xml.fastinfoset.stax.events;
040:
041: import javax.xml.stream.events.EntityDeclaration;
042:
043: public class EntityDeclarationImpl extends EventBase implements
044: EntityDeclaration {
045: private String _publicId;
046: private String _systemId;
047: private String _baseURI;
048: private String _entityName;
049: private String _replacement;
050: private String _notationName;
051:
052: /** Creates a new instance of EntityDeclarationImpl */
053: public EntityDeclarationImpl() {
054: init();
055: }
056:
057: public EntityDeclarationImpl(String entityName, String replacement) {
058: init();
059: _entityName = entityName;
060: _replacement = replacement;
061: }
062:
063: /**
064: * The entity's public identifier, or null if none was given
065: * @return the public ID for this declaration or null
066: */
067: public String getPublicId() {
068: return _publicId;
069: }
070:
071: /**
072: * The entity's system identifier.
073: * @return the system ID for this declaration or null
074: */
075: public String getSystemId() {
076: return _systemId;
077: }
078:
079: /**
080: * The entity's name
081: * @return the name, may not be null
082: */
083: public String getName() {
084: return _entityName;
085: }
086:
087: /**
088: * The name of the associated notation.
089: * @return the notation name
090: */
091: public String getNotationName() {
092: return _notationName;
093: }
094:
095: /**
096: * The replacement text of the entity.
097: * This method will only return non-null
098: * if this is an internal entity.
099: * @return null or the replacment text
100: */
101: public String getReplacementText() {
102: return _replacement;
103: }
104:
105: /**
106: * Get the base URI for this reference
107: * or null if this information is not available
108: * @return the base URI or null
109: */
110: public String getBaseURI() {
111: return _baseURI;
112: }
113:
114: public void setPublicId(String publicId) {
115: _publicId = publicId;
116: }
117:
118: public void setSystemId(String systemId) {
119: _systemId = systemId;
120: }
121:
122: public void setBaseURI(String baseURI) {
123: _baseURI = baseURI;
124: }
125:
126: public void setName(String entityName) {
127: _entityName = entityName;
128: }
129:
130: public void setReplacementText(String replacement) {
131: _replacement = replacement;
132: }
133:
134: public void setNotationName(String notationName) {
135: _notationName = notationName;
136: }
137:
138: protected void init() {
139: setEventType(ENTITY_DECLARATION);
140: }
141: }
|