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 
33 namespace XALAN_CPP_NAMESPACE {
34 
35 
36 
37 class XalanSourceTreeAttr;
38 class XalanSourceTreeComment;
39 class XalanSourceTreeDocument;
40 class XalanSourceTreeDocumentFragment;
41 class XalanSourceTreeProcessingInstruction;
42 class XalanSourceTreeText;
43 
44 
45 
47 {
48 public:
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,
64  const XalanDOMString& theTagName,
65  XalanSourceTreeDocument* theOwnerDocument,
66  XalanNode* theParentNode = 0,
67  XalanNode* thePreviousSibling = 0,
68  XalanNode* theNextSibling = 0,
69  IndexType theIndex = 0);
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*
92  getParentNode() const;
93 
94  virtual const XalanNodeList*
95  getChildNodes() const;
96 
97  virtual XalanNode*
98  getFirstChild() const;
99 
100  virtual XalanNode*
101  getLastChild() const;
102 
103  virtual XalanNode*
105 
106  virtual XalanNode*
107  getNextSibling() const;
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 
136  getDocument() const
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
187  setIndex(IndexType theIndex)
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 
203 protected:
204 
205  /*
206  XalanSourceTreeElement(
207  MemoryManager& theManager,
208  const XalanSourceTreeElement& theSource,
209  bool deep = false);
210  */
212 
213  // Data members...
215 
216 private:
217 
218  // Not implemented...
220 
222  operator=(const XalanSourceTreeElement& theSource);
223 
224  bool
225  operator==(const XalanSourceTreeElement& theRHS) const;
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)
xalanc::XalanSourceTreeElement::getDocument
XalanSourceTreeDocument * getDocument() const
Definition: XalanSourceTreeElement.hpp:136
xalanc::XalanSourceTreeDocumentFragment
Definition: XalanSourceTreeDocumentFragment.hpp:50
xalanc::XalanSourceTreeElement::getLocalName
virtual const XalanDOMString & getLocalName() const =0
Returns the local part of the qualified name of this node.
XALAN_CPP_NAMESPACE
#define XALAN_CPP_NAMESPACE
Xalan-C++ namespace, including major and minor version.
Definition: XalanVersion.hpp:76
xalanc::XalanSourceTreeElement::appendSiblingNode
void appendSiblingNode(XalanSourceTreeElement *theSibling)
xalanc::XalanSourceTreeElement::getIndex
virtual IndexType getIndex() const
Get the node's index.
xalanc::XalanNode
Definition: XalanNode.hpp:39
xalanc::XalanSourceTreeElement::getPrefix
virtual const XalanDOMString & getPrefix() const =0
Get the namespace prefix of this node, or null if it is unspecified.
XalanElement.hpp
xalanc::XalanSourceTreeElement::appendSiblingNode
void appendSiblingNode(XalanSourceTreeProcessingInstruction *theSibling)
xalanc::XalanNode::NodeType
NodeType
Definition: XalanNode.hpp:48
xalanc::XalanSourceTreeElement::XalanSourceTreeElement
XalanSourceTreeElement(MemoryManager &theManager, const XalanDOMString &theTagName, XalanSourceTreeDocument *theOwnerDocument, XalanNode *theParentNode=0, XalanNode *thePreviousSibling=0, XalanNode *theNextSibling=0, IndexType theIndex=0)
Constructor.
XalanDOMString.hpp
xalanc::XalanSourceTreeElement::setParent
void setParent(XalanSourceTreeElement *theParent)
Definition: XalanSourceTreeElement.hpp:142
xalanc::XalanSourceTreeElement::getLastChild
virtual XalanNode * getLastChild() const
Gets the last child of this node.
xalanc::XalanSourceTreeElement::getAttributes
virtual const XalanNamedNodeMap * getAttributes() const =0
Gets a NamedNodeMap containing the attributes of this node (if it is an Element) or null otherwise.
xalanc::XalanDocument
Definition: XalanDocument.hpp:37
xalanc::XalanSourceTreeElement::getNodeType
virtual NodeType getNodeType() const
An enum value representing the type of the underlying object.
xalanc::XalanSourceTreeElement::getOwnerDocument
virtual XalanDocument * getOwnerDocument() const
Gets the Document object associated with this node.
xalanc::XalanSourceTreeElement::setPreviousSibling
void setPreviousSibling(XalanSourceTreeComment *thePreviousSibling)
xalanc::XalanSourceTreeElement::getFirstChild
virtual XalanNode * getFirstChild() const
Gets the first child of this node.
xalanc::operator==
bool operator==(const XalanVector< Type > &theLHS, const XalanVector< Type > &theRHS)
Definition: XalanVector.hpp:1118
xalanc::XalanSourceTreeElement::~XalanSourceTreeElement
virtual ~XalanSourceTreeElement()
xalanc::XalanSourceTreeElement::m_tagName
const XalanDOMString & m_tagName
Definition: XalanSourceTreeElement.hpp:214
xalanc::XalanSourceTreeElement::appendSiblingNode
void appendSiblingNode(XalanSourceTreeComment *theSibling)
xalanc::XalanSourceTreeElement::isIndexed
virtual bool isIndexed() const
Determine if the document is node-order indexed.
xalanc::XalanSourceTreeElement::getNodeValue
virtual const XalanDOMString & getNodeValue() const
Gets the value of this node, depending on its type.
xalanc::XalanSourceTreeElement::clearChildren
void clearChildren()
Removes all of the children.
Definition: XalanSourceTreeElement.hpp:198
xalanc::XalanSourceTreeElement::setParent
void setParent(XalanSourceTreeDocumentFragment *theParent)
xalanc::XalanSourceTreeElement::appendSiblingNode
void appendSiblingNode(XalanSourceTreeText *theSibling)
xalanc::XalanSourceTreeComment
Definition: XalanSourceTreeComment.hpp:48
xalanc::XalanSourceTreeElement::setPreviousSibling
void setPreviousSibling(XalanSourceTreeElement *thePreviousSibling)
xalanc::XalanSourceTreeElement::getMemoryManager
MemoryManager & getMemoryManager()
Definition: XalanSourceTreeElement.hpp:75
xalanc::XalanSourceTreeElement::appendChildNode
void appendChildNode(XalanSourceTreeElement *theChild)
xalanc::XalanNodeList
Definition: XalanNodeList.hpp:37
xalanc::XalanSourceTreeElement::getTagName
virtual const XalanDOMString & getTagName() const
The name of the element.
XalanSourceTreeDefinitions.hpp
xalanc::XalanSourceTreeElement::getParentNode
virtual XalanNode * getParentNode() const
Gets the parent of this node.
xalanc::XalanSourceTreeElement::getChildNodes
virtual const XalanNodeList * getChildNodes() const
Gets a NodeList that contains all children of this node.
xalanc::XalanSourceTreeElement::appendChildNode
void appendChildNode(XalanSourceTreeProcessingInstruction *theChild)
xalanc::XalanSourceTreeElement::s_emptyString
static const XalanDOMString s_emptyString
Definition: XalanSourceTreeElement.hpp:211
xalanc::XalanSourceTreeElement::getNodeName
virtual const XalanDOMString & getNodeName() const
Gets the name of this node, depending on its type.
xalanc::XalanSourceTreeElement::appendChildNode
void appendChildNode(XalanSourceTreeComment *theChild)
XalanNamedNodeMap.hpp
xalanc::XalanSourceTreeElement::getNamespaceURI
virtual const XalanDOMString & getNamespaceURI() const =0
Get the namespace URI of this node, or null if it is unspecified.
xalanc::XalanSourceTreeElement::setPreviousSibling
void setPreviousSibling(XalanSourceTreeText *thePreviousSibling)
xalanc::XalanSourceTreeElement::getNextSibling
virtual XalanNode * getNextSibling() const
Gets the node immediately following this node.
xalanc::XalanElement
Definition: XalanElement.hpp:45
xalanc::XalanNamedNodeMap
Definition: XalanNamedNodeMap.hpp:37
xalanc::XalanSourceTreeText
Definition: XalanSourceTreeText.hpp:47
XALAN_XALANSOURCETREE_EXPORT
#define XALAN_XALANSOURCETREE_EXPORT
Definition: XalanSourceTreeDefinitions.hpp:35
xalanc::XalanSourceTreeElement
Definition: XalanSourceTreeElement.hpp:47
xalanc::XalanSourceTreeElement::setIndex
void setIndex(IndexType theIndex)
Definition: XalanSourceTreeElement.hpp:187
xalanc::XalanDOMString
Definition: XalanDOMString.hpp:46
xalanc::XalanSourceTreeDocument
Definition: XalanSourceTreeDocument.hpp:79
xalanc::XalanSourceTreeElement::setPreviousSibling
void setPreviousSibling(XalanSourceTreeProcessingInstruction *thePreviousSibling)
xalanc::XalanSourceTreeElement::appendChildNode
void appendChildNode(XalanSourceTreeText *theChild)
xalanc::XalanSourceTreeElement::getPreviousSibling
virtual XalanNode * getPreviousSibling() const
Gets the node immediately preceding this node.
xalanc::XalanSourceTreeProcessingInstruction
Definition: XalanSourceTreeProcessingInstruction.hpp:48