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

xml.event

Class XM_STOP_ON_ERROR_FILTER


Direct ancestors

XM_CALLBACKS_FILTER

Known direct descendants

XM_PARSER_STOP_ON_ERROR_FILTER

Creation

Features

Invariants

indexing

description

Stop forwarding events on first error

library

Gobo Eiffel XML Library

copyright

Copyright (c) 2002, Eric Bezault and others

license

Eiffel Forum License v2 (see forum.txt)

date

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

revision

$Revision: 1.6 $

class

XM_STOP_ON_ERROR_FILTER

inherit

XM_CALLBACKS_FILTER

create

set_next (a_callbacks: like callbacks)

-- Set callbacks to a_callbacks.

-- (From XM_CALLBACKS_SOURCE)

require
a_callback_not_void: a_callback /= Void
make_null

-- Next is null processor.

-- (From XM_CALLBACKS_FILTER)

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 -- Document

on_finish

-- Called when parsing finished.

-- (From XM_CALLBACKS)

on_start

-- Called when parsing starts.

-- (From XM_CALLBACKS)

feature -- Errors

on_error (a_message: STRING)

-- Event producer detected an error.
-- Default: forward event to 'next'.

-- (From XM_CALLBACKS)

require
not_void: a_message /= Void

feature -- Meta

on_comment (a_content: STRING)

-- Processing comment.
-- Atomic: single comment produces single event
-- Default: forward event to 'next'.

-- (From XM_CALLBACKS)

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

-- Processing instruction.
-- Default: forward event to 'next'.

-- (From XM_CALLBACKS)

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

feature -- Tag

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

-- Attribute.
-- Default: forward event to 'next'.

-- (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_end_tag (a_namespace: STRING; a_prefix: STRING; a_local_part: STRING)

-- End tag.
-- Default: forward event to 'next'.

-- (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_tag (a_namespace: STRING; a_prefix: STRING; a_local_part: STRING)

-- Start of start tag.
-- Default: forward event to 'next'.

-- (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_tag_finish

-- End of start tag.
-- Default: forward event to 'next'.

-- (From XM_CALLBACKS)

feature -- Content

on_content (a_content: STRING)

-- Text content.
-- Default: forward event to 'next'.

-- (From XM_CALLBACKS)

require
not_void: a_content /= Void
not_empty: a_content.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 {NONE} -- Document

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 -- Status

has_error: BOOLEAN

-- Has an error occurred?

last_error: STRING

-- Error message

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

last_error_not_void: has_error implies last_error /= Void

next_not_void: next /= Void

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

end