public class KnowledgePackageImpl extends Object implements InternalKnowledgePackage, Externalizable
| Constructor and Description |
|---|
KnowledgePackageImpl() |
KnowledgePackageImpl(String name)
Construct.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAccumulateFunction(String name,
org.kie.api.runtime.rule.AccumulateFunction function) |
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(RuleImpl 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() |
KnowledgePackageImpl |
deepCloneIfAlreadyInUse(ClassLoader classLoader) |
boolean |
equals(Object object) |
Map<String,org.kie.api.runtime.rule.AccumulateFunction> |
getAccumulateFunctions() |
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) |
Collection<org.kie.api.definition.type.FactType> |
getFactTypes() |
Map<String,org.kie.api.definition.type.FactType> |
getFactTypesMap() |
Function |
getFunction(String name) |
Collection<String> |
getFunctionNames() |
Map<String,Function> |
getFunctions() |
Map<String,String> |
getGlobals() |
Collection<org.kie.api.definition.rule.Global> |
getGlobalVariables() |
Map<String,ImportDeclaration> |
getImports() |
String |
getName()
Retrieve the name of this
Package. |
ClassLoader |
getPackageClassLoader() |
Collection<org.kie.api.definition.process.Process> |
getProcesses() |
Collection<org.kie.api.definition.rule.Query> |
getQueries() |
Map<org.kie.api.io.ResourceType,org.kie.internal.io.ResourceTypePackage> |
getResourceTypePackages() |
RuleImpl |
getRule(String name)
Retrieve a
Rule by name. |
Map<String,org.kie.api.definition.process.Process> |
getRuleFlows()
Get the rule flows for this package.
|
Collection<org.kie.api.definition.rule.Rule> |
getRules() |
Set<String> |
getStaticImports() |
TraitRegistry |
getTraitRegistry() |
TypeDeclaration |
getTypeDeclaration(Class<?> clazz) |
TypeDeclaration |
getTypeDeclaration(String type) |
Map<String,TypeDeclaration> |
getTypeDeclarations() |
TypeResolver |
getTypeResolver() |
Map<String,WindowDeclaration> |
getWindowDeclarations() |
int |
hashCode() |
boolean |
hasTraitRegistry() |
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) |
List<org.kie.api.definition.process.Process> |
removeProcessesGeneratedFromResource(org.kie.api.io.Resource resource) |
void |
removeRule(RuleImpl rule) |
void |
removeRuleFlow(String id)
Rule flows can be removed by ID.
|
List<RuleImpl> |
removeRulesGeneratedFromResource(org.kie.api.io.Resource resource) |
void |
removeTypeDeclaration(String type) |
List<TypeDeclaration> |
removeTypesGeneratedFromResource(org.kie.api.io.Resource resource) |
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 KnowledgePackageImpl()
public KnowledgePackageImpl(String name)
name - The name of this Package.public Map<org.kie.api.io.ResourceType,org.kie.internal.io.ResourceTypePackage> getResourceTypePackages()
getResourceTypePackages in interface InternalKnowledgePackagepublic Collection<org.kie.api.definition.rule.Rule> getRules()
getRules in interface org.kie.api.definition.KiePackagepublic Collection<org.kie.api.definition.process.Process> getProcesses()
getProcesses in interface org.kie.api.definition.KiePackagepublic Collection<org.kie.api.definition.type.FactType> getFactTypes()
getFactTypes in interface org.kie.api.definition.KiePackagepublic Collection<org.kie.api.definition.rule.Query> getQueries()
getQueries in interface org.kie.api.definition.KiePackagepublic Collection<String> getFunctionNames()
getFunctionNames in interface org.kie.api.definition.KiePackagepublic Collection<org.kie.api.definition.rule.Global> getGlobalVariables()
getGlobalVariables in interface org.kie.api.definition.KiePackagepublic void writeExternal(ObjectOutput stream) throws IOException
writeExternal in interface Externalizablestream - out the stream to write the object to; should be an instance
of DroolsObjectOutputStream or OutputStreamIOExceptionpublic void readExternal(ObjectInput stream) throws IOException, ClassNotFoundException
readExternal in interface Externalizablestream, - the stream to read data from in order to restore the object;
should be an instance of DroolsObjectInputStream or
InputStreamIOExceptionClassNotFoundExceptionpublic String getName()
Package.getName in interface org.kie.api.definition.KiePackagePackage.public ClassLoader getPackageClassLoader()
getPackageClassLoader in interface InternalKnowledgePackagepublic DialectRuntimeRegistry getDialectRuntimeRegistry()
getDialectRuntimeRegistry in interface InternalKnowledgePackagepublic void setDialectRuntimeRegistry(DialectRuntimeRegistry dialectRuntimeRegistry)
setDialectRuntimeRegistry in interface InternalKnowledgePackagepublic void addImport(ImportDeclaration importDecl)
addImport in interface InternalKnowledgePackagepublic void removeImport(String importEntry)
public Map<String,ImportDeclaration> getImports()
getImports in interface InternalKnowledgePackagepublic void addTypeDeclaration(TypeDeclaration typeDecl)
addTypeDeclaration in interface InternalKnowledgePackagepublic void removeTypeDeclaration(String type)
public Map<String,TypeDeclaration> getTypeDeclarations()
getTypeDeclarations in interface InternalKnowledgePackagepublic TypeDeclaration getTypeDeclaration(Class<?> clazz)
getTypeDeclaration in interface InternalKnowledgePackagepublic TypeDeclaration getTypeDeclaration(String type)
getTypeDeclaration in interface InternalKnowledgePackagepublic void addStaticImport(String functionImport)
addStaticImport in interface InternalKnowledgePackagepublic void addFunction(Function function)
addFunction in interface InternalKnowledgePackagepublic Map<String,Function> getFunctions()
getFunctions in interface InternalKnowledgePackagepublic void addAccumulateFunction(String name, org.kie.api.runtime.rule.AccumulateFunction function)
addAccumulateFunction in interface InternalKnowledgePackagepublic Map<String,org.kie.api.runtime.rule.AccumulateFunction> getAccumulateFunctions()
getAccumulateFunctions in interface InternalKnowledgePackagepublic void removeFunctionImport(String functionImport)
public Set<String> getStaticImports()
getStaticImports in interface InternalKnowledgePackagepublic void addGlobal(String identifier, Class<?> clazz)
addGlobal in interface InternalKnowledgePackagepublic void removeGlobal(String identifier)
removeGlobal in interface InternalKnowledgePackagepublic Map<String,String> getGlobals()
getGlobals in interface InternalKnowledgePackagepublic void removeFunction(String functionName)
removeFunction in interface InternalKnowledgePackagepublic FactTemplate getFactTemplate(String name)
getFactTemplate in interface InternalKnowledgePackagepublic void addFactTemplate(FactTemplate factTemplate)
addFactTemplate in interface InternalKnowledgePackagepublic void addRule(RuleImpl rule)
Rule to this Package.addRule in interface InternalKnowledgePackagerule - 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)
addProcess in interface InternalKnowledgePackagepublic Map<String,org.kie.api.definition.process.Process> getRuleFlows()
getRuleFlows in interface InternalKnowledgePackagepublic void removeRuleFlow(String id)
removeRuleFlow in interface InternalKnowledgePackagepublic void removeRule(RuleImpl rule)
removeRule in interface InternalKnowledgePackagepublic RuleImpl getRule(String name)
Rule by name.getRule in interface InternalKnowledgePackagename - The name of the Rule to retrieve.Rule, or null if not
such Rule has been added to this
Package.public void setError(String summary)
setError in interface InternalKnowledgePackagepublic void resetErrors()
resetErrors in interface InternalKnowledgePackagepublic boolean isValid()
isValid in interface InternalKnowledgePackagepublic void checkValidity()
checkValidity in interface InternalKnowledgePackagepublic String getErrorSummary()
public void clear()
clear in interface InternalKnowledgePackagepublic org.kie.api.definition.type.FactType getFactType(String typeName)
getFactType in interface InternalKnowledgePackagepublic ClassFieldAccessorStore getClassFieldAccessorStore()
getClassFieldAccessorStore in interface InternalKnowledgePackagepublic void setClassFieldAccessorCache(ClassFieldAccessorCache classFieldAccessorCache)
setClassFieldAccessorCache in interface InternalKnowledgePackagepublic Set<String> getEntryPointIds()
getEntryPointIds in interface InternalKnowledgePackagepublic void addEntryPointId(String id)
addEntryPointId in interface InternalKnowledgePackagepublic TypeResolver getTypeResolver()
getTypeResolver in interface InternalKnowledgePackagepublic void setTypeResolver(TypeResolver typeResolver)
setTypeResolver in interface InternalKnowledgePackagepublic void addWindowDeclaration(WindowDeclaration window)
addWindowDeclaration in interface InternalKnowledgePackagepublic Map<String,WindowDeclaration> getWindowDeclarations()
getWindowDeclarations in interface InternalKnowledgePackagepublic void setWindowDeclarations(Map<String,WindowDeclaration> windowDeclarations)
public boolean hasTraitRegistry()
hasTraitRegistry in interface InternalKnowledgePackagepublic TraitRegistry getTraitRegistry()
getTraitRegistry in interface InternalKnowledgePackagepublic boolean removeObjectsGeneratedFromResource(org.kie.api.io.Resource resource)
removeObjectsGeneratedFromResource in interface InternalKnowledgePackagepublic List<TypeDeclaration> removeTypesGeneratedFromResource(org.kie.api.io.Resource resource)
removeTypesGeneratedFromResource in interface InternalKnowledgePackagepublic List<RuleImpl> removeRulesGeneratedFromResource(org.kie.api.io.Resource resource)
removeRulesGeneratedFromResource in interface InternalKnowledgePackagepublic List<Function> removeFunctionsGeneratedFromResource(org.kie.api.io.Resource resource)
removeFunctionsGeneratedFromResource in interface InternalKnowledgePackagepublic List<org.kie.api.definition.process.Process> removeProcessesGeneratedFromResource(org.kie.api.io.Resource resource)
removeProcessesGeneratedFromResource in interface InternalKnowledgePackagepublic boolean needsStreamMode()
public void setNeedStreamMode()
setNeedStreamMode in interface InternalKnowledgePackagepublic KnowledgePackageImpl deepCloneIfAlreadyInUse(ClassLoader classLoader)
deepCloneIfAlreadyInUse in interface InternalKnowledgePackageCopyright © 2001–2016 JBoss by Red Hat. All rights reserved.