KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > forrest > sourcetype > SourceInfo


1 /*
2  * Copyright 2001-2004 The Apache Software Foundation or its licensors,
3  * as applicable.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */

17 package org.apache.forrest.sourcetype;
18
19 import java.util.HashMap JavaDoc;
20
21 /**
22  * Contains information about an XML file. More precisely, the publicId, the processing instructions
23  * occuring before the document element, the local name and namespace of the document element, and
24  * the value of the xsi:schemaLocation and xsi:noNamespaceSchemaLocation attributes. All of these
25  * attributes can be null.
26  *
27  */

28 public class SourceInfo
29 {
30     protected String JavaDoc publicId;
31     protected String JavaDoc documentElementLocalName;
32     protected String JavaDoc documentElementNamespace;
33     protected String JavaDoc xsiSchemaLocation;
34     protected String JavaDoc xsiNoNamespaceSchemaLocation;
35     protected HashMap JavaDoc processingInstructions = new HashMap JavaDoc();
36
37     public String JavaDoc getPublicId()
38     {
39         return publicId;
40     }
41
42     public void setPublicId(String JavaDoc publicId)
43     {
44         this.publicId = publicId;
45     }
46
47     public String JavaDoc getDocumentElementLocalName()
48     {
49         return documentElementLocalName;
50     }
51
52     public void setDocumentElementLocalName(String JavaDoc documentElementLocalName)
53     {
54         this.documentElementLocalName = documentElementLocalName;
55     }
56
57     public String JavaDoc getDocumentElementNamespace()
58     {
59         return documentElementNamespace;
60     }
61
62     public void setDocumentElementNamespace(String JavaDoc documentElementNamespace)
63     {
64         this.documentElementNamespace = documentElementNamespace;
65     }
66
67     public String JavaDoc getXsiSchemaLocation()
68     {
69         return xsiSchemaLocation;
70     }
71
72     public void setXsiSchemaLocation(String JavaDoc xsiSchemaLocation)
73     {
74         this.xsiSchemaLocation = xsiSchemaLocation;
75     }
76
77     public String JavaDoc getXsiNoNamespaceSchemaLocation()
78     {
79         return xsiNoNamespaceSchemaLocation;
80     }
81
82     public void setXsiNoNamespaceSchemaLocation(String JavaDoc xsiNoNamespaceSchemaLocation)
83     {
84         this.xsiNoNamespaceSchemaLocation = xsiNoNamespaceSchemaLocation;
85     }
86
87     public void addProcessingInstruction(String JavaDoc target, String JavaDoc data)
88     {
89         processingInstructions.put(target, data);
90     }
91
92     public boolean hasProcessingInstruction(String JavaDoc target)
93     {
94         return processingInstructions.containsKey(target);
95     }
96
97     public String JavaDoc getProcessingInstructionData(String JavaDoc target)
98     {
99         return (String JavaDoc)processingInstructions.get(target);
100     }
101 }
102
Popular Tags