001/* 002 * Copyright 2001 (C) MetaStuff, Ltd. All Rights Reserved. 003 * 004 * This software is open source. 005 * See the bottom of this file for the licence. 006 * 007 * $Id: DefaultDocumentType.java,v 1.4 2001/10/12 11:05:01 jstrachan Exp $ 008 */ 009 010package org.dom4j.tree; 011 012import java.util.List; 013 014import org.dom4j.DocumentType; 015 016/** <p><code>DefaultDocumentType</code> is the DOM4J default implementation 017 * of an XML document type.</p> 018 * 019 * @author <a href="mailto:james.strachan@metastuff.com">James Strachan</a> 020 * @version $Revision: 1.4 $ 021 */ 022public class DefaultDocumentType extends AbstractDocumentType { 023 024 /** The root element name of the document typ */ 025 protected String elementName; 026 027 /** Holds value of property publicID. */ 028 private String publicID; 029 030 /** Holds value of property systemID. */ 031 private String systemID; 032 033 /** The internal DTD declarations */ 034 private List internalDeclarations; 035 036 /** The external DTD declarations */ 037 private List externalDeclarations; 038 039 public DefaultDocumentType() { 040 } 041 042 /** <p>This will create a new <code>DocumentType</code> 043 * with a reference to the external DTD</p> 044 * 045 * @param elementName is the root element name of the document type 046 * @param systemID is the system ID of the external DTD 047 */ 048 public DefaultDocumentType(String elementName, String systemID) { 049 this.elementName = elementName; 050 this.systemID = systemID; 051 } 052 053 /** <p>This will create a new <code>DocumentType</code> 054 * with a reference to the external DTD</p> 055 * 056 * @param elementName is the root element name of the document type 057 * @param publicID is the public ID of the DTD 058 * @param systemID is the system ID of the DTD 059 */ 060 public DefaultDocumentType(String elementName, String publicID, String systemID) { 061 this.elementName = elementName; 062 this.publicID = publicID; 063 this.systemID = systemID; 064 } 065 066 067 public String getElementName() { 068 return elementName; 069 } 070 071 public void setElementName(String elementName) { 072 this.elementName = elementName; 073 } 074 075 /** @return the public ID of the document type 076 */ 077 public String getPublicID() { 078 return publicID; 079 } 080 081 /** Sets the public ID of the document type 082 */ 083 public void setPublicID(String publicID) { 084 this.publicID = publicID; 085 } 086 087 /** @return the system ID of the document type 088 */ 089 public String getSystemID() { 090 return systemID; 091 } 092 093 /** Sets the system ID of the document type 094 */ 095 public void setSystemID(String systemID) { 096 this.systemID = systemID; 097 } 098 099 public List getInternalDeclarations() { 100 return internalDeclarations; 101 } 102 103 public void setInternalDeclarations(List internalDeclarations) { 104 this.internalDeclarations = internalDeclarations; 105 } 106 107 public List getExternalDeclarations() { 108 return externalDeclarations; 109 } 110 111 public void setExternalDeclarations(List externalDeclarations) { 112 this.externalDeclarations = externalDeclarations; 113 } 114} 115 116 117 118 119 120 121/* 122 * Redistribution and use of this software and associated documentation 123 * ("Software"), with or without modification, are permitted provided 124 * that the following conditions are met: 125 * 126 * 1. Redistributions of source code must retain copyright 127 * statements and notices. Redistributions must also contain a 128 * copy of this document. 129 * 130 * 2. Redistributions in binary form must reproduce the 131 * above copyright notice, this list of conditions and the 132 * following disclaimer in the documentation and/or other 133 * materials provided with the distribution. 134 * 135 * 3. The name "DOM4J" must not be used to endorse or promote 136 * products derived from this Software without prior written 137 * permission of MetaStuff, Ltd. For written permission, 138 * please contact dom4j-info@metastuff.com. 139 * 140 * 4. Products derived from this Software may not be called "DOM4J" 141 * nor may "DOM4J" appear in their names without prior written 142 * permission of MetaStuff, Ltd. DOM4J is a registered 143 * trademark of MetaStuff, Ltd. 144 * 145 * 5. Due credit should be given to the DOM4J Project 146 * (http://dom4j.org/). 147 * 148 * THIS SOFTWARE IS PROVIDED BY METASTUFF, LTD. AND CONTRIBUTORS 149 * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT 150 * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 151 * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 152 * METASTUFF, LTD. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 153 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 154 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 155 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 156 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 157 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 158 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 159 * OF THE POSSIBILITY OF SUCH DAMAGE. 160 * 161 * Copyright 2001 (C) MetaStuff, Ltd. All Rights Reserved. 162 * 163 * $Id: DefaultDocumentType.java,v 1.4 2001/10/12 11:05:01 jstrachan Exp $ 164 */