|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.drools.rule.Package
public class Package
Collection of related Rule
s.
Rule
,
Serialized FormConstructor Summary | |
---|---|
Package()
Default constructor - for Externalizable. |
|
Package(String name)
Construct. |
|
Package(String name,
ClassLoader parentClassLoader)
Construct. |
Method Summary | |
---|---|
void |
addFactTemplate(FactTemplate factTemplate)
|
void |
addFunction(String functionName)
|
void |
addGlobal(String identifier,
Class clazz)
|
void |
addImport(String importEntry)
|
void |
addRule(Rule rule)
Add a Rule to this Package . |
void |
addStaticImport(String functionImport)
|
void |
checkValidity()
This will throw an exception if the package is not valid |
void |
clear()
|
boolean |
equals(Object object)
|
String |
getErrorSummary()
This will return the error summary (if any) if the package is invalid. |
FactTemplate |
getFactTemplate(String name)
|
List |
getFunctions()
|
Map |
getGlobals()
|
List |
getImports()
|
String |
getName()
Retrieve the name of this Package . |
PackageCompilationData |
getPackageCompilationData()
|
Rule |
getRule(String name)
Retrieve a Rule by name. |
Rule[] |
getRules()
Retrieve all Rules in this Package . |
List |
getStaticImports()
|
int |
hashCode()
|
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 |
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
.public Package(String name, ClassLoader parentClassLoader)
name
- The name of this Package
.Method Detail |
---|
public void writeExternal(ObjectOutput stream) throws IOException
writeExternal
in interface Externalizable
IOException
public void readExternal(ObjectInput stream) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
public String getName()
Package
.
Package
.public void addImport(String importEntry)
public void removeImport(String importEntry)
public List getImports()
public void addStaticImport(String functionImport)
public void addFunction(String functionName)
public List getFunctions()
public void removeFunctionImport(String functionImport)
public List getStaticImports()
public void addGlobal(String identifier, Class clazz)
public void removeGlobal(String identifier)
public Map 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 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 PackageCompilationData getPackageCompilationData()
public String toString()
public void setError(String summary)
public boolean isValid()
public void checkValidity()
public String getErrorSummary()
public boolean equals(Object object)
public int hashCode()
public void clear()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |