SAX2 extension handler for DTD declaration events.

This is an optional extension handler for SAX2 to provide more complete information about DTD declarations in an XML document. XML readers are not required to recognize this handler, and it is not part of core-only SAX2 distributions.

Note that data-related DTD declarations (unparsed entities and notations) are already reported through the DTDHandler interface.

If you are using the declaration handler together with a lexical handler, all of the events will occur between the start_dtd and the end_dtd events.

To set the DeclHandler for an XML reader, use the set_property method with the property name http://xml.org/sax/properties/declaration-handler and an object implementing this interface (or null) as the value.

Introduced properties

fun attribute_decl(element_name: String, attribute_name: String, attribute_type: String, mode: nullable String, value: nullable String)

sax :: DeclHandler :: attribute_decl

Report an attribute type declaration.
fun element_decl(name: String, model: String)

sax :: DeclHandler :: element_decl

Report an element type declaration.
fun external_entity_decl(name: String, value: String)

sax :: DeclHandler :: external_entity_decl

Report a parsed external entity declaration.
fun internal_entity_decl(name: String, value: String)

sax :: DeclHandler :: internal_entity_decl

Report an internal entity declaration.

Redefined properties

redef type SELF: DeclHandler

sax $ DeclHandler :: SELF

Type of this instance, automatically specialized in every class

All properties

fun !=(other: nullable Object): Bool

core :: Object :: !=

Have self and other different values?
fun ==(other: nullable Object): Bool

core :: Object :: ==

Have self and other the same value?
type CLASS: Class[SELF]

core :: Object :: CLASS

The type of the class of self.
type SELF: Object

core :: Object :: SELF

Type of this instance, automatically specialized in every class
fun attribute_decl(element_name: String, attribute_name: String, attribute_type: String, mode: nullable String, value: nullable String)

sax :: DeclHandler :: attribute_decl

Report an attribute type declaration.
protected fun class_factory(name: String): CLASS

core :: Object :: class_factory

Implementation used by get_class to create the specific class.
fun class_name: String

core :: Object :: class_name

The class name of the object.
fun element_decl(name: String, model: String)

sax :: DeclHandler :: element_decl

Report an element type declaration.
fun external_entity_decl(name: String, value: String)

sax :: DeclHandler :: external_entity_decl

Report a parsed external entity declaration.
fun get_class: CLASS

core :: Object :: get_class

The meta-object representing the dynamic type of self.
fun hash: Int

core :: Object :: hash

The hash code of the object.
init init

core :: Object :: init

fun inspect: String

core :: Object :: inspect

Developer readable representation of self.
protected fun inspect_head: String

core :: Object :: inspect_head

Return "CLASSNAME:#OBJECTID".
fun internal_entity_decl(name: String, value: String)

sax :: DeclHandler :: internal_entity_decl

Report an internal entity declaration.
intern fun is_same_instance(other: nullable Object): Bool

core :: Object :: is_same_instance

Return true if self and other are the same instance (i.e. same identity).
fun is_same_serialized(other: nullable Object): Bool

core :: Object :: is_same_serialized

Is self the same as other in a serialization context?
intern fun is_same_type(other: Object): Bool

core :: Object :: is_same_type

Return true if self and other have the same dynamic type.
intern fun object_id: Int

core :: Object :: object_id

An internal hash code for the object based on its identity.
fun output

core :: Object :: output

Display self on stdout (debug only).
intern fun output_class_name

core :: Object :: output_class_name

Display class name on stdout (debug only).
fun serialization_hash: Int

core :: Object :: serialization_hash

Hash value use for serialization
intern fun sys: Sys

core :: Object :: sys

Return the global sys object, the only instance of the Sys class.
abstract fun to_jvalue(env: JniEnv): JValue

core :: Object :: to_jvalue

fun to_s: String

core :: Object :: to_s

User readable representation of self.
package_diagram sax::DeclHandler DeclHandler core::Object Object sax::DeclHandler->core::Object saxophonit::SAXEventLogger SAXEventLogger saxophonit::SAXEventLogger->sax::DeclHandler

Parents

interface Object

core :: Object

The root of the class hierarchy.

Children

class SAXEventLogger

saxophonit :: SAXEventLogger

A filter that internally log events it recieves.

Class definitions

sax $ DeclHandler
# SAX2 extension handler for DTD declaration events.
#
# This is an optional extension handler for SAX2 to provide more
# complete information about DTD declarations in an XML document.
# XML readers are not required to recognize this handler, and it
# is not part of core-only SAX2 distributions.
#
# Note that data-related DTD declarations (unparsed entities and
# notations) are already reported through the `DTDHandler` interface.
#
# If you are using the declaration handler together with a lexical
# handler, all of the events will occur between the `start_dtd` and the
# `end_dtd` events.
#
# To set the `DeclHandler` for an XML reader, use the
# `set_property` method with the property name
# `http://xml.org/sax/properties/declaration-handler`
# and an object implementing this interface (or `null`) as the value.
abstract class DeclHandler
	# Report an element type declaration.
	#
	# The content model will consist of the string `EMPTY`, the
	# string `ANY`, or a parenthesised group, optionally followed
	# by an occurrence indicator. The model will be normalized so
	# that all parameter entities are fully resolved and all whitespace
	# is removed,and will include the enclosing parentheses. Other
	# normalization (such as removing redundant parentheses or
	# simplifying occurrence indicators) is at the discretion of the
	# parser.
	#
	# Parameters:
	#
	# * `name`: element type name.
	# * `model`: content model as a normalized string.
	fun element_decl(name: String, model: String) do end

	# Report an attribute type declaration.
	#
	# Only the effective (first) declaration for an attribute will
	# be reported. The type will be one of the strings `CDATA`,
	# `ID`, `IDREF`, `IDREFS`, `NMTOKEN`, `NMTOKENS`, `ENTITY`,
	# `ENTITIES`, a parenthesized token group with
	# the separator `|` and all whitespace removed, or the word
	# `NOTATION` followed by a space followed by a parenthesized
	# token group with all whitespace removed.
	#
	# The value will be the value as reported to applications,
	# appropriately normalized and with entity and character
	# references expanded.
	#
	# Parameters:
	#
	# * `element_name`: name of the associated element.
	# * `attribute_name`: name of the attribute.
	# * `attribute_type`: string representing the attribute type.
	# * `mode`: string representing the attribute defaulting mode (`#IMPLIED`,
	# `#REQUIRED`, or `#FIXED`) or `null` if none of these applies.
	# * `value`: string representing the attribute's default value,
	# or `null` if there is none.
	fun attribute_decl(element_name: String,
			attribute_name: String,
			attribute_type: String,
			mode: nullable String,
			value: nullable String) do end

	# Report an internal entity declaration.
	#
	# Only the effective (first) declaration for each entity
	# will be reported. All parameter entities in the value
	# will be expanded, but general entities will not.
	#
	# Parameters:
	#
	# * `name`: name of the entity. If it is a parameter entity, the name will
	# begin with `%`.
	# * `value`: replacement text of the entity.
	#
	# SEE: `external_entity_decl`
	#
	# SEE: `sax::DTDHandler.unparsed_entity_decl`
	fun internal_entity_decl(name: String, value: String) do end

	# Report a parsed external entity declaration.
	#
	# Only the effective (first) declaration for each entity
	# will be reported.
	#
	# Parameters:
	#
	# * `name`: name of the entity. If it is a parameter entity, the name will
	# begin with `%`.
	# * `public_id`: declared public identifier of the entity, or `null` if
	# none was declared.
	# * `system_id`: declared system identifier of the entity.
	#
	# SEE: `internal_entity_decl`
	#
	# SEE: `sax::DTDHandler.unparsed_entity_decl`
	fun external_entity_decl(name: String, value: String) do end
end
lib/sax/ext/decl_handler.nit:14,1--113,3