Package org.drools.core.rule
Interface FactType
-
- All Superinterfaces:
Externalizable
,Serializable
public interface FactType extends Externalizable
FactType declarations are fact definitions (like classes) that are managed alongside the rules. You then communicate with the rulebase/knowledge base by using instances created by this. There are utility set and get methods on this, as well as in the FieldAccessors. The Object that is used is a javabean (which was generated by the rules). You can also use reflection on it as normal.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Object
get(Object bean, String field)
get the value of the specified field on the dynamic fact.Map<String,Object>
getAsMap(Object bean)
Get a map of the fields and their values for the bean.Class<?>
getFactClass()
FactField
getField(String name)
List<FactField>
getFields()
String
getName()
Object
newInstance()
Create a new fact based on the declared fact type.void
set(Object bean, String field, Object value)
Set the value of the field on a dynamic fact.void
setFromMap(Object bean, Map<String,Object> values)
Set the values of the bean from a map.-
Methods inherited from interface java.io.Externalizable
readExternal, writeExternal
-
-
-
-
Method Detail
-
getName
String getName()
-
getFactClass
Class<?> getFactClass()
-
newInstance
Object newInstance() throws InstantiationException, IllegalAccessException
Create a new fact based on the declared fact type. This object will normally be a javabean.
-
set
void set(Object bean, String field, Object value)
Set the value of the field on a dynamic fact.
-
get
Object get(Object bean, String field)
get the value of the specified field on the dynamic fact.
-
getAsMap
Map<String,Object> getAsMap(Object bean)
Get a map of the fields and their values for the bean.
-
-