View Javadoc

1   /*
2    * Copyright 2001-2004 (C) MetaStuff, Ltd. All Rights Reserved.
3    * 
4    * This software is open source. 
5    * See the bottom of this file for the licence.
6    * 
7    * $Id: DefaultDocumentType.java,v 1.8 2004/06/25 08:03:41 maartenc Exp $
8    */
9   
10  package org.dom4j.tree;
11  
12  import java.util.List;
13  
14  /*** <p><code>DefaultDocumentType</code> is the DOM4J default implementation
15    * of an XML document type.</p>
16    *
17    * @author <a href="mailto:james.strachan@metastuff.com">James Strachan</a>
18    * @version $Revision: 1.8 $
19    */
20  public class DefaultDocumentType extends AbstractDocumentType {
21  
22      /*** The root element name of the document typ */
23      protected String elementName;
24  
25      /*** Holds value of property publicID. */
26      private String publicID;
27      
28      /*** Holds value of property systemID. */    
29      private String systemID;
30      
31      /*** The internal DTD declarations */
32      private List internalDeclarations;
33      
34      /*** The external DTD declarations */
35      private List externalDeclarations;
36      
37      public DefaultDocumentType() { 
38      }
39  
40      /*** <p>This will create a new <code>DocumentType</code>
41        * with a reference to the external DTD</p>
42        *
43        * @param elementName is the root element name of the document type
44        * @param systemID is the system ID of the external DTD
45        */
46      public DefaultDocumentType(String elementName, String systemID) {
47          this.elementName = elementName;
48          this.systemID = systemID;
49      }
50  
51      /*** <p>This will create a new <code>DocumentType</code>
52        * with a reference to the external DTD</p>
53        *
54        * @param elementName is the root element name of the document type
55        * @param publicID is the public ID of the DTD
56        * @param systemID is the system ID of the DTD
57        */
58      public DefaultDocumentType(String elementName, String publicID, String systemID) {
59          this.elementName = elementName;
60          this.publicID = publicID;
61          this.systemID = systemID;
62      }
63  
64      
65      public String getElementName() {
66          return elementName;
67      }
68  
69      public void setElementName(String elementName) {
70          this.elementName = elementName;
71      }
72      
73      /*** @return the public ID of the document type
74        */
75      public String getPublicID() {
76          return publicID;
77      }
78      
79      /*** Sets the public ID of the document type
80        */
81      public void setPublicID(String publicID) {
82          this.publicID = publicID;
83      }
84      
85      /*** @return the system ID of the document type
86        */
87      public String getSystemID() {
88          return systemID;
89      }
90      
91      /*** Sets the system ID of the document type
92        */
93      public void setSystemID(String systemID) {
94          this.systemID = systemID;
95      }
96      
97      public List getInternalDeclarations() {
98          return internalDeclarations;
99      }
100     
101     public void setInternalDeclarations(List internalDeclarations) {
102         this.internalDeclarations = internalDeclarations;
103     }
104     
105     public List getExternalDeclarations() {
106         return externalDeclarations;
107     }
108     
109     public void setExternalDeclarations(List externalDeclarations) {
110         this.externalDeclarations = externalDeclarations;
111     }
112 }
113 
114 
115 
116 
117 
118 
119 /*
120  * Redistribution and use of this software and associated documentation
121  * ("Software"), with or without modification, are permitted provided
122  * that the following conditions are met:
123  *
124  * 1. Redistributions of source code must retain copyright
125  *    statements and notices.  Redistributions must also contain a
126  *    copy of this document.
127  *
128  * 2. Redistributions in binary form must reproduce the
129  *    above copyright notice, this list of conditions and the
130  *    following disclaimer in the documentation and/or other
131  *    materials provided with the distribution.
132  *
133  * 3. The name "DOM4J" must not be used to endorse or promote
134  *    products derived from this Software without prior written
135  *    permission of MetaStuff, Ltd.  For written permission,
136  *    please contact dom4j-info@metastuff.com.
137  *
138  * 4. Products derived from this Software may not be called "DOM4J"
139  *    nor may "DOM4J" appear in their names without prior written
140  *    permission of MetaStuff, Ltd. DOM4J is a registered
141  *    trademark of MetaStuff, Ltd.
142  *
143  * 5. Due credit should be given to the DOM4J Project - 
144  *    http://www.dom4j.org
145  *
146  * THIS SOFTWARE IS PROVIDED BY METASTUFF, LTD. AND CONTRIBUTORS
147  * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT
148  * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
149  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL
150  * METASTUFF, LTD. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
151  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
152  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
153  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
154  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
155  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
156  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
157  * OF THE POSSIBILITY OF SUCH DAMAGE.
158  *
159  * Copyright 2001-2004 (C) MetaStuff, Ltd. All Rights Reserved.
160  *
161  * $Id: DefaultDocumentType.java,v 1.8 2004/06/25 08:03:41 maartenc Exp $
162  */