org.drools.rule
Class TypeDeclaration

java.lang.Object
  extended by org.drools.rule.TypeDeclaration
All Implemented Interfaces:
Externalizable, Serializable, org.drools.definition.KnowledgeDefinition

public class TypeDeclaration
extends Object
implements org.drools.definition.KnowledgeDefinition, Externalizable

The type declaration class stores all type's metadata declared in source files.

See Also:
Serialized Form

Nested Class Summary
 class TypeDeclaration.DurationAccessorSetter
           
static class TypeDeclaration.Format
           
static class TypeDeclaration.Kind
           
static class TypeDeclaration.Role
           
 class TypeDeclaration.TimestampAccessorSetter
           
 
Nested classes/interfaces inherited from interface org.drools.definition.KnowledgeDefinition
org.drools.definition.KnowledgeDefinition.KnowledgeType
 
Field Summary
static String ATTR_CLASS
           
static String ATTR_DURATION
           
static String ATTR_EXPIRE
           
static String ATTR_FIELD_POSITION
           
static String ATTR_KEY
           
static String ATTR_PROP_CHANGE_SUPPORT
           
static String ATTR_TIMESTAMP
           
static String ATTR_TYPESAFE
           
static int FORMAT_BIT
           
static int KIND_BIT
           
static int ROLE_BIT
           
 int setMask
           
static int TYPESAFE_BIT
           
 
Constructor Summary
TypeDeclaration()
           
TypeDeclaration(String typeName)
           
 
Method Summary
 boolean equals(Object obj)
          
 String getDurationAttribute()
           
 InternalReadAccessor getDurationExtractor()
           
 long getExpirationOffset()
           
 TypeDeclaration.Format getFormat()
           
 String getId()
           
 TypeDeclaration.Kind getKind()
           
 org.drools.definition.KnowledgeDefinition.KnowledgeType getKnowledgeType()
           
 String getNamespace()
           
 ObjectType getObjectType()
           
 org.drools.io.Resource getResource()
           
 TypeDeclaration.Role getRole()
           
 int getSetMask()
           
 String getTimestampAttribute()
           
 InternalReadAccessor getTimestampExtractor()
           
 Class<?> getTypeClass()
           
 ClassDefinition getTypeClassDef()
           
 String getTypeClassName()
           
 String getTypeName()
           
 FactTemplate getTypeTemplate()
           
 int hashCode()
          
 boolean isDynamic()
           
 boolean isNovel()
           
 boolean isTypesafe()
           
 boolean matches(Object clazz)
          Returns true if the given parameter matches this type declaration
 void readExternal(ObjectInput in)
           
 void setDurationAttribute(String durationAttribute)
           
 void setDurationExtractor(InternalReadAccessor durationExtractor)
           
 void setDynamic(boolean dynamic)
           
 void setExpirationOffset(long expirationOffset)
           
 void setFormat(TypeDeclaration.Format format)
           
 void setKind(TypeDeclaration.Kind kind)
           
 void setNovel(boolean novel)
           
 void setResource(org.drools.io.Resource resource)
           
 void setRole(TypeDeclaration.Role role)
           
 void setTimestampAttribute(String timestampAttribute)
           
 void setTimestampExtractor(InternalReadAccessor timestampExtractor)
           
 void setTypeClass(Class<?> typeClass)
           
 void setTypeClassDef(ClassDefinition typeClassDef)
           
 void setTypeClassName(String typeClassName)
           
 void setTypesafe(boolean typesafe)
           
 void setTypeTemplate(FactTemplate typeTemplate)
           
 String toString()
           
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ROLE_BIT

public static final int ROLE_BIT
See Also:
Constant Field Values

TYPESAFE_BIT

public static final int TYPESAFE_BIT
See Also:
Constant Field Values

FORMAT_BIT

public static final int FORMAT_BIT
See Also:
Constant Field Values

KIND_BIT

public static final int KIND_BIT
See Also:
Constant Field Values

ATTR_CLASS

public static final String ATTR_CLASS
See Also:
Constant Field Values

ATTR_TYPESAFE

public static final String ATTR_TYPESAFE
See Also:
Constant Field Values

ATTR_DURATION

public static final String ATTR_DURATION
See Also:
Constant Field Values

ATTR_TIMESTAMP

public static final String ATTR_TIMESTAMP
See Also:
Constant Field Values

ATTR_EXPIRE

public static final String ATTR_EXPIRE
See Also:
Constant Field Values

ATTR_KEY

public static final String ATTR_KEY
See Also:
Constant Field Values

ATTR_FIELD_POSITION

public static final String ATTR_FIELD_POSITION
See Also:
Constant Field Values

ATTR_PROP_CHANGE_SUPPORT

public static final String ATTR_PROP_CHANGE_SUPPORT
See Also:
Constant Field Values

setMask

public int setMask
Constructor Detail

TypeDeclaration

public TypeDeclaration()

TypeDeclaration

public TypeDeclaration(String typeName)
Method Detail

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

getSetMask

public int getSetMask()

getTypeName

public String getTypeName()
Returns:
the type

getRole

public TypeDeclaration.Role getRole()
Returns:
the category

setRole

public void setRole(TypeDeclaration.Role role)
Parameters:
role - the category to set

getFormat

public TypeDeclaration.Format getFormat()
Returns:
the format

setFormat

public void setFormat(TypeDeclaration.Format format)
Parameters:
format - the format to set

getKind

public TypeDeclaration.Kind getKind()
Returns:
the kind

setKind

public void setKind(TypeDeclaration.Kind kind)
Parameters:
kind - the kind to set

getTimestampAttribute

public String getTimestampAttribute()
Returns:
the timestampAttribute

setTimestampAttribute

public void setTimestampAttribute(String timestampAttribute)
Parameters:
timestampAttribute - the timestampAttribute to set

getDurationAttribute

public String getDurationAttribute()
Returns:
the durationAttribute

setDurationAttribute

public void setDurationAttribute(String durationAttribute)
Parameters:
durationAttribute - the durationAttribute to set

getTypeClass

public Class<?> getTypeClass()
Returns:
the typeClass

setTypeClass

public void setTypeClass(Class<?> typeClass)
Parameters:
typeClass - the typeClass to set

getTypeTemplate

public FactTemplate getTypeTemplate()
Returns:
the typeTemplate

setTypeTemplate

public void setTypeTemplate(FactTemplate typeTemplate)
Parameters:
typeTemplate - the typeTemplate to set

matches

public boolean matches(Object clazz)
Returns true if the given parameter matches this type declaration

Parameters:
clazz -
Returns:

hashCode

public int hashCode()

Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)

Overrides:
equals in class Object

getDurationExtractor

public InternalReadAccessor getDurationExtractor()

setDurationExtractor

public void setDurationExtractor(InternalReadAccessor durationExtractor)

getTypeClassDef

public ClassDefinition getTypeClassDef()
Returns:
the typeClassDef

setTypeClassDef

public void setTypeClassDef(ClassDefinition typeClassDef)
Parameters:
typeClassDef - the typeClassDef to set

getTimestampExtractor

public InternalReadAccessor getTimestampExtractor()

setTimestampExtractor

public void setTimestampExtractor(InternalReadAccessor timestampExtractor)

getResource

public org.drools.io.Resource getResource()

setResource

public void setResource(org.drools.io.Resource resource)

getObjectType

public ObjectType getObjectType()

getExpirationOffset

public long getExpirationOffset()

setExpirationOffset

public void setExpirationOffset(long expirationOffset)

getTypeClassName

public String getTypeClassName()

setTypeClassName

public void setTypeClassName(String typeClassName)

isDynamic

public boolean isDynamic()

setDynamic

public void setDynamic(boolean dynamic)

isTypesafe

public boolean isTypesafe()

setTypesafe

public void setTypesafe(boolean typesafe)

isNovel

public boolean isNovel()

setNovel

public void setNovel(boolean novel)

toString

public String toString()
Overrides:
toString in class Object

getKnowledgeType

public org.drools.definition.KnowledgeDefinition.KnowledgeType getKnowledgeType()
Specified by:
getKnowledgeType in interface org.drools.definition.KnowledgeDefinition

getNamespace

public String getNamespace()
Specified by:
getNamespace in interface org.drools.definition.KnowledgeDefinition

getId

public String getId()
Specified by:
getId in interface org.drools.definition.KnowledgeDefinition


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