KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > xml > utils > NSInfo


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

16 /*
17  * $Id: NSInfo.java,v 1.5 2004/02/17 04:21:14 minchau Exp $
18  */

19 package org.apache.xml.utils;
20
21 /**
22  * This class holds information about the namespace info
23  * of a node. It is used to optimize namespace lookup in
24  * a generic DOM.
25  * @xsl.usage internal
26  */

27 public class NSInfo
28 {
29
30   /**
31    * Constructor NSInfo
32    *
33    *
34    * @param hasProcessedNS Flag indicating whether namespaces
35    * have been processed for this node
36    * @param hasXMLNSAttrs Flag indicating whether this node
37    * has XMLNS attributes.
38    */

39   public NSInfo(boolean hasProcessedNS, boolean hasXMLNSAttrs)
40   {
41
42     m_hasProcessedNS = hasProcessedNS;
43     m_hasXMLNSAttrs = hasXMLNSAttrs;
44     m_namespace = null;
45     m_ancestorHasXMLNSAttrs = ANCESTORXMLNSUNPROCESSED;
46   }
47
48   // Unused at the moment
49

50   /**
51    * Constructor NSInfo
52    *
53    *
54    * @param hasProcessedNS Flag indicating whether namespaces
55    * have been processed for this node
56    * @param hasXMLNSAttrs Flag indicating whether this node
57    * has XMLNS attributes.
58    * @param hasXMLNSAttrs Flag indicating whether one of this node's
59    * ancestor has XMLNS attributes.
60    */

61   public NSInfo(boolean hasProcessedNS, boolean hasXMLNSAttrs,
62                 int ancestorHasXMLNSAttrs)
63   {
64
65     m_hasProcessedNS = hasProcessedNS;
66     m_hasXMLNSAttrs = hasXMLNSAttrs;
67     m_ancestorHasXMLNSAttrs = ancestorHasXMLNSAttrs;
68     m_namespace = null;
69   }
70
71   /**
72    * Constructor NSInfo
73    *
74    *
75    * @param namespace The namespace URI
76    * @param hasXMLNSAttrs Flag indicating whether this node
77    * has XMLNS attributes.
78    */

79   public NSInfo(String JavaDoc namespace, boolean hasXMLNSAttrs)
80   {
81
82     m_hasProcessedNS = true;
83     m_hasXMLNSAttrs = hasXMLNSAttrs;
84     m_namespace = namespace;
85     m_ancestorHasXMLNSAttrs = ANCESTORXMLNSUNPROCESSED;
86   }
87
88   /** The namespace URI */
89   public String JavaDoc m_namespace;
90
91   /** Flag indicating whether this node has an XMLNS attribute */
92   public boolean m_hasXMLNSAttrs;
93
94   /** Flag indicating whether namespaces have been processed for this node */
95   public boolean m_hasProcessedNS;
96
97   /** Flag indicating whether one of this node's ancestor has an XMLNS attribute */
98   public int m_ancestorHasXMLNSAttrs;
99
100   /** Constant for ancestors XMLNS atributes not processed */
101   public static final int ANCESTORXMLNSUNPROCESSED = 0;
102
103   /** Constant indicating an ancestor has an XMLNS attribute */
104   public static final int ANCESTORHASXMLNS = 1;
105
106   /** Constant indicating ancestors don't have an XMLNS attribute */
107   public static final int ANCESTORNOXMLNS = 2;
108 }
109
Popular Tags