Package org.drools.base.rule
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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enumstatic enumNested classes/interfaces inherited from interface org.kie.api.definition.KieDefinition
KieDefinition.KnowledgeType -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final longstatic final intintstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintstatic TypeDeclarationcreateTypeDeclarationForBean(Class<?> cls) static TypeDeclarationcreateTypeDeclarationForBean(Class<?> cls, Annotated annotated, PropertySpecificOption propertySpecificOption) static TypeDeclarationcreateTypeDeclarationForBean(Class<?> cls, PropertySpecificOption propertySpecificOption) booleanlonggetId()getKind()intgetOrder()getRole()intClass<?>inthashCode()booleanbooleanbooleanbooleanbooleanisNovel()booleanbooleanbooleanisValid()booleanReturns true if the given parameter matches this type declarationstatic voidprocessTypeAnnotations(TypeDeclaration type, Annotated annotated, PropertySpecificOption propertySpecificOption) voidvoidsetDurationAttribute(String durationAttribute) voidsetDurationExtractor(ReadAccessor durationExtractor) voidsetDynamic(boolean dynamic) voidsetExpirationOffset(long expirationOffset) voidsetExpirationType(Expires.Policy expirationPolicy) voidsetFormat(TypeDeclaration.Format format) voidsetKind(TypeDeclaration.Kind kind) voidsetNature(TypeDeclaration.Nature nature) voidsetNovel(boolean novel) voidsetOrder(int order) voidsetPropertyReactive(boolean propertyReactive) voidsetResource(Resource resource) voidvoidsetTimestampAttribute(String timestampAttribute) voidsetTimestampExtractor(ReadAccessor timestampExtractor) voidsetTypeClass(Class<?> typeClass) voidsetTypeClassDef(ClassDefinition typeClassDef) voidsetTypeClassName(String typeClassName) voidsetTypesafe(boolean typesafe) voidsetValid(boolean valid) toString()void
-
Field Details
-
NEVER_EXPIRES
public static final long NEVER_EXPIRES- See Also:
-
ROLE_BIT
public static final int ROLE_BIT- See Also:
-
TYPESAFE_BIT
public static final int TYPESAFE_BIT- See Also:
-
FORMAT_BIT
public static final int FORMAT_BIT- See Also:
-
KIND_BIT
public static final int KIND_BIT- See Also:
-
NATURE_BIT
public static final int NATURE_BIT- See Also:
-
setMask
public int setMask
-
-
Constructor Details
-
TypeDeclaration
public TypeDeclaration() -
TypeDeclaration
-
-
Method Details
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
writeExternal
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
getSetMask
public int getSetMask() -
getTypeName
- Returns:
- the type
-
getRole
- Returns:
- the category
-
setRole
- Parameters:
role- the category to set
-
getFormat
- Returns:
- the format
-
setFormat
- Parameters:
format- the format to set
-
getKind
- Returns:
- the kind
-
setKind
- Parameters:
kind- the kind to set
-
getNature
-
setNature
-
getTimestampAttribute
- Returns:
- the timestampAttribute
-
setTimestampAttribute
- Parameters:
timestampAttribute- the timestampAttribute to set
-
getDurationAttribute
- Returns:
- the durationAttribute
-
setDurationAttribute
- Parameters:
durationAttribute- the durationAttribute to set
-
isValid
public boolean isValid() -
setValid
public void setValid(boolean valid) -
getTypeClass
- Returns:
- the typeClass
-
setTypeClass
- Parameters:
typeClass- the typeClass to set
-
isDefinition
public boolean isDefinition() -
isGeneratedFact
public boolean isGeneratedFact() -
getPrototype
-
matches
Returns true if the given parameter matches this type declaration -
hashCode
public int hashCode() -
equals
-
getDurationExtractor
-
setDurationExtractor
-
getTypeClassDef
- Returns:
- the typeClassDef
-
setTypeClassDef
- Parameters:
typeClassDef- the typeClassDef to set
-
getTimestampExtractor
-
setTimestampExtractor
-
getResource
-
setResource
-
getObjectType
-
getExpirationOffset
public long getExpirationOffset() -
setExpirationOffset
public void setExpirationOffset(long expirationOffset) -
getExpirationPolicy
-
setExpirationType
-
getTypeClassName
-
setTypeClassName
-
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
-
toString
-
getKnowledgeType
- Specified by:
getKnowledgeTypein interfaceKieDefinition
-
getNamespace
- Specified by:
getNamespacein interfaceKieDefinition
-
getFullName
-
getId
- Specified by:
getIdin interfaceKieDefinition
-
getOrder
public int getOrder() -
setOrder
public void setOrder(int order) -
compareTo
- Specified by:
compareToin interfaceComparable<TypeDeclaration>
-
createTypeDeclarationForBean
-
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)
-