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

xml.xml_xpointer.xpointer_event

Class XM_XPOINTER_EVENT_FILTER


Direct ancestors

XM_DTD_CALLBACKS_FILTER, XM_CALLBACKS_FILTER, XM_MARKUP_CONSTANTS, KL_IMPORTED_STRING_ROUTINES, UC_SHARED_STRING_EQUALITY_TESTER, UT_SHARED_MEDIA_TYPE_EQUALITY_TESTER

Creation

Features

Invariants

indexing

description

Objects that filter an event stream according to an XPointer

library

Gobo Eiffel XML Library

copyright

Copyright (c) 2005, Colin Adams and others

license

Eiffel Forum License v2 (see forum.txt)

date

$Date: 2005/07/13 19:51:48 $

revision

$Revision: 1.6 $

class

XM_XPOINTER_EVENT_FILTER

inherit

XM_DTD_CALLBACKS_FILTER
XM_CALLBACKS_FILTER
XM_MARKUP_CONSTANTS
KL_IMPORTED_STRING_ROUTINES
UC_SHARED_STRING_EQUALITY_TESTER
UT_SHARED_MEDIA_TYPE_EQUALITY_TESTER

create

make (an_xpointer: STRING; a_media_type: UT_MEDIA_TYPE; a_resolver: XM_RESOLVER_MEDIA_TYPE; a_callback: XM_CALLBACKS; a_dtd_callback: XM_DTD_CALLBACKS)

-- Establish invariant.

require
xpointer_not_void: an_xpointer /= Void
callbacks_not_void: a_callback /= Void
dtd_callbacks_not_void: a_dtd_callback /= Void
resolver_not_void: a_resolver /= Void
ensure
resolver_set: resolver = a_resolver
default_media_type_set: default_media_type = a_media_type

feature -- Access

string_: KL_STRING_ROUTINES

-- Routines that ought to be in class STRING

-- (From KL_IMPORTED_STRING_ROUTINES)

ensure
string_routines_not_void: Result /= Void
unacceptable_media_type: STRING

-- Unaaceptable media type error message

callbacks: XM_CALLBACKS

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

-- (From XM_FORWARD_CALLBACKS)

dtd_callbacks: XM_DTD_CALLBACKS

-- Receiver for forwarded events

-- (From XM_DTD_CALLBACKS_FILTER)

media_type: UT_MEDIA_TYPE

-- Media type of document entity

media_type_tester: UT_MEDIA_TYPE_EQUALITY_TESTER

-- Media type equality tester

-- (From UT_SHARED_MEDIA_TYPE_EQUALITY_TESTER)

ensure
media_type_tester_not_void: Result /= Void
set_next_dtd (a_next: like next)

-- Set receiver of forwarded events.

-- (From XM_DTD_CALLBACKS_SOURCE)

require
a_callback_not_void: a_callback /= Void
string_equality_tester: UC_STRING_EQUALITY_TESTER

-- String equality tester

-- (From UC_SHARED_STRING_EQUALITY_TESTER)

ensure
string_equality_tester_not_void: Result /= Void

feature -- Status report

any_types_added: BOOLEAN

-- Have any acceptable media types been declared?

require
filtering: is_filtering
are_media_type_ignored: BOOLEAN

-- Do we ignore the media type?

generic_xml_types_allowed: BOOLEAN

-- Are media types of form "application/*+xml" allowed?

has_media_type (a_media_type: UT_MEDIA_TYPE): BOOLEAN

-- Is a_media_type acceptable for fragment processing?

require
filtering: is_filtering
media_type_not_void: a_media_type /= Void
is_filtering: BOOLEAN

-- Are we actually doing any XPointer filtering?

feature -- Status setting

add_media_type (a_media_type: UT_MEDIA_TYPE)

-- Add a_media_type to list of acceptable media types

require
filtering: is_filtering
media_type_not_void: a_media_type /= Void
not_previously_added: not has_media_type (a_media_type)
ensure
media_type_added: has_media_type (a_media_type)
add_standard_media_types

-- Add standard XPointer media types to list of acceptable media types

require
filtering: is_filtering
no_acceptable_types: not any_types_added
allow_generic_xml_types (yes_or_no: BOOLEAN)

-- Allow or disallow all media types of form "application/*+xml"

require
filtering: is_filtering
ensure
generic_types_set: generic_xml_types_allowed = yes_or_no
ignore_media_types

-- Ignore media_type.

require
filtering: is_filtering
ensure
media_types_ignored: are_media_type_ignored = True
set_no_filtering

-- Change this into a pure pass-through filter

ensure
not_filtering: not is_filtering
set_xpointer (an_xpointer: STRING)

-- Use an_xpointer as the XPointer

require
xpointer_not_void: an_xpointer /= Void
ensure
filtering: is_filtering
acceptable_media_types_table_created: acceptable_media_types /= Void
media_types_not_ignored: are_media_type_ignored = False

feature -- Document type definition callbacks

on_attribute_declaration (an_element_name, a_name: STRING; a_model: XM_DTD_ATTRIBUTE_CONTENT)

-- Attribute declaration, one event per attribute.

-- (From XM_DTD_CALLBACKS)

require
an_element_name_not_void: an_element_name /= Void
a_name_not_void: a_name /= Void
a_model_not_void: a_model /= Void
on_doctype (a_name: STRING; an_id: XM_DTD_EXTERNAL_ID; has_internal_subset: BOOLEAN)

-- Document type declaration.

-- (From XM_DTD_CALLBACKS)

require
a_name_not_void: a_name /= Void
on_dtd_comment (a_content: STRING)

-- Comment.

-- (From XM_DTD_CALLBACKS)

require
a_content_not_void: a_content /= Void
on_dtd_end

-- End of DTD.

-- (From XM_DTD_CALLBACKS)

on_dtd_processing_instruction (a_name, a_content: STRING)

-- PI.

-- (From XM_DTD_CALLBACKS)

require
name_not_void: a_name /= Void
content_not_void: a_content /= Void
on_element_declaration (a_name: STRING; a_model: XM_DTD_ELEMENT_CONTENT)

-- (From XM_DTD_CALLBACKS)

require
a_name_not_void: a_name /= Void
a_model_not_void: a_model /= Void
on_entity_declaration (entity_name: STRING; is_parameter: BOOLEAN; value: STRING;an_id: XM_DTD_EXTERNAL_ID; notation_name: STRING)

-- Entity declaration.

-- (From XM_DTD_CALLBACKS)

require
entity_name_not_void: entity_name /= Void
on_notation_declaration (notation_name: STRING; an_id: XM_DTD_EXTERNAL_ID)

-- Notation declaration.

-- (From XM_DTD_CALLBACKS)

require
notation_name_not_void: notation_name /= Void
id_not_void: an_id /= Void

feature -- Document

on_finish

-- Called when parsing finished

-- (From XM_CALLBACKS)

on_start

-- Called when parsing starts.

-- (From XM_CALLBACKS)

feature -- Meta

on_comment (a_content: STRING)

-- Processing a comment.

-- (From XM_CALLBACKS)

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

-- Processing instruction.

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

-- Start of attribute.

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

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

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

-- (From XM_CALLBACKS)

feature -- Content

on_content (a_content: STRING)

-- Text content.

-- (From XM_CALLBACKS)

require
not_void: a_content /= Void
not_empty: a_content.count >= 0

feature -- Setting

set_next_filter (a_callbacks: like callbacks)

-- Set callbacks to a_callbacks.

-- (From XM_CALLBACKS_SOURCE)

require
a_callback_not_void: a_callback /= 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_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)

feature -- Constants

amp_char: CHARACTER
amp_entity: STRING
comment_end: STRING
cr_char: CHARACTER
emptytag_end: STRING
eq_s: STRING
etag_end: STRING
etag_start: STRING
gt_char: CHARACTER
gt_entity: STRING
lf_char: CHARACTER
lf_s: STRING
lt_char: CHARACTER
lt_entity: STRING
pi_end: STRING
pi_start: STRING
quot_char: CHARACTER
quot_entity: STRING
quot_s: STRING
space_char: CHARACTER
space_s: STRING
stag_end: STRING
stag_start: STRING
tab_char: CHARACTER
xml_base: STRING
xml_id: STRING
xml_lang: STRING
xml_prefix: STRING
xml_space: STRING
xmlns: STRING

invariant

resolver_not_void: resolver /= Void
xpointer_error: is_error implies error_message /= Void
attribute_types_not_void: attribute_types /= Void
acceptable_media_types: is_filtering implies acceptable_media_types /= Void and then acceptable_media_types.equality_tester = media_type_tester

next_not_void: next /= Void

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

next_not_void: next /= Void

end