|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.ceryle.wiki.plugin.query.Expression
org.ceryle.wiki.plugin.assertion.Assertion
public class Assertion
Every Expression (of which Assertion is a subclass) has a left + operator + right. In this class they are respectively subject, predicate and object. An alternate form is subject, property name and value.
Encapsulates a Wiki Assertion as a struct comprised of its subject, predicate and object. Note that the expression of the Assertion (i.e., the values of its terms) is immutable.
An Assertion may be designated as a template. When processed into the Topic Map it is scoped as a Template and used to provide role specifications to Associations typed by it. Property Assertions cannot act as templates.
There are a variety of static and non-static toString() and toXHTML() methods, the former are designed to provide a non-marked-up ("black and white"), the latter a marked up serialization/representation (in color and/or with links) of the Assertion. The black and white contain no XHTML markup and are used to create the unique base64 hash identifier for the Assertion.
Assertion,
AssertionEvent,
AssertionHandler,
Expression| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.ceryle.wiki.plugin.query.Operand |
|---|
Operand.NullOperand |
| Field Summary | |
|---|---|
static String |
CLASS_ASSERTED
View anchor class attribute value for asserted (query) messages. |
static String |
CLASS_ASSERTION
View anchor class attribute value for assertion messages. |
static String |
CLASS_DEBUG
View anchor class attribute value for assertion debugging messages. |
static String |
CLASS_ERROR
View anchor class attribute value for assertion error messages. |
static String |
CLASS_HIDE
View anchor class attribute value for hidden assertion messages. |
static String |
CLASS_OBJECT
View anchor class attribute value for subject. |
static String |
CLASS_PAGENAME
View anchor class attribute value for page name. |
static String |
CLASS_PREDICATE
View anchor class attribute value for subject. |
static String |
CLASS_PROPNAME
Property name class attribute value. |
static String |
CLASS_PROPVALUE
Property value class attribute value. |
static String |
CLASS_PROTOTYPE
View anchor class attribute value for assertion prototype (testing) messages. |
static String |
CLASS_SUBJECT
View anchor class attribute value for subject. |
static String |
PAGE_ATTRIB_ASSERTIONS
The set of assertions for a given wiki page is stored in an attribute identified by this string constant. |
static String |
Span_blue
|
static String |
Span_green
|
static String |
Span_red
|
static String |
SpClnSpObjSp
|
static String |
SpClnSpSubSp
|
static String |
SpCmaSp
|
static String |
SpLBrSp
|
static String |
SpRBrSpTemp
|
| Fields inherited from class org.ceryle.wiki.plugin.query.Expression |
|---|
EMPTY, m_left, m_operator, m_parser, m_right |
| 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 |
| Fields inherited from interface org.ceryle.wiki.plugin.query.Operand |
|---|
NULL |
| Constructor Summary | |
|---|---|
Assertion(String pagename,
Term subject,
Predicate predicate,
Property property)
Constructor for an Assertion with the name of the wiki page where it was declared and three requisite components, a Term subject (a form of Operand), a Predicate predicate (assumed as a property assignment predicate or property name), and a Property property. |
|
Assertion(String pagename,
Term subject,
Predicate predicate,
Term object)
Constructor for an Assertion with the name of the wiki page where it was declared and three requisite components, a Term subject (a form of Operand), a Predicate predicate (a form of Operator), and a Term object (a form of Operand). |
|
| Method Summary | |
|---|---|
int |
compareTo(Object o)
Compares this object with the specified object for order. |
boolean |
equals(Object o)
Returns true if the parameter is the same Object as this one, or is an Assertion and has the same String representation. |
long |
getCreated()
Return the timestamp of when the Assertion was created. |
Term |
getObject()
Return this Assertion's object (right Operand, a Term). |
String |
getPageName()
Returns the Wiki page name associated with this Assertion (the page upon which the AssertionPlugin was found). |
Predicate |
getPredicate()
Return this Assertion's predicate (Operator, a Predicate). |
String |
getSignature()
Returns a base 64-encoded version of the String representation of this Assertion, which should be a reliable unique identifier. |
static String |
getSignature(String pagename,
String subject,
String predicate,
String object,
boolean isProperty,
boolean isTemplate)
A static utility method that returns a base 64-encoded version of the String representation of an Assertion with the provided parameters, which should be a reliable unique identifier. |
Term |
getSubject()
Return this Assertion's subject (left Operand, a Term). |
boolean |
isPropertyAssignment()
Return true if this Assertion is a property assignment, by testing to see if it its object (right Operand) is a Property rather than simply a Term. |
boolean |
isTemplate()
Returns true if this Assertion is a template. |
void |
setTemplate(boolean isTemplate)
Sets the flag indicating this Assertion is or is not a template. |
String |
toString()
Return a displayable version of this Assertion. |
static String |
toString(Assertion assertion)
Return a displayable String version of the provided Assertion. |
static String |
toString(String pagename,
String subject,
String predicate,
String object,
boolean isProperty,
boolean isTemplate)
A utility method returning a displayable String version of an Assertion having the provided pagename, subject, predicate, and object (as Strings). |
static String |
toString(String pagename,
Term subject,
Predicate predicate,
Term object,
boolean isTemplate)
A utility method returning a displayable String version of an Assertion having the provided Predicate and Terms. |
String |
toXHTML()
Return a displayable version of this assertion. |
static String |
toXHTML(Assertion assertion)
Return a displayable XHTML version of the Assertion. |
static String |
toXHTML(String pagename,
String subject,
String predicate,
String object,
boolean isProperty,
boolean isTemplate)
A utility method returning a displayable XHTML version of an Assertion having the provided pagename, subject, predicate, and object (as Strings). |
static String |
toXHTML(WikiContext context,
Assertion assertion)
Return a displayable XHTML version of the Assertion. |
static String |
toXHTML(WikiContext context,
String pagename,
String subject,
String predicate,
String object,
boolean isProperty,
boolean isTemplate)
A utility method returning a displayable XHTML version of an Assertion having the provided pagename, subject, predicate, and object (as Strings). |
| Methods inherited from class org.ceryle.wiki.plugin.query.Expression |
|---|
accepts, evaluateOperand, getLeftOperand, getOperator, getRightOperand, parse |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String PAGE_ATTRIB_ASSERTIONS
public static String CLASS_ASSERTION
public static String CLASS_ASSERTED
public static String CLASS_PAGENAME
public static String CLASS_SUBJECT
public static String CLASS_PREDICATE
public static String CLASS_OBJECT
public static String CLASS_PROPNAME
public static String CLASS_PROPVALUE
public static String CLASS_DEBUG
public static String CLASS_ERROR
public static String CLASS_PROTOTYPE
public static String CLASS_HIDE
public static final String Span_red
public static final String Span_green
public static final String Span_blue
public static final String SpLBrSp
public static final String SpClnSpSubSp
public static final String SpCmaSp
public static final String SpClnSpObjSp
public static final String SpRBrSpTemp
| Constructor Detail |
|---|
public Assertion(String pagename,
Term subject,
Predicate predicate,
Term object)
throws AssertionException
pagename - the wiki page where the Assertion was declared.subject - the subject Term of the Assertion.predicate - the Predicate of the Assertion.object - the object Term of the Assertion.
AssertionException - if any of the parameters is null
public Assertion(String pagename,
Term subject,
Predicate predicate,
Property property)
throws AssertionException
pagename - the wiki page where the Assertion was declared.subject - the subject Term of the Assertion.predicate - the Predicate of the Assertion.property - the asserted Property.
AssertionException - if any of the parameters is null| Method Detail |
|---|
public void setTemplate(boolean isTemplate)
throws AssertionException
AssertionException - if this Assertion is a property assertion (since
such assertions can't act as templates).public boolean isTemplate()
public long getCreated()
public String getPageName()
public Term getSubject()
public Predicate getPredicate()
public Term getObject()
public boolean isPropertyAssignment()
public boolean equals(Object o)
equals in class ObjectClassCastException - if the parameter is not an Assertion or a String array.public int compareTo(Object o)
pagename, subject, predicate, object, isPropertyAssignment, isTemplatewhere the last two booleans are simply "true" or "false" (and must be provided as such).
compareTo in interface Comparableo - the Object to compare with this Assertion.
ClassCastException - if the parameter is not an Assertion or a String array.
NullPointerException - if the String array contains a null value where required
ArrayIndexOutOfBoundsException - if the String array provided is too smallfor Assertion equalitypublic String toXHTML()
public static String toXHTML(Assertion assertion)
assertion - the Assertion to display.
public static String toXHTML(WikiContext context,
Assertion assertion)
context - optional; if provided the output will include link markup.assertion - the Assertion to display.
public static String toXHTML(String pagename,
String subject,
String predicate,
String object,
boolean isProperty,
boolean isTemplate)
While the pagename is not normally part of the serialized Assertion, it can be displayed prior to the Assertion itself; when present it is prepended as "pn: " (where 'pn' is the page name).
pagename - the wiki page source of the Assertion.subject - the subject of the Assertion.predicate - the predicate of the Assertion.object - the object of the Assertion.isProperty - when true, the Assertion is treated as a property assertion.isTemplate - when true, the output is formatted as an Assertion template.
public static String toXHTML(WikiContext context,
String pagename,
String subject,
String predicate,
String object,
boolean isProperty,
boolean isTemplate)
While the pagename is not normally part of the serialized Assertion, it can be displayed prior to the Assertion itself; when present it is prepended as "pn: " (where 'pn' is the page name).
context - the WikiContext of the generated markup.pagename - the wiki page source of the Assertion.subject - the subject of the Assertion.predicate - the predicate of the Assertion.object - the object of the Assertion.isProperty - when true, the Assertion is treated as a property assertion.isTemplate - when true, the output is formatted as an Assertion template.public String toString()
toString in class Expressionpublic static String toString(Assertion assertion)
public static String toString(String pagename,
Term subject,
Predicate predicate,
Term object,
boolean isTemplate)
pagename - the wiki page source of the Assertion.subject - the subject of the Assertion.predicate - the predicate of the Assertion.object - the object of the Assertion.isTemplate - when true provides XHTML markup for an assertion template.
public static String toString(String pagename,
String subject,
String predicate,
String object,
boolean isProperty,
boolean isTemplate)
While the pagename is not normally part of the serialized Assertion, it is a necessary component in the creation of hashes if one wants to differentiate the wiki page source of an assertion; when present it is prepended as "pn: " (where 'pn' is the page name).
pagename - the wiki page source of the Assertion.subject - the subject of the Assertion.predicate - the predicate of the Assertion.object - the object of the Assertion.isProperty - when true, the Assertion is treated as a property assertion.isTemplate - when true, the output is formatted as an Assertion template.public String getSignature()
public static String getSignature(String pagename,
String subject,
String predicate,
String object,
boolean isProperty,
boolean isTemplate)
pagename - the wiki page source of the Assertion.subject - the subject of the Assertion.predicate - the predicate of the Assertion.object - the object of the Assertion.isProperty - when true, the Assertion is treated as a property assertion.isTemplate - when true, the output is formatted as an Assertion template.
IllegalStateException - if both isProperty and isTemplate are true.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||