Eiffel Media API
Overview Cluster Class Classes Index      Previous Next      Top Features

xml.tree

Class XM_COMMENT


Direct ancestors

XM_DOCUMENT_NODE, XM_ELEMENT_NODE

Creation

Features

Invariants

indexing

description

XML comment nodes

library

Gobo Eiffel XML Library

copyright

Copyright (c) 2001, Andreas Leitner and others

license

Eiffel Forum License v2 (see forum.txt)

date

$Date: 2005/07/13 19:49:04 $

revision

$Revision: 1.19 $

class

XM_COMMENT

inherit

XM_DOCUMENT_NODE
XM_ELEMENT_NODE

create

make (a_parent: like parent; a_data: like data)

-- Create a new comment node.

require
a_parent_not_void: a_parent /= Void
a_data_not_void: a_data /= Void
ensure
parent_set: parent = a_parent
data_set: data = a_data
make_last (a_parent: XM_ELEMENT; a_data: like data)

-- Create a new comment node.
-- and add it to parent.

require
a_parent_not_void: a_parent /= Void
a_data_not_void: a_data /= Void
ensure
parent_set: parent = a_parent
in_parent: parent.last = Current
data_set: data = a_data
make_last_in_document (a_parent: XM_DOCUMENT; a_data: like data)

-- Create a new comment node,
-- and add it to parent.

require
a_parent_not_void: a_parent /= Void
a_data_not_void: a_data /= Void
ensure
parent_set: parent = a_parent
in_parent: parent.last = Current
data_set: data = a_data

feature -- Access

data: STRING

-- Comment's character data

parent: XM_COMPOSITE

-- Parent of current node;
-- Void if current node is root

-- (From XM_NODE)

feature -- Status report

is_first: BOOLEAN

-- Is this node the first in its parent's child list,
-- or the root node?

-- (From XM_NODE)

ensure
definition: Result = (is_root_node or else (parent.first = Current))
is_last: BOOLEAN

-- Is this node the last in its parent's child list,
-- or the root node?

-- (From XM_NODE)

ensure
definition: Result = (is_root_node or else (parent.last = Current))
is_root_node: BOOLEAN

-- Is current node the root node?

-- (From XM_NODE)

ensure
definition: Result = (parent = Void)
level: INTEGER

-- Depth at which current node appears relative to its root
-- (The root node has the level 1.)

-- (From XM_NODE)

ensure
root_level: is_root_node implies (Result = 1)
parent_element: XM_ELEMENT

-- Parent element.

-- (From XM_NODE)

require
not_root_node: not is_root_node
not_root_element: not parent.is_root_node
ensure
result_not_void: Result /= Void
root_node: XM_DOCUMENT

-- Root node of current node

-- (From XM_NODE)

ensure
result_not_void: Result /= Void

feature {XM_COMPOSITE} -- Element change

node_set_parent (a_parent: like parent)

-- Set parent to a_parent.

-- (From XM_NODE)

ensure
parent_set: parent = a_parent
set_parent (a_parent: like parent)

-- Set parent to a_parent.

-- (From XM_NODE)

require
a_parent_not_void: a_parent /= Void
not_root_node: not is_root_node
ensure
parent_set: parent = a_parent

feature -- Duplication

cloned_object: like Current

-- Clone of current object

-- (From KL_CLONABLE)

ensure
cloned_not_void: Result /= Void
same_type: ANY_.same_types (Result, Current)
is_equal: Result.is_equal (Current)

feature -- Setting

set_data (a_data: STRING)

-- Set comment's data.

require
a_data_not_void: a_data /= Void
ensure
set: data = a_data

feature -- Processing

process (a_processor: XM_NODE_PROCESSOR)

-- Process current node with a_processor.

-- (From XM_NODE)

require
a_processor_not_void: a_processor /= Void

invariant

data_not_void: data /= Void


-- From ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end