org.inria.ns.reflex.processor
Interface ForeignAttribute

All Superinterfaces:
Comparable
All Known Implementing Classes:
DisablePrefixesAttr, EnablePrefixesAttr, ForeignAttribute.Impl, ForeignAttribute.Marker, IfAttr, InternalTuningDirective, SyncAttr, TimeoutAttr, TraverseAttr, UseCatalogAttr, VersionAttr

public interface ForeignAttribute
extends Comparable

A foreign attribute is an XML attribute that is bound to a namespace URI, usually different from the element it belongs.

A foreign attribute may act on the unmarshalling phase or the runtime phase. When unmarshalling, an attribute that act on the unmarshalling phase is activated before the element it belongs.

A concrete implementation of this class must be declared to its owner module by using the <exp:attribute> element.

Author:
Philippe Poulard

Nested Class Summary
static class ForeignAttribute.Impl
          A partial implementation of foreign attribute.
static class ForeignAttribute.Marker
          A foreign attribute that is just a marker (does nothing).
 
Method Summary
 AbstractAction apply(AbstractAction parent, Element element, SortedList foreignAttrs)
          Apply a foreign attribute when unmarshalling.
 QName getName()
          Get the name of the attribute used by this instance.
 int getPriority()
          Return the priority of this foreign attribute.
 String getValue()
          Get the value of the attribute used by this instance.
 void setName(QName attName)
          Set the name of the attribute used by this instance.
 void setValue(String value)
          Set the value of the attribute used by this instance.
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

apply

AbstractAction apply(AbstractAction parent,
                     Element element,
                     SortedList foreignAttrs)
                     throws XMLException
Apply a foreign attribute when unmarshalling. The task accomplished may be :

Foreign attributes are applied before unmarshalling the element within which they are hosted.

Parameters:
parent - The action depending from, which is not the action that corresponds to the element that hosts the attribute.
element - The XML element that contains the foreign attribute.
foreignAttrs - The other foreign attributes found within the element that hosts the attribute. This list may be useful if a foreign attribute work with another one.
Returns:
The new parent action, which is usually the same as the first argument given. If another is created, it must be a child of the parent action given. The action that corresponds to the element that hosts the attribute will be unmarshalled in an action that will be a child of the action returned.
Throws:
XMLException - When the foreign attribute can't be unmarshalled.

setName

void setName(QName attName)
Set the name of the attribute used by this instance. The prefix may be used to test if this foreign attribute is active (and must be applied) or not.

Parameters:
attName - The name of the attribute.

getName

QName getName()
Get the name of the attribute used by this instance. The prefix may be used to test if this foreign attribute is active (and must be applied) or not.

Returns:
The name of the attribute.

setValue

void setValue(String value)
Set the value of the attribute used by this instance.

Parameters:
value - The value of the attribute.

getValue

String getValue()
Get the value of the attribute used by this instance.

Returns:
The value of the attribute.

getPriority

int getPriority()
Return the priority of this foreign attribute. A high value denotes a lower priority. Custom modules should return a positive and non null value. Negative values are reserved.

Returns:
The priority level of this foreign attribute.