org.inria.ns.reflex.processor.catalog
Class CatalogAction

java.lang.Object
  extended by org.inria.ns.reflex.processor.core.AbstractAction
      extended by org.inria.ns.reflex.processor.catalog.GroupAction
          extended by org.inria.ns.reflex.processor.catalog.CatalogAction
All Implemented Interfaces:
Catalog, Executable, Localizable, Presentable, NamespaceContextFactory

public class CatalogAction
extends GroupAction
implements Catalog

The <oasis:catalog> and <cat:catalog> elements are the root elements of an Oasis Catalog or an Active Catalog.

Author:
Philippe Poulard

Nested Class Summary
 
Nested classes/interfaces inherited from class org.inria.ns.reflex.processor.core.AbstractAction
AbstractAction.ParameterAdapter, AbstractAction.UselessAction
 
Field Summary
static long t
           
 
Fields inherited from class org.inria.ns.reflex.processor.core.AbstractAction
actions, parent, processorInstance
 
Constructor Summary
CatalogAction(Element element, AbstractAction parent)
          Creates a new instance of CatalogAction.
 
Method Summary
 XFile getLocation()
          Return the location of this catalog.
 boolean isLocalizable()
          Indicates whether this instance is localizable or not.
 Resource lookupResources(CatalogKey key)
          Find the resource that has the given key in this catalog.
 void runAction(DataSet dataSet)
          Set this catalog to the current object.
 void setLocation(XFile location)
          Set a base URI for this catalog.
static AbstractAction unmarshal(AbstractAction parent, Element element)
          XML unmarshaller for CatalogAction.
 
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
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

t

public static long t
Constructor Detail

CatalogAction

public CatalogAction(Element element,
                     AbstractAction parent)
              throws XPathException
Creates a new instance of CatalogAction.

Parameters:
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
Method Detail

unmarshal

public static AbstractAction unmarshal(AbstractAction parent,
                                       Element element)
                                throws XMLException
XML unmarshaller for CatalogAction.

Parameters:
parent - The action depending from.
element - The XML element to unmarshall.
Returns:
The CatalogAction created.
Throws:
UnmarshalException - When the element and its content is not those expected.
XMLException

runAction

public void runAction(DataSet dataSet)
               throws ExecutionException,
                      XPathException
Set this catalog to the current object.

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

lookupResources

public Resource lookupResources(CatalogKey key)
Find the resource that has the given key in this catalog.

Specified by:
lookupResources in interface Catalog
Parameters:
key - The key of the resource to find.
Returns:
The resource found.
See Also:
Catalog.lookupResources(CatalogKey)

getLocation

public XFile getLocation()
                  throws UnlocalizableException
Return the location of this catalog. This method is involved to resolve alternate relative URIs.

Specified by:
getLocation in interface Localizable
Returns:
The non-null path to this catalog, which is those of the underlying Active Sheet.
Throws:
UnlocalizableException - If this catalog can't be localized.
See Also:
ProcessorInstance.getLocation(), Localizable.getLocation()

isLocalizable

public boolean isLocalizable()
Indicates whether this instance is localizable or not.

Specified by:
isLocalizable in interface Localizable
Returns:
true if this instance is localizable, false otherwise.
See Also:
Localizable.isLocalizable()

setLocation

public void setLocation(XFile location)
                 throws UnlocalizableException
Set a base URI for this catalog.

Specified by:
setLocation in interface Localizable
Parameters:
location - The URI where this catalog is located.
Throws:
UnlocalizableException - If a base URI is irrelevant for this instance.
See Also:
ProcessorInstance.setLocation(XFile), Localizable.setLocation(org.inria.ns.reflex.modules.io.XFile)