Xalan-C++ API Reference  1.12.0
XalanText.hpp
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 #if !defined(XALANTEXT_HEADER_GUARD_1357924680)
19 #define XALANTEXT_HEADER_GUARD_1357924680
20 
21 
22 
25 
26 
27 
28 namespace XALAN_CPP_NAMESPACE {
29 
30 
31 
32 /*
33  * <meta name="usage" content="experimental"/>
34  *
35  * Base class for the DOM Text interface.
36  *
37  * This class is experimental and subject to change!!
38  */
39 
41 {
42 public:
43 
44  XalanText();
45 
46  virtual
47  ~XalanText();
48 
49  // These interfaces are inherited from XalanNode...
50  virtual const XalanDOMString&
51  getNodeName() const = 0;
52 
53  /**
54  * Gets the value of this node, depending on its type.
55  */
56  virtual const XalanDOMString&
57  getNodeValue() const = 0;
58 
59  /**
60  * An enum value representing the type of the underlying object.
61  */
62  virtual NodeType
63  getNodeType() const = 0;
64 
65  /**
66  * Gets the parent of this node.
67  *
68  * All nodes, except <code>Document</code>,
69  * <code>DocumentFragment</code>, and <code>Attr</code> may have a parent.
70  * However, if a node has just been created and not yet added to the tree,
71  * or if it has been removed from the tree, a <code>null</code> Node
72  * is returned.
73  */
74  virtual XalanNode*
75  getParentNode() const = 0;
76 
77  /**
78  * Gets a <code>NodeList</code> that contains all children of this node.
79  *
80  * If there
81  * are no children, this is a <code>NodeList</code> containing no nodes.
82  * The content of the returned <code>NodeList</code> is "live" in the sense
83  * that, for instance, changes to the children of the node object that
84  * it was created from are immediately reflected in the nodes returned by
85  * the <code>NodeList</code> accessors; it is not a static snapshot of the
86  * content of the node. This is true for every <code>NodeList</code>,
87  * including the ones returned by the <code>getElementsByTagName</code>
88  * method.
89  */
90  virtual const XalanNodeList*
91  getChildNodes() const = 0;
92 
93  /**
94  * Gets the first child of this node.
95  *
96  * If there is no such node, this returns <code>null</code>.
97  */
98  virtual XalanNode*
99  getFirstChild() const = 0;
100 
101  /**
102  * Gets the last child of this node.
103  *
104  * If there is no such node, this returns <code>null</code>.
105  */
106  virtual XalanNode*
107  getLastChild() const = 0;
108 
109  /**
110  * Gets the node immediately preceding this node.
111  *
112  * If there is no such node, this returns <code>null</code>.
113  */
114  virtual XalanNode*
115  getPreviousSibling() const = 0;
116 
117  /**
118  * Gets the node immediately following this node.
119  *
120  * If there is no such node, this returns <code>null</code>.
121  */
122  virtual XalanNode*
123  getNextSibling() const = 0;
124 
125  /**
126  * Gets a <code>NamedNodeMap</code> containing the attributes of this node (if it
127  * is an <code>Element</code>) or <code>null</code> otherwise.
128  */
129  virtual const XalanNamedNodeMap*
130  getAttributes() const = 0;
131 
132  /**
133  * Gets the <code>Document</code> object associated with this node.
134  *
135  * This is also
136  * the <code>Document</code> object used to create new nodes. When this
137  * node is a <code>Document</code> or a <code>DocumentType</code>
138  * which is not used with any <code>Document</code> yet, this is
139  * <code>null</code>.
140  */
141  virtual XalanDocument*
142  getOwnerDocument() const = 0;
143 
144  /**
145  * Get the <em>namespace URI</em> of
146  * this node, or <code>null</code> if it is unspecified.
147  * <p>
148  * This is not a computed value that is the result of a namespace lookup
149  * based on an examination of the namespace declarations in scope. It is
150  * merely the namespace URI given at creation time.
151  * <p>
152  * For nodes of any type other than <CODE>ELEMENT_NODE</CODE> and
153  * <CODE>ATTRIBUTE_NODE</CODE> and nodes created with a DOM Level 1 method,
154  * such as <CODE>createElement</CODE> from the <CODE>Document</CODE>
155  * interface, this is always <CODE>null</CODE>.
156  */
157  virtual const XalanDOMString&
158  getNamespaceURI() const = 0;
159 
160  /**
161  * Get the <em>namespace prefix</em>
162  * of this node, or <code>null</code> if it is unspecified.
163  */
164  virtual const XalanDOMString&
165  getPrefix() const = 0;
166 
167  /**
168  * Returns the local part of the <em>qualified name</em> of this node.
169  * <p>
170  * For nodes created with a DOM Level 1 method, such as
171  * <code>createElement</code> from the <code>Document</code> interface,
172  * it is null.
173  */
174  virtual const XalanDOMString&
175  getLocalName() const = 0;
176 
177  /**
178  * Determine if the document is node-order indexed.
179  *
180  * @return true if the document is indexed, otherwise false.
181  */
182  virtual bool
183  isIndexed() const = 0;
184 
185  /**
186  * Get the node's index. Valid only if the owner document
187  * reports that the document is node-order indexed.
188  *
189  * @return The index value, or 0 if the node is not indexed.
190  */
191  virtual IndexType
192  getIndex() const = 0;
193 
194  // These interfaces are inherited from XalanCharacterData...
195 
196  /**
197  * Returns the character data of the node that implements this interface.
198  *
199  * @exception DOMException
200  * NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
201  * @exception DOMException
202  * DOMSTRING_SIZE_ERR: Raised when it would return more characters than
203  * fit in a <code>XalanDOMString</code> variable on the implementation
204  * platform.
205  */
206  virtual const XalanDOMString&
207  getData() const = 0;
208 
209  // These interfaces are new to XalanText...
210 
211  /**
212  * Determine whether the text node instance is composed entirely of
213  * XML whitespace.
214  *
215  * @return true if the node is all XML whitespace, false if not
216  */
217  virtual bool
218  isWhitespace() const = 0;
219 
220 protected:
221 
222  XalanText(const XalanText& theSource);
223 
224  XalanText&
225  operator=(const XalanText& theSource);
226 
227  bool
228  operator==(const XalanText& theRHS) const;
229 
230 private:
231 };
232 
233 
234 
235 }
236 
237 
238 
239 #endif // !defined(XALANTEXT_HEADER_GUARD_1357924680)
XALAN_CPP_NAMESPACE
#define XALAN_CPP_NAMESPACE
Xalan-C++ namespace, including major and minor version.
Definition: XalanVersion.hpp:76
xalanc::XalanNode
Definition: XalanNode.hpp:38
xalanc::XalanNode::NodeType
NodeType
Definition: XalanNode.hpp:47
xalanc::XalanText
Definition: XalanText.hpp:40
xalanc::XalanDocument
Definition: XalanDocument.hpp:36
xalanc::operator==
bool operator==(const XalanVector< Type > &theLHS, const XalanVector< Type > &theRHS)
Definition: XalanVector.hpp:1118
xalanc::XalanCharacterData
Definition: XalanCharacterData.hpp:32
xalanc::XalanNode::IndexType
unsigned long IndexType
Definition: XalanNode.hpp:64
xalanc::XalanNodeList
Definition: XalanNodeList.hpp:36
XalanCharacterData.hpp
xalanc::XalanNamedNodeMap
Definition: XalanNamedNodeMap.hpp:36
XalanDOMDefinitions.hpp
XALAN_DOM_EXPORT
#define XALAN_DOM_EXPORT
Definition: XalanDOMDefinitions.hpp:37
xalanc::XalanDOMString
Definition: XalanDOMString.hpp:45