Class TypeDeclaration

java.lang.Object
org.drools.base.rule.TypeDeclaration
All Implemented Interfaces:
Externalizable, Serializable, Comparable<TypeDeclaration>, KieDefinition, KnowledgeDefinition

public class TypeDeclaration extends Object implements KnowledgeDefinition, Externalizable, Comparable<TypeDeclaration>
The type declaration class stores all type's metadata declared in source files.
See Also:
  • Field Details

  • Constructor Details

    • TypeDeclaration

      public TypeDeclaration()
    • TypeDeclaration

      public TypeDeclaration(String typeName)
  • Method Details

    • 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 Role.Type getRole()
      Returns:
      the category
    • setRole

      public void setRole(Role.Type 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
    • getNature

      public TypeDeclaration.Nature getNature()
    • setNature

      public void setNature(TypeDeclaration.Nature nature)
    • 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
    • isValid

      public boolean isValid()
    • setValid

      public void setValid(boolean valid)
    • getTypeClass

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

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

      public boolean isDefinition()
    • isGeneratedFact

      public boolean isGeneratedFact()
    • getPrototype

      public Prototype getPrototype()
    • matches

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

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • getDurationExtractor

      public ReadAccessor getDurationExtractor()
    • setDurationExtractor

      public void setDurationExtractor(ReadAccessor durationExtractor)
    • getTypeClassDef

      public ClassDefinition getTypeClassDef()
      Returns:
      the typeClassDef
    • setTypeClassDef

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

      public ReadAccessor getTimestampExtractor()
    • setTimestampExtractor

      public void setTimestampExtractor(ReadAccessor timestampExtractor)
    • getResource

      public Resource getResource()
    • setResource

      public void setResource(Resource resource)
    • getObjectType

      public ObjectType getObjectType()
    • getExpirationOffset

      public long getExpirationOffset()
    • setExpirationOffset

      public void setExpirationOffset(long expirationOffset)
    • getExpirationPolicy

      public Expires.Policy getExpirationPolicy()
    • setExpirationType

      public void setExpirationType(Expires.Policy expirationPolicy)
    • getTypeClassName

      public String getTypeClassName()
    • setTypeClassName

      public void setTypeClassName(String typeClassName)
    • isJavaBased

      public boolean isJavaBased()
    • isDynamic

      public boolean isDynamic()
    • setDynamic

      public void setDynamic(boolean dynamic)
    • isTypesafe

      public boolean isTypesafe()
    • setTypesafe

      public void setTypesafe(boolean typesafe)
    • isPropertyReactive

      public boolean isPropertyReactive()
    • setPropertyReactive

      public void setPropertyReactive(boolean propertyReactive)
    • isNovel

      public boolean isNovel()
    • setNovel

      public void setNovel(boolean novel)
    • getAccessibleProperties

      public List<String> getAccessibleProperties()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getKnowledgeType

      public KieDefinition.KnowledgeType getKnowledgeType()
      Specified by:
      getKnowledgeType in interface KieDefinition
    • getNamespace

      public String getNamespace()
      Specified by:
      getNamespace in interface KieDefinition
    • getFullName

      public String getFullName()
    • getId

      public String getId()
      Specified by:
      getId in interface KieDefinition
    • getOrder

      public int getOrder()
    • setOrder

      public void setOrder(int order)
    • compareTo

      public int compareTo(TypeDeclaration o)
      Specified by:
      compareTo in interface Comparable<TypeDeclaration>
    • createTypeDeclarationForBean

      public static TypeDeclaration createTypeDeclarationForBean(Class<?> cls)
    • createTypeDeclarationForBean

      public static TypeDeclaration createTypeDeclarationForBean(Class<?> cls, PropertySpecificOption propertySpecificOption)
    • createTypeDeclarationForBean

      public static TypeDeclaration createTypeDeclarationForBean(Class<?> cls, Annotated annotated, PropertySpecificOption propertySpecificOption)
    • processTypeAnnotations

      public static void processTypeAnnotations(TypeDeclaration type, Annotated annotated, PropertySpecificOption propertySpecificOption)