|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface AssertionHandler
AssertionHandler manages an internal registry of Assertions. The
"registry" may be any internal means of storing or representing
the asserted statements. They are passed around within the system
as Assertion objects,
structs containing the assertion's page, subject, predicate, and
object data.
Assertion,
AssertionHandlerFactory| Field Summary | |
|---|---|
static String |
SYNCHRONIZED
The ActionEvent command string sent upon successful completion of the synchronization process. |
static String |
UNSYNCHRONIZED
The ActionEvent command string sent upon completion of the synchronization process, if any error has occurred. |
| Method Summary | |
|---|---|
Assertion |
createAssertion(String pagename,
Term subject,
Predicate predicate,
Property property)
Creates and returns a new property Assertion provided its parameters. |
Assertion |
createAssertion(String pagename,
Term subject,
Predicate predicate,
Term object,
boolean isTemplate)
Creates and returns a new Assertion provided its parameters. |
Assertion |
getAssertion(String pagename,
String subject,
String predicate,
String object)
Queries the set of existing Assertions for an Assertion matching the provided Subject, Predicate and Object. |
Assertion |
getAssertion(String pagename,
Term subject,
Predicate predicate,
Property property,
boolean create)
Returns an Assertion having the WikiContext, Predicate and Property. |
Assertion |
getAssertion(String pagename,
Term subject,
Predicate predicate,
Term object,
boolean isTemplate,
boolean create)
Returns an Assertion having the wiki page name, Predicate and Terms. |
Collection |
getAssertions()
Returns a Collection containing all the Assertions in the registry. |
WikiEngine |
getEngine()
Returns the WikiEngine associated with this AssertionHandler. |
ReferenceInfoProvider |
getReferenceInfoProvider()
Returns the ReferenceInfoProvider associated with this AssertionHandler. |
boolean |
hasAssertion(String pagename,
String subject,
String predicate,
String object)
Returns true if an Assertion equivalent to one created with the provided subject, predicate, and object is contained in the registry. |
boolean |
isListenerEnabled()
Returns the enabled or disabled state of this AssertionHandler's WikiEventListener. |
boolean |
removeAssertion(Assertion assertion)
Returns true if the Assertion was successfully removed from the registry. |
void |
setListenerEnabled(boolean enable)
Enables or disables this AssertionHandler's WikiEventListener ability to listen for changes to the wiki. |
void |
synchronize(String pagename,
ActionListener listener)
Synchronizes the AssertionHandler's registry with the current set of wiki pages. |
String |
toXHTML(WikiContext context,
Assertion assertion)
Format the assertion into XHTML output suitable for display on a web page. |
| Field Detail |
|---|
static final String SYNCHRONIZED
static final String UNSYNCHRONIZED
| Method Detail |
|---|
void synchronize(String pagename,
ActionListener listener)
pagename - the optional name of the wiki page that fired the event
triggering synchronization, used to check for page-specific
changes.listener - the optional listener may be used to receive notification
that the synchronization process has finished. Upon completion,
an ActionEvent is fired, with an action command of either
SYNCHRONIZED or UNSYNCHRONIZED. The
listener is automatically removed following successful
synchronization,WikiEngine getEngine()
ReferenceInfoProvider getReferenceInfoProvider()
void setListenerEnabled(boolean enable)
boolean isListenerEnabled()
Collection getAssertions()
throws AssertionException
AssertionException - if an error occurs while creating the Collection of assertions.
Assertion getAssertion(String pagename,
Term subject,
Predicate predicate,
Term object,
boolean isTemplate,
boolean create)
throws AssertionException
Note: This is the only way to add an Assertion to the registry; there is no addAssertion() method. This keeps any Assertions not created by the AssertionHandler from entering into the system.
pagename - the wiki page name source of the Assertionsubject - the subject Term of the Assertionpredicate - the Predicate of the Assertionobject - the subject Term of the AssertionisTemplate - when true, queries for an assertion templatecreate - when true, permits creation of Assertion to fulfill a match
AssertionException - if an error occurs while creating the new Assertion
Assertion getAssertion(String pagename,
Term subject,
Predicate predicate,
Property property,
boolean create)
throws AssertionException
Note: This is the only way to add an Assertion to the registry; there is no addAssertion() method. This keeps any Assertions not created by the AssertionHandler from entering into the system.
pagename - the wiki page name source of the Assertionsubject - the subject Term of the Assertionpredicate - the property assignment Predicate (or property name) of the Assertionproperty - the property value of the Assertioncreate - when true, permits creation of Assertion to fulfill a match
AssertionException - if an error occurs while creating the new Assertion
Assertion getAssertion(String pagename,
String subject,
String predicate,
String object)
throws AssertionException
Returns null if unable to locate a matching Assertion. The pagename parameter is optional; it is only used as an additional query filter if provided.
pagename - the wiki page source of the Assertionsubject - the wiki page name of the Assertion's subjectpredicate - the wiki page name of the Assertion's predicateobject - the wiki page name of the Assertion's object
AssertionException
boolean hasAssertion(String pagename,
String subject,
String predicate,
String object)
pagename - the wiki page source of the Assertionsubject - the wiki page name of the Assertion's subjectpredicate - the wiki page name of the Assertion's predicateobject - the wiki page name of the Assertion's object
boolean removeAssertion(Assertion assertion)
assertion - the Assertion to be removed.
String toXHTML(WikiContext context,
Assertion assertion)
throws AssertionException
context - optional; if supplied, used to provide link markup.assertion - the Assertion to be displayed.
AssertionException
Assertion createAssertion(String pagename,
Term subject,
Predicate predicate,
Term object,
boolean isTemplate)
throws AssertionException
NOTE: while this is a public method by virtue of it being part of the API, it should not be called directly since creation of Assertions is meant to be handled internal to the process.
pagename - the wiki page source of the Assertionsubject - the subject Term of the Assertionpredicate - the Predicate of the Assertionobject - the subject Term of the AssertionisTemplate - if true, the assertion is created as an assertion template.
AssertionException - if unable to create the new Assertion.to create a property assertion
Assertion createAssertion(String pagename,
Term subject,
Predicate predicate,
Property property)
throws AssertionException
NOTE: while this is a public method by virtue of it being part of the API, it should not be called directly since creation of Assertions is meant to be handled internal to the process.
pagename - the wiki page source of the Assertionsubject - the subject Term of the Assertionpredicate - the Predicate of the Assertionproperty - the Property being asserted.
AssertionException - if unable to create the new Assertion.to create an assertion or assertion template
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||