public class Package extends Object implements Externalizable
Rule
s.Rule
,
Serialized FormConstructor and Description |
---|
Package()
Default constructor - for Externalizable.
|
Package(String name)
Construct.
|
Modifier and Type | Method and Description |
---|---|
void |
addEntryPointId(String id) |
void |
addFactTemplate(FactTemplate factTemplate) |
void |
addFunction(Function function) |
void |
addGlobal(String identifier,
Class<?> clazz) |
void |
addImport(ImportDeclaration importDecl) |
void |
addProcess(org.kie.api.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 |
addWindowDeclaration(WindowDeclaration window) |
void |
checkValidity()
This will throw an exception if the package is not valid
|
void |
clear() |
Package |
deepCloneIfAlreadyInUse(ClassLoader classLoader) |
boolean |
equals(Object object) |
ClassFieldAccessorStore |
getClassFieldAccessorStore() |
DialectRuntimeRegistry |
getDialectRuntimeRegistry() |
Set<String> |
getEntryPointIds() |
String |
getErrorSummary()
This will return the error summary (if any) if the package is invalid.
|
FactTemplate |
getFactTemplate(String name) |
org.kie.api.definition.type.FactType |
getFactType(String typeName) |
Map<String,org.kie.api.definition.type.FactType> |
getFactTypes() |
Map<String,Function> |
getFunctions() |
List<Function> |
getFunctionsGeneratedFromResource(org.kie.api.io.Resource resource) |
Map<String,String> |
getGlobals() |
Map<String,ImportDeclaration> |
getImports() |
String |
getName()
Retrieve the name of this
Package . |
ClassLoader |
getPackageClassLoader() |
Rule |
getRule(String name)
Retrieve a
Rule by name. |
Map<String,org.kie.api.definition.process.Process> |
getRuleFlows()
Get the rule flows for this package.
|
Rule[] |
getRules()
Retrieve all
Rules in this Package . |
List<Rule> |
getRulesGeneratedFromResource(org.kie.api.io.Resource resource) |
Set<String> |
getStaticImports() |
TraitRegistry |
getTraitRegistry() |
TypeDeclaration |
getTypeDeclaration(Class<?> clazz) |
TypeDeclaration |
getTypeDeclaration(String type) |
Map<String,TypeDeclaration> |
getTypeDeclarations() |
TypeResolver |
getTypeResolver() |
List<TypeDeclaration> |
getTypesGeneratedFromResource(org.kie.api.io.Resource resource) |
Map<String,WindowDeclaration> |
getWindowDeclarations() |
int |
hashCode() |
boolean |
hasTraitRegistry() |
boolean |
isEvent(Class clazz)
Returns true if clazz is imported as an Event class in this package
|
boolean |
isValid() |
boolean |
needsStreamMode() |
void |
readExternal(ObjectInput stream)
Handles the read serialization of the Package.
|
void |
removeFunction(String functionName) |
void |
removeFunctionImport(String functionImport) |
List<Function> |
removeFunctionsGeneratedFromResource(org.kie.api.io.Resource resource) |
void |
removeGlobal(String identifier) |
void |
removeImport(String importEntry) |
boolean |
removeObjectsGeneratedFromResource(org.kie.api.io.Resource resource) |
void |
removeRule(Rule rule) |
void |
removeRuleFlow(String id)
Rule flows can be removed by ID.
|
List<Rule> |
removeRulesGeneratedFromResource(org.kie.api.io.Resource resource) |
void |
removeTypeDeclaration(String type) |
void |
resetErrors()
Once this is called, the package will be marked as invalid
|
void |
setClassFieldAccessorCache(ClassFieldAccessorCache classFieldAccessorCache) |
void |
setDialectRuntimeRegistry(DialectRuntimeRegistry dialectRuntimeRegistry) |
void |
setError(String summary)
Once this is called, the package will be marked as invalid
|
void |
setNeedStreamMode() |
void |
setTypeResolver(TypeResolver typeResolver) |
void |
setWindowDeclarations(Map<String,WindowDeclaration> windowDeclarations) |
String |
toString() |
void |
writeExternal(ObjectOutput stream)
Handles the write serialization of the Package.
|
public Package()
public Package(String name)
name
- The name of this Package
.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 OutputStreamIOException
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
InputStreamIOException
ClassNotFoundException
public String getName()
Package
.Package
.public ClassLoader getPackageClassLoader()
public DialectRuntimeRegistry getDialectRuntimeRegistry()
public void setDialectRuntimeRegistry(DialectRuntimeRegistry dialectRuntimeRegistry)
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(Class<?> clazz)
public TypeDeclaration getTypeDeclaration(String type)
public void addStaticImport(String functionImport)
public void addFunction(Function function)
public void removeFunctionImport(String functionImport)
public void removeGlobal(String identifier)
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.kie.api.definition.process.Process process)
public Map<String,org.kie.api.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 void setError(String summary)
public void resetErrors()
public boolean isValid()
public void checkValidity()
public String getErrorSummary()
public boolean isEvent(Class clazz)
clazz
- public void clear()
public org.kie.api.definition.type.FactType getFactType(String typeName)
public ClassFieldAccessorStore getClassFieldAccessorStore()
public void setClassFieldAccessorCache(ClassFieldAccessorCache classFieldAccessorCache)
public void addEntryPointId(String id)
public TypeResolver getTypeResolver()
public void setTypeResolver(TypeResolver typeResolver)
public void addWindowDeclaration(WindowDeclaration window)
public Map<String,WindowDeclaration> getWindowDeclarations()
public void setWindowDeclarations(Map<String,WindowDeclaration> windowDeclarations)
public boolean hasTraitRegistry()
public TraitRegistry getTraitRegistry()
public boolean removeObjectsGeneratedFromResource(org.kie.api.io.Resource resource)
public List<Rule> removeRulesGeneratedFromResource(org.kie.api.io.Resource resource)
public List<Rule> getRulesGeneratedFromResource(org.kie.api.io.Resource resource)
public List<TypeDeclaration> getTypesGeneratedFromResource(org.kie.api.io.Resource resource)
public List<Function> removeFunctionsGeneratedFromResource(org.kie.api.io.Resource resource)
public List<Function> getFunctionsGeneratedFromResource(org.kie.api.io.Resource resource)
public boolean needsStreamMode()
public void setNeedStreamMode()
public Package deepCloneIfAlreadyInUse(ClassLoader classLoader)
Copyright © 2001-2014 JBoss by Red Hat. All Rights Reserved.