org.inria.ns.reflex.processor.asl
Interface ElementDefinition

All Known Implementing Classes:
ElementDefinitionAction

public interface ElementDefinition

The definition of an element. To process an element definition, use callbackSchemaClientHandler() that will validate a candidate element or supply the list of authorized things to an editor, for example. The schema client handler holds the element that hosts the candidate child node to check regarding this definition.

Usage

When validating, all the child nodes have to be checked one by one. If the invokation consist on drawing up a list of authorized materiel on behalf of an editor, for example, the child nodes before the insertion point should be validated before supplying the list to the editor.

Author:
Philippe Poulard

Method Summary
 void callbackSchemaClientHandler(SchemaClientHandler handler)
          Invoke this element definition.
 QName getElementName()
          Return the name of the element.
 String getNamespaceURI()
          Return the namespace URI of the element.
 Schema getOwnerSchema()
          The schema instance that owns this definition.
 boolean isFallbackDefinition()
          Indicates if this definition is a fallback definition.
 boolean match(Element candidateElement)
          Indicates if this definition matches the given candidate element.
 

Method Detail

isFallbackDefinition

boolean isFallbackDefinition()
Indicates if this definition is a fallback definition.

Returns:
true if this definition is a fallback definition, false otherwise.

getElementName

QName getElementName()
Return the name of the element.

Returns:
The name of the element.

getNamespaceURI

String getNamespaceURI()
Return the namespace URI of the element.

Returns:
The namespace URI of the element.

match

boolean match(Element candidateElement)
Indicates if this definition matches the given candidate element. This method generally returns true, because an element definition matches an element when their name matches ; owever, other matching conditions could be added here, for example when an additional context matching is expected, such as a pattern.

Parameters:
candidateElement - The element that was used to retrieve this definition.
Returns:
true if this definition matches the element givent, false otherwise.

getOwnerSchema

Schema getOwnerSchema()
The schema instance that owns this definition.

Returns:
The schema instance that owns this definition.

callbackSchemaClientHandler

void callbackSchemaClientHandler(SchemaClientHandler handler)
Invoke this element definition. Each time a set of lists is drawn up, the schema client handler will be invoked to process them.

Parameters:
handler - The schema client handler that will receive the callback of this element definition.