|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object uk.ac.bham.gloss.Mode uk.ac.bham.gloss.ModeExecution
public class ModeExecution
A mode is a record of various data within the mv:mode tag. Several of these are needed to gloss a text file: this class represents the run-time data and execution of a mode. A mode executes in the context of a glosser, and gloss execution, with a tokenizer and a place to put output. A mode has certain data and attributes read from the parsed XML MV file.
Field Summary | |
---|---|
java.lang.String |
mvURI
The namespace URI of the mv elements. |
Fields inherited from class uk.ac.bham.gloss.Mode |
---|
acceptDef, capturedModes, children, childrenDef, EXECUTE_TYPE, executeMode, INCLUDE_TYPE, modeElt, modeElts, modeName, modeType, postProcessMode, preProcessMode, PROCESS_TYPE, processMode, template, templateDef, typeString, UNDEFINED_TYPE, useIndentation, useIndentationDef |
Constructor Summary | |
---|---|
ModeExecution(Glosser g,
Mode m,
Tokenizer l,
Mode pME,
Mode pTok,
ParameterContainer pc,
org.w3c.dom.Node n)
constructor: construct a ModeExecution from Mode m, Tokenizer l, Glosser g and parent p, putting data in output Node n. |
Method Summary | |
---|---|
java.lang.String |
accept()
returns the "accept" attribute |
void |
adjustChildren(int v)
add or subtract to/from total number of children |
org.w3c.dom.NodeList |
children()
returns the children of the mode |
int |
childrenToFind()
returns the number of children to find |
int |
depth()
Returns the depth of the current token read by this mode. |
protected void |
execute()
|
GlossExecution |
execution()
accessor |
void |
exportParameter(java.lang.String name,
ParameterContainer pc)
Exports the value of the parameter "name" from "pc" to the parent ME, and continues recursively exporting to other ancestors; the last ancestor exported to is the first found in the same namespace, or the root if no such ancestor is found. |
protected org.w3c.dom.Element |
findMatch(Mode mode,
Token tok,
ParameterContainer params)
This method searches for a match for token tok amongst the nodes in the mode mode (and any included modes linked from this). |
Glosser |
glosser()
accessor |
boolean |
inheritParent()
returns the use inherit-parent status |
Tokenizer |
lex()
accessor |
Logger |
logger()
accessor |
ModeExecution |
makeChild(Mode mode,
Tokenizer l,
ParameterContainer pc,
org.w3c.dom.Node n)
factory method: makes a child ModeExecution object |
java.lang.String |
name()
Returns the name of the current mode being executed. |
protected Mode |
newModeAfterMatch()
This variable contains a reference to the new mode included from the current one after doing findMatch. |
org.w3c.dom.Node |
outpNode()
accessor |
ParameterContainer |
parameters()
Returns ParameterContainer for this mode |
Mode |
parent()
returns the parent mode |
Mode |
parentTok()
returns the parent mode |
ParameterContainer |
prefixes()
Returns the container of prefixes. |
void |
setChildrenRemaining(int v)
set number of children remaining |
void |
setChildrenTotal(int v)
set total number of children |
void |
setExecuteTokenMode(boolean val)
Sets "execute token mode" which is a special mode in which all children="..." and children-XXX="..." attributes are ignored and a single token is executed then control is returned. |
ModeExecution |
setInheritParent(boolean ip)
returns the state of this mode, whether it should inherit its parent |
ModeExecution |
setUseIndentation(boolean ui)
overrides default behaviour for this mode (set in <mv:mode ...> element) to use or not use indentation. |
protected boolean |
testMatch(Token tok,
java.lang.String matchStr,
java.lang.String attrname)
Performs a match of tok against matchStr, where matchStr is a non-null strings. |
Token |
token()
Returns the current token read by this mode. |
java.lang.String |
toString()
Returns a string representation of this mode. |
boolean |
useIndentation()
returns the use indentation status |
Methods inherited from class uk.ac.bham.gloss.Mode |
---|
actionMode, executeMode, getCapturedMode, isExecuteType, isIncludeType, isProcessType, isUndefinedType, node, postProcessMode, preProcessMode, processMode, resolvePrefix, setAccept, setActionMode, setCapturedMode, type |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public final java.lang.String mvURI
Constructor Detail |
---|
public ModeExecution(Glosser g, Mode m, Tokenizer l, Mode pME, Mode pTok, ParameterContainer pc, org.w3c.dom.Node n)
Method Detail |
---|
public Glosser glosser()
public GlossExecution execution()
public Tokenizer lex()
public org.w3c.dom.Node outpNode()
public Logger logger()
public void setExecuteTokenMode(boolean val)
public java.lang.String accept()
accept
in class Mode
public boolean useIndentation()
useIndentation
in class Mode
public ModeExecution setUseIndentation(boolean ui)
public boolean inheritParent()
public ModeExecution setInheritParent(boolean ip)
public org.w3c.dom.NodeList children()
children
in class Mode
public ParameterContainer prefixes()
prefixes
in class Mode
public java.lang.String toString()
toString
in class Mode
public ParameterContainer parameters()
public Mode parent()
parent
in class Mode
public Mode parentTok()
public java.lang.String name()
name
in class Mode
public Token token()
token
in class Mode
public int depth()
depth
in class Mode
public void setChildrenTotal(int v)
public void adjustChildren(int v)
public void setChildrenRemaining(int v)
public int childrenToFind()
childrenToFind
in class Mode
public void exportParameter(java.lang.String name, ParameterContainer pc) throws GlossException
GlossException
public ModeExecution makeChild(Mode mode, Tokenizer l, ParameterContainer pc, org.w3c.dom.Node n) throws GlossException
GlossException
protected void execute() throws GlossException
GlossException
protected Mode newModeAfterMatch()
protected boolean testMatch(Token tok, java.lang.String matchStr, java.lang.String attrname) throws GlossException
GlossException
protected org.w3c.dom.Element findMatch(Mode mode, Token tok, ParameterContainer params) throws GlossException
GlossException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |