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

xml.event

Class XM_INDENT_PRETTY_PRINT_FILTER


Direct ancestors

XM_PRETTY_PRINT_FILTER

Creation

Features

Invariants

indexing

descrition

Pretty print filter with indentation; for tags not separated by content (see XM_WHITESPACE_NORMALIZER)

library

Gobo Eiffel XML Library

copyright

Copyright (c) 2003, Eric Bezault and others

license

Eiffel Forum License v2 (see forum.txt)

date

$Date: 2005/07/13 19:45:03 $

revision

$Revision: 1.3 $

class

XM_INDENT_PRETTY_PRINT_FILTER

inherit

XM_PRETTY_PRINT_FILTER

create

make_null

-- Next is null processor.

-- (From XM_CALLBACKS_FILTER)

set_next (a_callbacks: like callbacks)

-- Set callbacks to a_callbacks.

-- (From XM_CALLBACKS_SOURCE)

require
a_callback_not_void: a_callback /= Void

feature -- Access

: XM_CALLBACKS

-- Callbacks event interface to which events are forwarded;
-- If void, a null callback is created on startup.

-- (From XM_FORWARD_CALLBACKS)

feature -- Events

on_attribute (a_namespace: STRING; a_prefix: STRING; a_local_part: STRING; a_value: STRING)

-- Handle xml:space.

-- (From XM_CALLBACKS)

require
unresolved_namespace_is_void: has_resolved_namespaces implies a_namespace /= Void
local_part: is_local_part (a_local_part)
a_value_not_void: a_value /= Void
on_content (a_content: STRING)

-- Test if we had a content event.

-- (From XM_CALLBACKS)

require
not_void: a_content /= Void
not_empty: a_content.count >= 0
on_end_tag (a_namespace: STRING; a_prefix: STRING; a_local_part: STRING)

-- End tag.

-- (From XM_CALLBACKS)

require
unresolved_namespace_is_void: has_resolved_namespaces implies a_namespace /= Void
local_part: is_local_part (a_local_part)
on_start

-- Start of document.

-- (From XM_CALLBACKS)

ensure then
space_preserved_not_void: space_preserved /= Void
indent_not_void: indent /= Void
on_start_tag (a_namespace: STRING; a_prefix: STRING; a_local_part: STRING)

-- Start of start tag.

-- (From XM_CALLBACKS)

require
unresolved_namespace_is_void: has_resolved_namespaces implies a_namespace /= Void
local_part: is_local_part (a_local_part)

feature -- Indent

default_indent: STRING

-- Default indent.

indent: STRING

-- Indentation string.

set_indent (an_indent: STRING)

-- Set indent string.

require
an_indent_not_void: an_indent /= Void

feature -- Output, interface to descendants

output (a_string: STRING)

-- Output string.
-- All output from descendants should go through this for
-- convenient redefinition.

-- (From XM_OUTPUT)

require
a_string_not_void: a_string /= Void

feature -- Output

last_output: STRING

-- Last output;
-- May be void if standard output or stream is used.

-- (From XM_OUTPUT)

set_output_standard

-- Set output to standard output (Default).

-- (From XM_OUTPUT)

set_output_standard_error

-- Set output to standard error.

-- (From XM_OUTPUT)

set_output_stream (a_stream: like output_stream)

-- Set output to stream.

-- (From XM_OUTPUT)

require
a_stream_not_void: a_stream /= Void
set_output_string (a_string: like last_output)

-- Initialize output to given string,
-- the result must still be collected from
-- last_output, which may be another string.

-- (From XM_OUTPUT)

require
a_string_not_void: a_string /= Void
set_output_to_string

-- Set output to new string.

-- (From XM_OUTPUT)

ensure
last_output_not_void: last_output /= Void
last_output_empty: last_output.count = 0

feature -- Setting

set_next (a_callbacks: like callbacks)

-- Set callbacks to a_callbacks.

-- (From XM_CALLBACKS_SOURCE)

require
a_callback_not_void: a_callback /= Void

feature -- Tag

on_start_tag_finish

-- Print end of start tag.

-- (From XM_CALLBACKS)

feature -- Meta

on_comment (a_content: STRING)

-- Print comment.

-- (From XM_CALLBACKS)

require
a_content_not_void: a_content /= Void
on_processing_instruction (a_name: STRING; a_content: STRING)

-- Print processing instruction.

-- (From XM_CALLBACKS)

require
name_not_void: a_name /= Void
content_not_void: a_content /= Void

feature {NONE} -- Errors

on_error (a_message: STRING)

-- Event producer detected an error.

-- (From XM_CALLBACKS)

require
not_void: a_message /= Void

feature {NONE} -- Document

on_finish

-- Forward finish.

-- (From XM_CALLBACKS)

on_xml_declaration (a_version: STRING; an_encoding: STRING; a_standalone: BOOLEAN)

-- XML declaration.

-- (From XM_CALLBACKS)

require
a_version_not_void: a_version /= Void
a_version_not_empty: a_version.count > 0

feature -- Assertion

has_resolved_namespaces: BOOLEAN

-- Does this callback event consumer expect resolved
-- namespaces?
-- If True, it must be located downstream of a filter
-- or source producing resolved namespaces such
-- as XM_NAMESPACE_RESOLVER.

-- (From XM_CALLBACKS)

feature -- Support

has_namespace (a: STRING): BOOLEAN

-- Is namespace resolved?

-- (From XM_CALLBACKS)

has_prefix (a: STRING): BOOLEAN

-- Is prefix in use?

-- (From XM_CALLBACKS)

is_local_part (a: STRING): BOOLEAN

-- Is this a valid local part string?

-- (From XM_CALLBACKS)

ensure
definition: Result = (a /= Void and then a.count > 0)

invariant


next_not_void: next /= Void

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

end