Path: blob/aarch64-shenandoah-jdk8u272-b10/jaxp/src/com/sun/xml/internal/stream/events/DTDEvent.java
86414 views
/*1* Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package com.sun.xml.internal.stream.events;2627import javax.xml.stream.events.DTD;28import javax.xml.stream.events.XMLEvent;2930/**31*32* @author Neeraj Bajaj, Sun Microsystesm.33*34*/35public class DTDEvent extends DummyEvent implements DTD{3637private String fDoctypeDeclaration;38private java.util.List fNotations;39private java.util.List fEntities;4041/** Creates a new instance of DTDEvent */42public DTDEvent() {43init();44}4546public DTDEvent(String doctypeDeclaration){47init();48fDoctypeDeclaration = doctypeDeclaration;49}5051public void setDocumentTypeDeclaration(String doctypeDeclaration){52fDoctypeDeclaration = doctypeDeclaration;53}5455public String getDocumentTypeDeclaration() {56return fDoctypeDeclaration;57}5859//xxx: we can change the signature if the implementation doesn't store the entities in List Datatype.60//and then convert that DT to list format here. That way callee dont need to bother about conversion6162public void setEntities(java.util.List entites){63fEntities = entites;64}6566public java.util.List getEntities() {67return fEntities;68}6970//xxx: we can change the signature if the implementation doesn't store the entities in List Datatype.71//and then convert that DT to list format here. That way callee dont need to bother about conversion7273public void setNotations(java.util.List notations){74fNotations = notations;75}7677public java.util.List getNotations() {78return fNotations;79}8081/**82*Returns an implementation defined representation of the DTD.83* This method may return null if no representation is available.84*85*/86public Object getProcessedDTD() {87return null;88}8990protected void init(){91setEventType(XMLEvent.DTD);92}9394public String toString(){95return fDoctypeDeclaration ;96}9798protected void writeAsEncodedUnicodeEx(java.io.Writer writer)99throws java.io.IOException100{101writer.write(fDoctypeDeclaration);102}103}104105106