|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.drools.ide.common.client.modeldriven.brl.RuleModel
public class RuleModel
Field Summary | |
---|---|
RuleAttribute[] |
attributes
|
IPattern[] |
lhs
|
RuleMetadata[] |
metadataList
|
String |
modelVersion
|
String |
name
This name is generally not used - the asset name or the file name is preferred (ie it could get out of sync with the name of the file it is in). |
String |
parentName
|
IAction[] |
rhs
|
Constructor Summary | |
---|---|
RuleModel()
|
Method Summary | |
---|---|
void |
addAttribute(RuleAttribute attribute)
|
void |
addLhsItem(IPattern pat)
|
void |
addLhsItem(IPattern pat,
boolean append)
|
void |
addLhsItem(IPattern pat,
int position)
|
void |
addMetadata(RuleMetadata metadata)
Add metaData |
void |
addRhsItem(IAction action)
|
void |
addRhsItem(IAction action,
boolean append)
|
void |
addRhsItem(IAction action,
int position)
|
List<String> |
getAllVariables()
This will get a list of all bound variables, including bound fields.. |
List<String> |
getBoundVariablesInScope(BaseSingleFieldConstraint con)
This uses a deceptively simple algorithm to determine what bound variables are in scope for a given constraint (including connectives). |
String |
getLHSBindingType(String var)
Get the data-type associated with the binding |
FactPattern |
getLHSBoundFact(String var)
This will return the FactPattern that a variable is bound to. |
List<String> |
getLHSBoundFacts()
This will return a List |
FieldConstraint |
getLHSBoundField(String var)
This will return the FieldConstraint that a variable is bound to. |
FactPattern |
getLHSParentFactPatternForBinding(String var)
This will return the FactPattern that a variable is bound to. |
RuleMetadata |
getMetaData(String attributeName)
Locate metadata element |
ActionInsertFact |
getRHSBoundFact(String var)
This will return the ActionInsertFact that a variable is bound to. |
List<String> |
getRHSBoundFacts()
This will return a List |
boolean |
hasDSLSentences()
Returns true if any DSLSentences are used. |
boolean |
isBoundFactUsed(String binding)
|
boolean |
isNegated()
Is the Rule to be negated, i.e. |
boolean |
isVariableNameUsed(String s)
Checks to see if a variable is used or not, includes fields as well as facts. |
void |
moveLhsItemDown(int itemIndex)
|
void |
moveLhsItemUp(int itemIndex)
|
void |
moveRhsItemDown(int itemIndex)
|
void |
moveRhsItemUp(int itemIndex)
|
void |
removeAttribute(int idx)
|
boolean |
removeLhsItem(int idx)
|
void |
removeMetadata(int idx)
|
void |
removeRhsItem(int idx)
|
void |
setNegated(boolean isNegated)
Set whether the Rule is to be negated |
boolean |
updateMetadata(RuleMetadata target)
Update metaData element if it exists or add it otherwise |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public String name
public String parentName
public String modelVersion
public RuleAttribute[] attributes
public RuleMetadata[] metadataList
public IPattern[] lhs
public IAction[] rhs
Constructor Detail |
---|
public RuleModel()
Method Detail |
---|
public List<String> getLHSBoundFacts()
public FactPattern getLHSBoundFact(String var)
var
- The bound fact variable (NOT bound field).
public FieldConstraint getLHSBoundField(String var)
var
- The bound field variable (NOT bound fact).
public String getLHSBindingType(String var)
var
-
public List<String> getRHSBoundFacts()
public ActionInsertFact getRHSBoundFact(String var)
var
- The bound fact variable (NOT bound field).
public FactPattern getLHSParentFactPatternForBinding(String var)
var
- The variable binding
public List<String> getAllVariables()
public boolean removeLhsItem(int idx)
idx
- Remove this index from the LHS. returns false if it was NOT
allowed to remove this item (ie it is used on the RHS).public boolean isBoundFactUsed(String binding)
binding
- The name of the LHS fact binding.
public void addLhsItem(IPattern pat)
public void addLhsItem(IPattern pat, boolean append)
public void addLhsItem(IPattern pat, int position)
public void moveLhsItemDown(int itemIndex)
public void moveLhsItemUp(int itemIndex)
public void moveRhsItemDown(int itemIndex)
public void moveRhsItemUp(int itemIndex)
public void addRhsItem(IAction action)
public void addRhsItem(IAction action, boolean append)
public void addRhsItem(IAction action, int position)
public void removeRhsItem(int idx)
public void addAttribute(RuleAttribute attribute)
public void removeAttribute(int idx)
public void addMetadata(RuleMetadata metadata)
metadata
- public void removeMetadata(int idx)
public RuleMetadata getMetaData(String attributeName)
attributeName
- - value to look for
public boolean updateMetadata(RuleMetadata target)
target
-
public List<String> getBoundVariablesInScope(BaseSingleFieldConstraint con)
public boolean isVariableNameUsed(String s)
public boolean hasDSLSentences()
public boolean isNegated()
public void setNegated(boolean isNegated)
isNegated
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |