|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jaxfront.core.rule.RuleImpl
public class RuleImpl
The Rule class extends the xml schema definition for more interactive behaviour! This is necessary because of the limitations of the XML Schema Specifiation. The rule class is implementation of the ECA (Event - Condition - Action) paradigma known from active database theory. Rules can only be definied in the xui specification.A rule will allways triggered by an event. Following events are possible: saveDocument -> fired calling serialization() on the Document class initialisation -> fired on initial document load or if a new Element will be added to the Document propertyChange -> fired on valueChanges A rule gets evaluated after the occurance of an event. If all conditions (in this version the relation between conditions are always a boolean AND) are evaluated as true, all defined actions get performed.
Condition
,
AbstractAction
,
Serialized FormField Summary |
---|
Fields inherited from interface com.jaxfront.core.rule.Rule |
---|
ABOUT_TO_PERSIST, CHANGE, CHANGE_AND_INITIALIZATION, COPYCONTENT, DOM_DELETED, DOM_INITIALIZED, LIST_ITEM_DESELECTED, LIST_ITEM_SELECTED, NONE, ONCREATE, PASTECONTENT, PERSISTENT, PROPERTYCHANGE, SAVEDOCUMENT, STRUCTURE_CHANGE, STRUCTURE_CHANGE_ADD, STRUCTURE_CHANGE_REMOVE, VISUALIZED |
Constructor Summary | |
---|---|
RuleImpl(long type,
Type source)
A Rule needs sourceType to be checked against with and a type which specifies the event type. |
|
RuleImpl(long type,
Type source,
java.lang.String scope)
A Rule needs sourceType to be checked against with and a type which specifies the event type. |
|
RuleImpl(long type,
Type source,
java.lang.String scope,
boolean doesConcernNoneSerializableSource)
A Rule needs sourceType to be checked against with and a type which specifies the event type. |
|
RuleImpl(long type,
Type source,
java.lang.String executionMode,
java.lang.String scope,
boolean doesConcernNoneSerializableSource,
boolean doesConcernOnlyVisible)
A Rule needs sourceType to be checked against with and a type which specifies the event type. |
|
RuleImpl(java.lang.String id,
long type,
Type source,
java.lang.String executionMode,
java.lang.String scope,
boolean doesConcernNoneSerializableSource,
boolean doesConcernOnlyVisible)
|
Method Summary | |
---|---|
void |
apply(Type eventSource,
java.lang.Object event)
Applies ECA behaviour for the given sourceType |
void |
apply(Type eventSource,
java.lang.Object event,
boolean isRunningAsServer)
Applies ECA behaviour for the given sourceType. |
void |
apply(Type eventSource,
java.lang.Object event,
boolean isRunningAsServer,
java.util.Stack callStack)
|
java.lang.Object |
clone(Type newSource)
|
boolean |
doesConcern(Type sourceType)
Indicates if the passing type does concern this rule. |
java.util.List |
getActions()
Returns the actions for this rule. |
ConditionExpression |
getCondition()
Returns the defined condition for this rule. |
java.lang.String |
getExecutionMode()
|
java.lang.String |
getId()
|
int |
getPriority()
|
long |
getRuleType()
Return the rule type. |
java.lang.String |
getScope()
|
Type |
getSource()
Returns the source of this E-C-A rule. |
long |
getType()
Returns the event type of this rule (propertyChange,saveDocument or initialization) |
boolean |
isAboutToPersistRule()
Indicates if this rule is of type on persistent. |
boolean |
isChangeAndInitializationRule()
Indicates if this rule is of type change & initialization. |
boolean |
isChangeRule()
Indicates if this rule is of type change. |
boolean |
isCopyContentRule()
Indicates if this rule is of type on copyContent. |
boolean |
isDomDeletedRule()
Indicates if this rule is of type save document. |
boolean |
isDomInitialized()
Indicates if the DOM is visualized. |
boolean |
isListItemDeselectedRule()
Indicates if this rule is of type listtypedeselected. |
boolean |
isListItemSelectedRule()
Indicates if this rule is of type listtypeselected. |
boolean |
isOnCreationRule()
Indicates if this rule is of type initializisation. |
boolean |
isPasteContentRule()
Indicates if this rule is of type on creation. |
boolean |
isPersistentRule()
Indicates if this rule is of type save document. |
boolean |
isPropertyChangeRule()
Indicates if this rule is of type property change. |
boolean |
isReleased()
|
boolean |
isSaveDocumentRule()
Indicates if this rule is of type save document. |
boolean |
isStructureChangeAddRule()
Indicates if this rule is of type structure change (add). |
boolean |
isStructureChangeRemoveRule()
Indicates if this rule is of type structure change (remove). |
boolean |
isStructureChangeRule()
Indicates if this rule is of type structure change. |
boolean |
isVisualizerInitializationRule()
Indicates if this rule is of type initializisation. |
void |
release()
Release all allocated resources for this rule. |
void |
setCondition(ConditionExpression condition)
Sets the condition of this rule. |
void |
setPriority(int priority)
Sets the priority of this rule. |
void |
setSource(Type type)
|
java.lang.String |
toString()
Returns a short description of the sourceType, eventType and all registered Conditions and Events |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public RuleImpl(long type, Type source)
String
- type type of event saveDocument -> fired calling
serialization() on the Document class initialisation -> fired
on initial document load or if a new Element will be added to
the Document propertyChange -> fired on valueChangessource
- source base for the ECA behaviourpublic RuleImpl(long type, Type source, java.lang.String scope)
type
- type of event save -> fired calling serialization() on the
Document class initialisation -> fired on initial document
load or if a new Element will be added to the Document
propertyChange -> fired on valueChangessource
- source base for the ECA behaviourscope
- defines the scope of this rule in case of an occured eventpublic RuleImpl(long type, Type source, java.lang.String scope, boolean doesConcernNoneSerializableSource)
type
- type of event save -> fired calling serialization() on the
Document class initialisation -> fired on initial document
load or if a new Element will be added to the Document
propertyChange -> fired on valueChangessource
- source base for the ECA behaviourscope
- defines the scope of this rule in case of an occured eventdoesConcernNoneSerializableSource
- apply the rule if the source is not serializablepublic RuleImpl(long type, Type source, java.lang.String executionMode, java.lang.String scope, boolean doesConcernNoneSerializableSource, boolean doesConcernOnlyVisible)
type
- type of event save -> fired calling serialization() on the
Document class initialisation -> fired on initial document
load or if a new Element will be added to the Document
propertyChange -> fired on valueChangessource
- source base for the ECA behaviourexecutionMode
- place where the rule needs to be executed (client,server or
both)scope
- defines the scope of this rule in case of an occured eventdoesConcernNoneSerializableSource
- apply the rule if the source is not serializablepublic RuleImpl(java.lang.String id, long type, Type source, java.lang.String executionMode, java.lang.String scope, boolean doesConcernNoneSerializableSource, boolean doesConcernOnlyVisible)
Method Detail |
---|
public void apply(Type eventSource, java.lang.Object event)
Rule
apply
in interface Rule
event
- TODOpublic void apply(Type eventSource, java.lang.Object event, boolean isRunningAsServer)
Rule
apply
in interface Rule
event
- TODOisRunningAsServer
- defines if this rule should be applied in server modepublic void apply(Type eventSource, java.lang.Object event, boolean isRunningAsServer, java.util.Stack callStack)
apply
in interface Rule
public boolean doesConcern(Type sourceType)
Rule
doesConcern
in interface Rule
sourceType
- source of an occured changepublic java.util.List getActions()
Rule
getActions
in interface Rule
public ConditionExpression getCondition()
Rule
getCondition
in interface Rule
public Type getSource()
Rule
getSource
in interface Rule
public long getType()
public boolean isVisualizerInitializationRule()
isVisualizerInitializationRule
in interface Rule
public boolean isOnCreationRule()
isOnCreationRule
in interface Rule
public boolean isChangeRule()
isChangeRule
in interface Rule
public boolean isChangeAndInitializationRule()
isChangeAndInitializationRule
in interface Rule
public boolean isPropertyChangeRule()
isPropertyChangeRule
in interface Rule
public boolean isStructureChangeRule()
isStructureChangeRule
in interface Rule
public boolean isStructureChangeAddRule()
isStructureChangeAddRule
in interface Rule
public boolean isStructureChangeRemoveRule()
isStructureChangeRemoveRule
in interface Rule
public boolean isSaveDocumentRule()
isSaveDocumentRule
in interface Rule
public boolean isDomDeletedRule()
isDomDeletedRule
in interface Rule
public boolean isPersistentRule()
isPersistentRule
in interface Rule
public boolean isAboutToPersistRule()
Rule
isAboutToPersistRule
in interface Rule
public boolean isDomInitialized()
isDomInitialized
in interface Rule
public boolean isListItemSelectedRule()
Rule
isListItemSelectedRule
in interface Rule
public boolean isListItemDeselectedRule()
Rule
isListItemDeselectedRule
in interface Rule
public boolean isCopyContentRule()
Rule
isCopyContentRule
in interface Rule
public boolean isPasteContentRule()
Rule
isPasteContentRule
in interface Rule
public void release()
Rule
release
in interface Rule
public void setCondition(ConditionExpression condition)
setCondition
in interface Rule
condition
- condition for this rulepublic java.lang.String toString()
toString
in class java.lang.Object
public java.lang.Object clone(Type newSource)
clone
in interface Rule
public void setSource(Type type)
public java.lang.String getScope()
public java.lang.String getExecutionMode()
public int getPriority()
getPriority
in interface Rule
public void setPriority(int priority)
Rule
setPriority
in interface Rule
public java.lang.String getId()
getId
in interface Rule
public long getRuleType()
Rule
getRuleType
in interface Rule
public boolean isReleased()
isReleased
in interface Rule
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |