001: /*
002: * The contents of this file are subject to the terms
003: * of the Common Development and Distribution License
004: * (the "License"). You may not use this file except
005: * in compliance with the License.
006: *
007: * You can obtain a copy of the license at
008: * https://jaxp.dev.java.net/CDDLv1.0.html.
009: * See the License for the specific language governing
010: * permissions and limitations under the License.
011: *
012: * When distributing Covered Code, include this CDDL
013: * HEADER in each file and include the License file at
014: * https://jaxp.dev.java.net/CDDLv1.0.html
015: * If applicable add the following below this CDDL HEADER
016: * with the fields enclosed by brackets "[]" replaced with
017: * your own identifying information: Portions Copyright
018: * [year] [name of copyright owner]
019: */
020:
021: /*
022: * The contents of this file are subject to the terms
023: * of the Common Development and Distribution License
024: * (the License). You may not use this file except in
025: * compliance with the License.
026: *
027: * You can obtain a copy of the license at
028: * https://glassfish.dev.java.net/public/CDDLv1.0.html.
029: * See the License for the specific language governing
030: * permissions and limitations under the License.
031: *
032: * When distributing Covered Code, include this CDDL
033: * Header Notice in each file and include the License file
034: * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
035: * If applicable, add the following below the CDDL Header,
036: * with the fields enclosed by brackets [] replaced by
037: * you own identifying information:
038: * "Portions Copyrighted [year] [name of copyright owner]"
039: *
040: * [Name of File] [ver.__] [Date]
041: *
042: * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
043: */
044:
045: package com.sun.xml.stream.events;
046:
047: import javax.xml.stream.events.DTD;
048: import javax.xml.stream.events.XMLEvent;
049:
050: /**
051: *
052: * @author Neeraj Bajaj, Sun Microsystesm.
053: *
054: */
055: public class DTDEvent extends DummyEvent implements DTD {
056:
057: private String fDoctypeDeclaration;
058: private java.util.List fNotations;
059: private java.util.List fEntities;
060:
061: /** Creates a new instance of DTDEvent */
062: public DTDEvent() {
063: init();
064: }
065:
066: public DTDEvent(String doctypeDeclaration) {
067: init();
068: fDoctypeDeclaration = doctypeDeclaration;
069: }
070:
071: public void setDocumentTypeDeclaration(String doctypeDeclaration) {
072: fDoctypeDeclaration = doctypeDeclaration;
073: }
074:
075: public String getDocumentTypeDeclaration() {
076: return fDoctypeDeclaration;
077: }
078:
079: //xxx: we can change the signature if the implementation doesn't store the entities in List Datatype.
080: //and then convert that DT to list format here. That way callee dont need to bother about conversion
081:
082: public void setEntities(java.util.List entites) {
083: fEntities = entites;
084: }
085:
086: public java.util.List getEntities() {
087: return fEntities;
088: }
089:
090: //xxx: we can change the signature if the implementation doesn't store the entities in List Datatype.
091: //and then convert that DT to list format here. That way callee dont need to bother about conversion
092:
093: public void setNotations(java.util.List notations) {
094: fNotations = notations;
095: }
096:
097: public java.util.List getNotations() {
098: return fNotations;
099: }
100:
101: /**
102: *Returns an implementation defined representation of the DTD.
103: * This method may return null if no representation is available.
104: *
105: */
106: public Object getProcessedDTD() {
107: return null;
108: }
109:
110: protected void init() {
111: setEventType(XMLEvent.DTD);
112: }
113:
114: public String toString() {
115: return fDoctypeDeclaration;
116: }
117: }
|