org.inria.ns.reflex.processor.asl
Class ElementDefinitionAction

java.lang.Object
  extended by org.inria.ns.reflex.processor.core.AbstractAction
      extended by org.inria.ns.reflex.processor.asl.AbstractStepAction
          extended by org.inria.ns.reflex.processor.asl.ElementDefinitionAction
All Implemented Interfaces:
ElementDefinition, Executable, Identifiable, Presentable, NamespaceContextFactory

public class ElementDefinitionAction
extends AbstractStepAction
implements ElementDefinition

The <asl:element> element defines an element.

Author:
Philippe Poulard

Nested Class Summary
 
Nested classes/interfaces inherited from class org.inria.ns.reflex.processor.asl.AbstractStepAction
AbstractStepAction.ItemsLists
 
Nested classes/interfaces inherited from class org.inria.ns.reflex.processor.core.AbstractAction
AbstractAction.ParameterAdapter, AbstractAction.UselessAction
 
Field Summary
 
Fields inherited from class org.inria.ns.reflex.processor.asl.AbstractStepAction
STEP_USED_BUBBLE_MESSAGE
 
Fields inherited from class org.inria.ns.reflex.processor.core.AbstractAction
actions, parent, processorInstance
 
Constructor Summary
ElementDefinitionAction(QName name, int isRoot, Element element, AbstractAction parent)
          Creates a new instance of ElementDefinitionAction.
ElementDefinitionAction(String namespaceURI, int isRoot, Element element, AbstractAction parent)
          Creates a new instance of ElementDefinitionAction used as a fallback definition.
 
Method Summary
 void callbackSchemaClientHandler(SchemaClientHandler handler)
          Invoke this element definition.
 QName getElementName()
          Return the name of the element.
 String getNamespaceURI()
          Return the name of the namespace URI.
 Schema getOwnerSchema()
          The schema instance that owns this definition.
 boolean isFallbackDefinition()
          Indicates if this definition is a fallback definition.
 boolean match(Element candidateElement)
          This definition matches the candidate element.
 void runAction(DataSet dataSet)
          Compute the element definition.
 
Methods inherited from class org.inria.ns.reflex.processor.asl.AbstractStepAction
computeOccurs, getId, getMaxOccurs, getMinOccurs, invokeHandler, stableRun, unstableRun
 
Methods inherited from class org.inria.ns.reflex.processor.core.AbstractAction
addAction, addFallbackAction, createContext, getCanonicalPath, getFallbackAction, getLocalFallbackAction, getLogger, getNamespaceContext, getNode, getParent, recover, recover, removeFallbackAction, reorganize, run, runActions, toPrettyString, toPrettyString, toString, unmarshal
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ElementDefinitionAction

public ElementDefinitionAction(QName name,
                               int isRoot,
                               Element element,
                               AbstractAction parent)
Creates a new instance of ElementDefinitionAction.

Parameters:
name - The name of the element definition.
isRoot - Indicates if the root must be always root, may be sometimes root, or must be never root.
element - The element from which the action has been unmarshalled. Used for namespace prefix resolution when performing XPath expressions.
parent - The action depending from.

ElementDefinitionAction

public ElementDefinitionAction(String namespaceURI,
                               int isRoot,
                               Element element,
                               AbstractAction parent)
Creates a new instance of ElementDefinitionAction used as a fallback definition.

Parameters:
namespaceURI - The namespace URI of the element definition.
isRoot - Indicates if the root must be always root, may be sometimes root, or must be never root.
element - The element from which the action has been unmarshalled. Used for namespace prefix resolution when performing XPath expressions.
parent - The action depending from.
Method Detail

isFallbackDefinition

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

Specified by:
isFallbackDefinition in interface ElementDefinition
Returns:
true if this definition is a fallback definition, false otherwise.

runAction

public void runAction(DataSet dataSet)
               throws ExecutionException,
                      XPathException
Compute the element definition.

Overrides:
runAction in class AbstractStepAction
Parameters:
dataSet - The set of datas used when the action is running.
Throws:
ExecutionException - If the action can't be performed.
XPathException

getElementName

public QName getElementName()
Return the name of the element.

Specified by:
getElementName in interface ElementDefinition
Returns:
The name of the element.

getNamespaceURI

public String getNamespaceURI()
Return the name of the namespace URI.

Specified by:
getNamespaceURI in interface ElementDefinition
Returns:
The name of the namespace URI.

match

public boolean match(Element candidateElement)
This definition matches the candidate element. If a pattern is used, it should be tested against the candidate element.

Specified by:
match in interface ElementDefinition
Parameters:
candidateElement - The element that has the same name than this definition.
Returns:
true
See Also:
ElementDefinition.match(org.w3c.dom.Element)

getOwnerSchema

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

Specified by:
getOwnerSchema in interface ElementDefinition
Returns:
The schema instance that owns this definition.

callbackSchemaClientHandler

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

Specified by:
callbackSchemaClientHandler in interface ElementDefinition
Parameters:
handler - The schema client handler that will receive the callback of this element definition.