Knowledge API Legacy5 Adapter 6.0.0.CR4-Pre1

org.drools.impl.adapters
Class FactTypeAdapter

java.lang.Object
  extended by org.drools.impl.adapters.FactTypeAdapter
All Implemented Interfaces:
Externalizable, Serializable, FactType

public class FactTypeAdapter
extends Object
implements FactType

See Also:
Serialized Form

Constructor Summary
FactTypeAdapter(org.kie.api.definition.type.FactType delegate)
           
 
Method Summary
static List<FactType> adaptFactTypes(Collection<org.kie.api.definition.type.FactType> factTypes)
           
 Object get(Object bean, String field)
          Gets 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.
 List<Annotation> getClassAnnotations()
          Returns the list of class-level annotations used in this class definition
 Class<?> getFactClass()
          Returns the Class
 FactField getField(String name)
          Returns the FactField identified by the given name.
 List<FactField> getFields()
          Returns the list of FactField in this FactType
 Map<String,Object> getMetaData()
          Returns the annotations of this class definition as key-value pairs.
 String getName()
          Returns the fully qualified name of the FactType.
 String getPackageName()
          Returns the package this FactType is defined in.
 String getSimpleName()
          Returns the unqualified name of the FactType.
 String getSuperClass()
          Returns the name of the FactType's super type
 Object newInstance()
          Create a new fact based on the declared fact type.
 void readExternal(ObjectInput in)
           
 void set(Object bean, String field, Object value)
          Sets the value of the field on a fact.
 void setFromMap(Object bean, Map<String,Object> values)
          Sets the values of the bean from a map.
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FactTypeAdapter

public FactTypeAdapter(org.kie.api.definition.type.FactType delegate)
Method Detail

getName

public String getName()
Description copied from interface: FactType
Returns the fully qualified name of the FactType.

Specified by:
getName in interface FactType
Returns:
the name of the fact type.

getSimpleName

public String getSimpleName()
Description copied from interface: FactType
Returns the unqualified name of the FactType.

Specified by:
getSimpleName in interface FactType
Returns:
the name of the fact type.

getPackageName

public String getPackageName()
Description copied from interface: FactType
Returns the package this FactType is defined in.

Specified by:
getPackageName in interface FactType
Returns:
the name of the fact type's package.

getSuperClass

public String getSuperClass()
Description copied from interface: FactType
Returns the name of the FactType's super type

Specified by:
getSuperClass in interface FactType
Returns:
the name of the fact type's super type.

getFields

public List<FactField> getFields()
Description copied from interface: FactType
Returns the list of FactField in this FactType

Specified by:
getFields in interface FactType
Returns:
the list of the fields in this FactType

getField

public FactField getField(String name)
Description copied from interface: FactType
Returns the FactField identified by the given name.

Specified by:
getField in interface FactType
Parameters:
name - the name of the FactField
Returns:
the FactField instance identified by the given name or null if none is found.

getFactClass

public Class<?> getFactClass()
Description copied from interface: FactType
Returns the Class for this FactType. The class object can be used through reflection.

Specified by:
getFactClass in interface FactType
Returns:
the generated class for this FactType

newInstance

public Object newInstance()
                   throws InstantiationException,
                          IllegalAccessException
Description copied from interface: FactType
Create a new fact based on the declared fact type. This object will usually be a javabean.

Specified by:
newInstance in interface FactType
Throws:
InstantiationException
IllegalAccessException

set

public void set(Object bean,
                String field,
                Object value)
Description copied from interface: FactType
Sets the value of the field on a fact.

Specified by:
set in interface FactType
Parameters:
bean - the object on which the field will be set.
field - the name of the field to set.
value - the value to be set on the field.

get

public Object get(Object bean,
                  String field)
Description copied from interface: FactType
Gets the value of the specified field on the dynamic fact.

Specified by:
get in interface FactType
Parameters:
bean - the fact to read the field value from.
field - the name of the field to read.
Returns:
the value of the field read from the fact

getAsMap

public Map<String,Object> getAsMap(Object bean)
Description copied from interface: FactType
Get a map of the fields and their values for the bean.

Specified by:
getAsMap in interface FactType
Parameters:
bean - the bean to read the fields from.
Returns:
a map of field names and corresponding values on the bean.

setFromMap

public void setFromMap(Object bean,
                       Map<String,Object> values)
Description copied from interface: FactType
Sets the values of the bean from a map.

Specified by:
setFromMap in interface FactType
Parameters:
bean - the fact to set the values of the fields on
values - a map of field names and values to set

getClassAnnotations

public List<Annotation> getClassAnnotations()
Description copied from interface: FactType
Returns the list of class-level annotations used in this class definition

Specified by:
getClassAnnotations in interface FactType
Returns:
the list of class-level annotations

getMetaData

public Map<String,Object> getMetaData()
Description copied from interface: FactType
Returns the annotations of this class definition as key-value pairs.

Specified by:
getMetaData in interface FactType
Returns:
a key-value map of the class-level annotations

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Throws:
IOException

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Throws:
IOException
ClassNotFoundException

adaptFactTypes

public static List<FactType> adaptFactTypes(Collection<org.kie.api.definition.type.FactType> factTypes)

Knowledge API Legacy5 Adapter 6.0.0.CR4-Pre1

Copyright © 2001-2013 JBoss by Red Hat. All Rights Reserved.