|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.ceryle.wiki.plugin.query.ExpressionParser
org.ceryle.wiki.plugin.assertion.AssertionProcessor
public class AssertionProcessor
This takes over after the Assertion syntax has been parsed,
receiving its input as a List. But apart from its input,
this class performs roughly the same post-processing as
ExpressionParser,
returning either an Expression or an Assertion (a subclass
of Expression).
| Field Summary | |
|---|---|
static String |
ANYPAGE
The string value indicating a reference to any page. |
static boolean |
requirePageOnOutput
When true, pages must exist for each term in the expression or an exception is thrown. |
static String |
THISPAGE
The string value indicating the page the assertion occurs on. |
| Fields inherited from interface org.ceryle.wiki.plugin.util.PluginConstants |
|---|
ACL, AOP, APOS_ENT, ASTERISK, BCL, BOP, BR, CAPCL, CAPOP, CLATT, COLON, COMMA, DIV_class, DIV_style, DIVCL, DOT, EQ, EQQUO, EQSQUO, FALSE, FORMCL, FORMOP, GET, ICL, INPUTOP, IOP, LABELCL, LABELFOR, LABELOP, LCURL, LICL, LIOP, LPAR, LSBR, MT, NBSP, NL, OLCL, OLOP, P_class, PCL, PLUGCL, PLUGO, POP, POST, QUO, QUOCL, QUOETCL, RCURL, RPAR, RSBR, SEMI, SP, SPAN_class, SPANCL, SPANOP, SQUO, TABLECL, TABLEOP, TDCL, TDOP, THCL, THOP, TRCL, TROP, TRUE, TTCL, TTOP, ULCL, ULOP, UNDER |
| Constructor Summary | |
|---|---|
AssertionProcessor(WikiEngine engine)
Constructor with the WikiEngine engine. |
|
| Method Summary | |
|---|---|
void |
convertTerms(List list,
String pagename)
Converts any square-bracketed Strings in the List list with Terms. |
protected List |
makeExpressionsExplicit(WikiContext context,
List list,
boolean isTemplate)
Create expressions based on use of explicit parentheses in the expression. |
void |
pageCheck(WikiEngine engine,
Term subject)
Throws an AssertionException if the referenced subject page doesn't exist. |
void |
pageCheck(WikiEngine engine,
Term subject,
Predicate predicate,
Term object)
Throws an AssertionException if any of the referenced pages don't exist. |
Expression |
parse(String queryString)
Not used in this class, since it is meant to receive pre-parsed content. |
Expression |
process(WikiContext context,
List statement,
boolean isTemplate)
This holds roughly the same place as parse(String) in ExpressionParser, except that the preliminaries are already handled, so this takes a List. |
protected List |
replaceOperators(List list)
Replace string names of operators with Operator instances. |
| Methods inherited from class org.ceryle.wiki.plugin.query.ExpressionParser |
|---|
collapseBracketedTerms, explicitExpressions, findLastOpen, findNextClose, syntaxCheckBrackets |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static boolean requirePageOnOutput
public static final String THISPAGE
public static final String ANYPAGE
| Constructor Detail |
|---|
public AssertionProcessor(WikiEngine engine)
| Method Detail |
|---|
public Expression parse(String queryString)
process(WikiContext,List,boolean) instead.
parse in class ExpressionParserUnsupportedOperationException - if called
public Expression process(WikiContext context,
List statement,
boolean isTemplate)
throws QueryException
context - the WikiContext providing the wiki page declaring the Assertionstatement - the List of tokens to process into an Expression or AssertionisTemplate - if true, the resulting Assertion is considered an assertion template.
AssertionException - if any component of the Expression is invalid.
QueryException
public void pageCheck(WikiEngine engine,
Term subject)
throws AssertionException
AssertionException
public void pageCheck(WikiEngine engine,
Term subject,
Predicate predicate,
Term object)
throws AssertionException
AssertionException
public void convertTerms(List list,
String pagename)
protected List replaceOperators(List list)
ExpressionParser.replaceOperators(List),
but rather than throw an RuntimeException on encountering unknown text,
permits the creation of custom, user-defined Predicates. The Predicate
creation will itself fail if not backed by a properly-established wiki
page asserted as a WikiVerb instance.
replaceOperators in class ExpressionParserlist -
protected List makeExpressionsExplicit(WikiContext context,
List list,
boolean isTemplate)
throws QueryException
ExpressionParser.explicitExpressions(List),
except it has been renamed because this method can throw an AssertionException.
context - list -
QueryException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||