|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.drools.rule.Package
public class Package
Collection of related Rule
s.
Rule
,
Serialized FormConstructor Summary | |
---|---|
Package()
Default constructor - for Externalizable. |
|
Package(String name)
Construct. |
Method Summary | |
---|---|
void |
addFactTemplate(FactTemplate factTemplate)
|
void |
addFunction(Function function)
|
void |
addGlobal(String identifier,
Class<?> clazz)
|
void |
addImport(ImportDeclaration importDecl)
|
void |
addProcess(org.drools.definition.process.Process process)
Add a rule flow to this package. |
void |
addRule(Rule rule)
Add a Rule to this Package . |
void |
addStaticImport(String functionImport)
|
void |
addTypeDeclaration(TypeDeclaration typeDecl)
|
void |
checkValidity()
This will throw an exception if the package is not valid |
void |
clear()
|
boolean |
equals(Object object)
|
ClassFieldAccessorStore |
getClassFieldAccessorStore()
|
DialectRuntimeRegistry |
getDialectRuntimeRegistry()
|
String |
getErrorSummary()
This will return the error summary (if any) if the package is invalid. |
FactTemplate |
getFactTemplate(String name)
|
org.drools.definition.type.FactType |
getFactType(String typeName)
|
Map<String,Function> |
getFunctions()
|
Map<String,String> |
getGlobals()
|
Map<String,ImportDeclaration> |
getImports()
|
String |
getName()
Retrieve the name of this Package . |
Rule |
getRule(String name)
Retrieve a Rule by name. |
Map<String,org.drools.definition.process.Process> |
getRuleFlows()
Get the rule flows for this package. |
Rule[] |
getRules()
Retrieve all Rules in this Package . |
Set |
getStaticImports()
|
TypeDeclaration |
getTypeDeclaration(String type)
|
Map<String,TypeDeclaration> |
getTypeDeclarations()
|
int |
hashCode()
|
boolean |
isEvent(Class clazz)
Returns true if clazz is imported as an Event class in this package |
boolean |
isValid()
|
void |
readExternal(ObjectInput stream)
Handles the read serialization of the Package. |
void |
removeFunction(String functionName)
|
void |
removeFunctionImport(String functionImport)
|
void |
removeGlobal(String identifier)
|
void |
removeImport(String importEntry)
|
void |
removeRule(Rule rule)
|
void |
removeRuleFlow(String id)
Rule flows can be removed by ID. |
void |
removeTypeDeclaration(String type)
|
void |
setClassFieldAccessorCache(ClassFieldAccessorCache classFieldAccessorCache)
|
void |
setError(String summary)
Once this is called, the package will be marked as invalid |
String |
toString()
|
void |
writeExternal(ObjectOutput stream)
Handles the write serialization of the Package. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Package()
public Package(String name)
name
- The name of this Package
.Method Detail |
---|
public void writeExternal(ObjectOutput stream) throws IOException
writeExternal
in interface Externalizable
stream
- out the stream to write the object to; should be an instance
of DroolsObjectOutputStream or OutputStream
IOException
public void readExternal(ObjectInput stream) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
stream,
- the stream to read data from in order to restore the object;
should be an instance of DroolsObjectInputStream or
InputStream
IOException
ClassNotFoundException
public String getName()
Package
.
Package
.public DialectRuntimeRegistry getDialectRuntimeRegistry()
public void addImport(ImportDeclaration importDecl)
public void removeImport(String importEntry)
public Map<String,ImportDeclaration> getImports()
public void addTypeDeclaration(TypeDeclaration typeDecl)
public void removeTypeDeclaration(String type)
public Map<String,TypeDeclaration> getTypeDeclarations()
public TypeDeclaration getTypeDeclaration(String type)
public void addStaticImport(String functionImport)
public void addFunction(Function function)
public Map<String,Function> getFunctions()
public void removeFunctionImport(String functionImport)
public Set getStaticImports()
public void addGlobal(String identifier, Class<?> clazz)
public void removeGlobal(String identifier)
public Map<String,String> getGlobals()
public void removeFunction(String functionName)
public FactTemplate getFactTemplate(String name)
public void addFactTemplate(FactTemplate factTemplate)
public void addRule(Rule rule)
Rule
to this Package
.
rule
- The rule to add.
DuplicateRuleNameException
- If the Rule
attempting to be added has the
same name as another previously added Rule
.
InvalidRuleException
- If the Rule
is not valid.public void addProcess(org.drools.definition.process.Process process)
public Map<String,org.drools.definition.process.Process> getRuleFlows()
public void removeRuleFlow(String id)
public void removeRule(Rule rule)
public Rule getRule(String name)
Rule
by name.
name
- The name of the Rule
to retrieve.
Rule
, or null
if not
such Rule
has been added to this
Package
.public Rule[] getRules()
Rules
in this Package
.
Rules
in this Package
.public String toString()
toString
in class Object
public void setError(String summary)
public boolean isValid()
public void checkValidity()
public String getErrorSummary()
public boolean equals(Object object)
equals
in class Object
public int hashCode()
hashCode
in class Object
public boolean isEvent(Class clazz)
clazz
-
public void clear()
public org.drools.definition.type.FactType getFactType(String typeName)
public ClassFieldAccessorStore getClassFieldAccessorStore()
public void setClassFieldAccessorCache(ClassFieldAccessorCache classFieldAccessorCache)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |