org.drools.factmodel
Class ClassDefinition
java.lang.Object
org.drools.factmodel.ClassDefinition
- All Implemented Interfaces:
- Externalizable, Serializable, org.drools.definition.type.FactType
- Direct Known Subclasses:
- EnumClassDefinition
public class ClassDefinition
- extends Object
- implements org.drools.definition.type.FactType
Declares a class to be dynamically created
- See Also:
- Serialized Form
ClassDefinition
public ClassDefinition()
ClassDefinition
public ClassDefinition(String className)
ClassDefinition
public ClassDefinition(String className,
String superClass)
ClassDefinition
public ClassDefinition(String className,
String superClass,
String[] interfaces)
readExternal
public void readExternal(ObjectInput in)
throws IOException,
ClassNotFoundException
- Specified by:
readExternal in interface Externalizable
- Throws:
IOException
ClassNotFoundException
writeExternal
public void writeExternal(ObjectOutput out)
throws IOException
- Specified by:
writeExternal in interface Externalizable
- Throws:
IOException
getClassName
public final String getClassName()
- Returns:
- Returns the name.
setClassName
public final void setClassName(String className)
- Parameters:
className - The name to set.
getDefinedClass
public final Class<?> getDefinedClass()
- Returns:
- Returns the className.
setDefinedClass
public void setDefinedClass(Class<?> definedClass)
- Parameters:
definedClass - The class to set.
addField
public final void addField(FieldDefinition attr)
- Adds a field definition to this class
- Parameters:
attr -
getFieldsDefinitions
public final Collection<FieldDefinition> getFieldsDefinitions()
- Returns:
- Returns an unmodifiable collection of field definitions
getField
public final FieldDefinition getField(String fieldName)
- Returns the field definition object for the given field name
- Specified by:
getField in interface org.drools.definition.type.FactType
- Parameters:
fieldName -
- Returns:
getField
public FieldDefinition getField(int index)
- Returns the field at position index, as defined by the builder using the @position annotation
- Parameters:
index -
- Returns:
- the index-th field
getInterfaces
public final String[] getInterfaces()
- Returns:
- Returns the interfaces.
setInterfaces
public final void setInterfaces(String[] interfaces)
- Parameters:
interfaces - The interfaces to set.
getSuperClass
public final String getSuperClass()
- Specified by:
getSuperClass in interface org.drools.definition.type.FactType
- Returns:
- Returns the superClass.
setSuperClass
public final void setSuperClass(String superClass)
- Parameters:
superClass - The superClass to set.
getName
public String getName()
- Specified by:
getName in interface org.drools.definition.type.FactType
newInstance
public Object newInstance()
throws InstantiationException,
IllegalAccessException
- Specified by:
newInstance in interface org.drools.definition.type.FactType
- Throws:
InstantiationException
IllegalAccessException
getFactClass
public Class<?> getFactClass()
- Specified by:
getFactClass in interface org.drools.definition.type.FactType
getFields
public List<org.drools.definition.type.FactField> getFields()
- Specified by:
getFields in interface org.drools.definition.type.FactType
get
public Object get(Object bean,
String field)
- Specified by:
get in interface org.drools.definition.type.FactType
set
public void set(Object bean,
String field,
Object value)
- Specified by:
set in interface org.drools.definition.type.FactType
getAsMap
public Map<String,Object> getAsMap(Object bean)
- Specified by:
getAsMap in interface org.drools.definition.type.FactType
setFromMap
public void setFromMap(Object bean,
Map<String,Object> data)
- Specified by:
setFromMap in interface org.drools.definition.type.FactType
addAnnotation
public void addAnnotation(AnnotationDefinition annotationDefinition)
getAnnotations
public List<AnnotationDefinition> getAnnotations()
addModifiedPropsByMethod
public void addModifiedPropsByMethod(Method method,
List<String> props)
getModifiedPropsByMethod
public List<String> getModifiedPropsByMethod(Method method)
getModifiedPropsByMethod
public List<String> getModifiedPropsByMethod(String methodName)
isTraitable
public boolean isTraitable()
setTraitable
public void setTraitable(boolean traitable)
isAbstrakt
public boolean isAbstrakt()
setAbstrakt
public void setAbstrakt(boolean abstrakt)
toString
public String toString()
- Overrides:
toString in class Object
Copyright © 2001-2012 JBoss by Red Hat. All Rights Reserved.