public abstract class Action extends ContextAwareBase
Action methods are invoked as the XML file is parsed.
This class is largely inspired from the relevant class in the commons-digester project of the Apache Software Foundation.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ACTION_CLASS_ATTRIBUTE |
static java.lang.String |
CLASS_ATTRIBUTE |
static java.lang.String |
FILE_ATTRIBUTE |
static java.lang.String |
KEY_ATTRIBUTE |
static java.lang.String |
NAME_ATTRIBUTE |
static java.lang.String |
PATTERN_ATTRIBUTE |
static java.lang.String |
SCOPE_ATTRIBUTE |
static java.lang.String |
VALUE_ATTRIBUTE |
context| Constructor and Description |
|---|
Action() |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
begin(InterpretationContext ic,
java.lang.String name,
org.xml.sax.Attributes attributes)
Called when the parser encounters an element matching a
Pattern. |
void |
body(InterpretationContext ic,
java.lang.String body)
Called to pass the body (as text) contained within an element.
|
abstract void |
end(InterpretationContext ic,
java.lang.String name) |
protected int |
getColumnNumber(InterpretationContext ic) |
protected java.lang.String |
getLineColStr(InterpretationContext ic) |
protected int |
getLineNumber(InterpretationContext ic) |
java.lang.String |
toString() |
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContextpublic static final java.lang.String NAME_ATTRIBUTE
public static final java.lang.String KEY_ATTRIBUTE
public static final java.lang.String VALUE_ATTRIBUTE
public static final java.lang.String FILE_ATTRIBUTE
public static final java.lang.String CLASS_ATTRIBUTE
public static final java.lang.String PATTERN_ATTRIBUTE
public static final java.lang.String SCOPE_ATTRIBUTE
public static final java.lang.String ACTION_CLASS_ATTRIBUTE
public abstract void begin(InterpretationContext ic, java.lang.String name, org.xml.sax.Attributes attributes) throws ActionException
Pattern.ic - interpretation contextname - name of actionattributes - attributes of actionActionException - failed to process actionpublic void body(InterpretationContext ic, java.lang.String body) throws ActionException
ic - interpretation contextbody - text of the elementActionException - the body could not be parsedpublic abstract void end(InterpretationContext ic, java.lang.String name) throws ActionException
ActionExceptionpublic java.lang.String toString()
toString in class java.lang.Objectprotected int getColumnNumber(InterpretationContext ic)
protected int getLineNumber(InterpretationContext ic)
protected java.lang.String getLineColStr(InterpretationContext ic)