org.inria.ns.reflex.processor.catalog
Class ResourceAction
java.lang.Object
org.inria.ns.reflex.processor.core.AbstractAction
org.inria.ns.reflex.processor.catalog.GroupAction
org.inria.ns.reflex.processor.catalog.AbstractIdentifierAction
org.inria.ns.reflex.processor.catalog.ResourceAction
- All Implemented Interfaces:
- CatalogEntry, Executable, Presentable, NamespaceContextFactory
public class ResourceAction
- extends AbstractIdentifierAction
- implements CatalogEntry
At runtime, the <cat:resource> element is used to test if an
identifier matches a resource identifier.
See $cat:resource and $cat:selector.
- Author:
- Philippe Poulard
- See Also:
AbstractIdentifierAction
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 |
ResourceAction
public ResourceAction(QExpression name,
Expression alternate,
QName selector,
Element element,
AbstractAction parent)
throws XPathException
- Creates a new instance of
ResourceAction
.
- Parameters:
name
- The name of the resource to match.alternate
- The alternate name of the resource.selector
- The selector.element
- The element from which the action has been unmarshalled. Used
for namespace prefix resolution when performing XPath
expressions.parent
- The action depending from.
- Throws:
XPathException
unmarshal
public static AbstractAction unmarshal(AbstractAction parent,
Element element)
throws XMLException
- XML unmarshaller for
ResourceAction
.
- Parameters:
parent
- The action depending from.element
- The XML element to unmarshall.
- Returns:
- The
ResourceAction
created.
- Throws:
UnmarshalException
- When the element and its content is not those expected.
XMLException
isMatching
public boolean isMatching(DataSet dataSet)
throws ExecutionException
- Check if a key matches this action.
- Specified by:
isMatching
in interface CatalogEntry
- Parameters:
dataSet
- The set of datas used when the action is running.
- Returns:
- true if the key matches the identifier of this action,
false otherwise.
- Throws:
ExecutionException
- If the candidate catalog key can't be checked.- See Also:
CatalogEntry.isMatching(org.inria.ns.reflex.processor.DataSet)
feedContext
public void feedContext(DataSet dataSet,
Object alternate)
throws XPathException,
ExecutionException
- Feeds the context with an alternate resource with no additional
process, that is to say any Object should replace the candidate.
- Specified by:
feedContext
in interface CatalogEntry
- Parameters:
dataSet
- The set of datas used when the action is running.alternate
- The alternate resource that will feed the context as-is.
- Throws:
XPathException
ExecutionException
- See Also:
CatalogEntry.feedContext(DataSet, Object)