Xalan-C++ API Reference 1.12.0
XalanSourceTreeElement.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(XALANSOURCETREEELEMENT_HEADER_GUARD_1357924680)
19#define XALANSOURCETREEELEMENT_HEADER_GUARD_1357924680
20
21
22
24
25
26
30
31
32
33namespace XALAN_CPP_NAMESPACE {
34
35
36
37class XalanSourceTreeAttr;
38class XalanSourceTreeComment;
39class XalanSourceTreeDocument;
40class XalanSourceTreeDocumentFragment;
41class XalanSourceTreeProcessingInstruction;
42class XalanSourceTreeText;
43
44
45
47{
48public:
49
50 /**
51 * Constructor.
52 *
53 * @param theTagName The tag name of the element
54 * @param theOwnerDocument The document that owns the instance
55 * @param theAttributes An array of pointers to the attribute instances for the element
56 * @param theAttributeCount The number of attributes.
57 * @param theParentNode The parent node, if any.
58 * @param thePreviousSibling The previous sibling, if any.
59 * @param theNextSibling The next sibling, if any.
60 * @param theIndex The document-order index of the node.
61 */
63 MemoryManager& theManager,
70
71 virtual
73
74 MemoryManager&
76 {
77 return m_memoryManager;
78 }
79
80 // These interfaces are inherited from XalanElement...
81
82 virtual const XalanDOMString&
83 getNodeName() const;
84
85 virtual const XalanDOMString&
86 getNodeValue() const;
87
88 virtual NodeType
89 getNodeType() const;
90
91 virtual XalanNode*
93
94 virtual const XalanNodeList*
96
97 virtual XalanNode*
99
100 virtual XalanNode*
102
103 virtual XalanNode*
105
106 virtual XalanNode*
108
109 virtual const XalanNamedNodeMap*
110 getAttributes() const = 0;
111
112 virtual XalanDocument*
114
115 virtual const XalanDOMString&
116 getNamespaceURI() const = 0;
117
118 virtual const XalanDOMString&
119 getPrefix() const = 0;
120
121 virtual const XalanDOMString&
122 getLocalName() const = 0;
123
124 virtual bool
125 isIndexed() const;
126
127 virtual IndexType
128 getIndex() const;
129
130 virtual const XalanDOMString&
131 getTagName() const;
132
133 // public interfaces not inherited from XalanElement...
134
137 {
138 return m_ownerDocument;
139 }
140
141 void
143 {
144 m_parentNode = theParent;
145 }
146
147 void
149
150 void
152
153 void
155
156 void
158
159 void
161
162 void
164
165 void
167
168 void
170
171 void
173
174 void
176
177 void
179
180 void
182
183 void
185
186 void
188 {
189 m_index = theIndex;
190 }
191
192 /**
193 * Removes all of the children. Since the owner document controls the
194 * lifetime of all nodes in the document, this just sets the first child
195 * to 0.
196 */
197 void
199 {
200 m_firstChild = 0;
201 }
202
203protected:
204
205 /*
206 XalanSourceTreeElement(
207 MemoryManager& theManager,
208 const XalanSourceTreeElement& theSource,
209 bool deep = false);
210 */
212
213 // Data members...
215
216private:
217
218 // Not implemented...
220
222 operator=(const XalanSourceTreeElement& theSource);
223
224 bool
226
227
228 // Data members...
229 MemoryManager& m_memoryManager;
230
231 XalanSourceTreeDocument* m_ownerDocument;
232
233 XalanNode* m_parentNode;
234
235 XalanNode* m_previousSibling;
236
237 XalanNode* m_nextSibling;
238
239 XalanNode* m_firstChild;
240
241 IndexType m_index;
242};
243
244
245
246}
247
248
249
250#endif // !defined(XALANSOURCETREEELEMENT_HEADER_GUARD_1357924680)
#define XALAN_XALANSOURCETREE_EXPORT
#define XALAN_CPP_NAMESPACE
Xalan-C++ namespace, including major and minor version.
void appendChildNode(XalanSourceTreeComment *theChild)
void appendChildNode(XalanSourceTreeText *theChild)
virtual const XalanNodeList * getChildNodes() const
Gets a NodeList that contains all children of this node.
virtual XalanNode * getLastChild() const
Gets the last child of this node.
void setParent(XalanSourceTreeDocumentFragment *theParent)
void appendSiblingNode(XalanSourceTreeText *theSibling)
void appendSiblingNode(XalanSourceTreeProcessingInstruction *theSibling)
virtual NodeType getNodeType() const
An enum value representing the type of the underlying object.
void appendSiblingNode(XalanSourceTreeComment *theSibling)
virtual XalanNode * getFirstChild() const
Gets the first child of this node.
void setPreviousSibling(XalanSourceTreeText *thePreviousSibling)
virtual const XalanDOMString & getNodeName() const
Gets the name of this node, depending on its type.
void setPreviousSibling(XalanSourceTreeElement *thePreviousSibling)
void setPreviousSibling(XalanSourceTreeProcessingInstruction *thePreviousSibling)
virtual bool isIndexed() const
Determine if the document is node-order indexed.
void appendSiblingNode(XalanSourceTreeElement *theSibling)
XalanSourceTreeElement(MemoryManager &theManager, const XalanDOMString &theTagName, XalanSourceTreeDocument *theOwnerDocument, XalanNode *theParentNode=0, XalanNode *thePreviousSibling=0, XalanNode *theNextSibling=0, IndexType theIndex=0)
Constructor.
virtual const XalanDOMString & getNodeValue() const
Gets the value of this node, depending on its type.
virtual XalanNode * getPreviousSibling() const
Gets the node immediately preceding this node.
void appendChildNode(XalanSourceTreeProcessingInstruction *theChild)
virtual const XalanDOMString & getPrefix() const =0
Get the namespace prefix of this node, or null if it is unspecified.
virtual const XalanDOMString & getNamespaceURI() const =0
Get the namespace URI of this node, or null if it is unspecified.
virtual IndexType getIndex() const
Get the node's index.
void clearChildren()
Removes all of the children.
XalanSourceTreeDocument * getDocument() const
virtual XalanNode * getParentNode() const
Gets the parent of this node.
virtual const XalanDOMString & getLocalName() const =0
Returns the local part of the qualified name of this node.
virtual const XalanNamedNodeMap * getAttributes() const =0
Gets a NamedNodeMap containing the attributes of this node (if it is an Element) or null otherwise.
virtual XalanDocument * getOwnerDocument() const
Gets the Document object associated with this node.
void setPreviousSibling(XalanSourceTreeComment *thePreviousSibling)
static const XalanDOMString s_emptyString
void appendChildNode(XalanSourceTreeElement *theChild)
virtual XalanNode * getNextSibling() const
Gets the node immediately following this node.
void setParent(XalanSourceTreeElement *theParent)
virtual const XalanDOMString & getTagName() const
The name of the element.
bool operator==(const XalanVector< Type > &theLHS, const XalanVector< Type > &theRHS)