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

All Known Implementing Classes:
ElementValidatorHandler

public interface SchemaClientHandler

A schema client is used by applications to consume lists of authorized material regarding a candidate material.

Use case

Attributes can't be checked out of the scope of an element, because attribute lists are building contextually.

Author:
Philippe Poulard

Method Summary
 Node getCandidate()
          Return the candidate material.
 Element getHostElement()
          Return the host element.
 MasterSchema getMasterSchema()
          Return the master schema responsible of schema management for this checking.
 void processEndStep(List matchers)
          Callback method for step-end processing.
 void processList(AbstractStepAction.ItemsLists itemsLists, int occurs, int minOccurs, int maxOccurs, DataSet dataSet)
          Callback method for list processing.
 void reportError(Node node, Node candidate, QName level, QName reason, Schema schema, Node schemaRule)
          Reports an error.
 void reportError(Node node, QName level, QName reason, Schema schema, Node schemaRule)
          Reports an error.
 void reportError(ValidationError error)
          Reports an error.
 void setCandidate(Node candidate)
          Set the candidate material.
 

Method Detail

processList

void processList(AbstractStepAction.ItemsLists itemsLists,
                 int occurs,
                 int minOccurs,
                 int maxOccurs,
                 DataSet dataSet)
Callback method for list processing.

This method is called when a schema draws up lists of items to process by an implementation of this interface.

Parameters:
itemsLists - The set of items lists.
occurs - The current occurs counter.
minOccurs - The minimum occurs expected.
maxOccurs - The maximum occurs expected.
dataSet - The data set in use.

processEndStep

void processEndStep(List matchers)
Callback method for step-end processing.

This method is called when a schema ends to process a <asl:choice> or <asl:sequence> element : in this cases, this method must ensure that all matchers has been statisfied.

This is done simply by browsing each matcher and testing its mustUse() method ; matchers that must be used (and that have not been used at the end of the step) should raise an error.

Parameters:
matchers - The list of ItemMatchers to check.
See Also:
ItemMatcher

getCandidate

Node getCandidate()
Return the candidate material.

Returns:
The candidate material.

setCandidate

void setCandidate(Node candidate)
Set the candidate material.

Parameters:
candidate - The candidate material.

getHostElement

Element getHostElement()
Return the host element.

Returns:
The host element.

reportError

void reportError(Node node,
                 Node candidate,
                 QName level,
                 QName reason,
                 Schema schema,
                 Node schemaRule)
Reports an error.

Parameters:
node - The node on which the error occurs.
candidate - The candidate node that raise the error.
level - The level of error (error, warning...).
reason - The reason of the error.
schema - The schema that raise the error.
schemaRule - The schema rule in violation.

reportError

void reportError(Node node,
                 QName level,
                 QName reason,
                 Schema schema,
                 Node schemaRule)
Reports an error.

Parameters:
node - The node on which the error occurs.
level - The level of error (error, warning...).
reason - The reason of the error.
schema - The schema that raise the error.
schemaRule - The schema rule in violation.

reportError

void reportError(ValidationError error)
Reports an error.

Parameters:
error - The error to report.

getMasterSchema

MasterSchema getMasterSchema()
Return the master schema responsible of schema management for this checking.

Returns:
The non-null master schema.