Package org.drools.core.rule
Class TypeDeclaration
- java.lang.Object
-
- org.drools.core.rule.TypeDeclaration
-
- All Implemented Interfaces:
Externalizable,Serializable,Comparable<TypeDeclaration>,org.kie.api.definition.KieDefinition,org.kie.internal.definition.KnowledgeDefinition
public class TypeDeclaration extends Object implements org.kie.internal.definition.KnowledgeDefinition, Externalizable, Comparable<TypeDeclaration>
The type declaration class stores all type's metadata declared in source files.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTypeDeclaration.Formatstatic classTypeDeclaration.Kindstatic classTypeDeclaration.Nature
-
Field Summary
Fields Modifier and Type Field Description static intFORMAT_BITstatic intKIND_BITstatic intNATURE_BITstatic longNEVER_EXPIRESstatic intROLE_BITintsetMaskstatic intTYPESAFE_BIT
-
Constructor Summary
Constructors Constructor Description TypeDeclaration()TypeDeclaration(String typeName)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(TypeDeclaration o)static TypeDeclarationcreateTypeDeclarationForBean(Class<?> cls)static TypeDeclarationcreateTypeDeclarationForBean(Class<?> cls, Annotated annotated, org.kie.internal.builder.conf.PropertySpecificOption propertySpecificOption)static TypeDeclarationcreateTypeDeclarationForBean(Class<?> cls, org.kie.internal.builder.conf.PropertySpecificOption propertySpecificOption)booleanequals(Object obj)List<String>getAccessibleProperties()StringgetDurationAttribute()InternalReadAccessorgetDurationExtractor()longgetExpirationOffset()org.kie.api.definition.type.Expires.PolicygetExpirationPolicy()TypeDeclaration.FormatgetFormat()StringgetFullName()StringgetId()TypeDeclaration.KindgetKind()org.kie.api.definition.KieDefinition.KnowledgeTypegetKnowledgeType()StringgetNamespace()TypeDeclaration.NaturegetNature()ObjectTypegetObjectType()intgetOrder()org.kie.api.io.ResourcegetResource()org.kie.api.definition.type.Role.TypegetRole()intgetSetMask()StringgetTimestampAttribute()InternalReadAccessorgetTimestampExtractor()Class<?>getTypeClass()ClassDefinitiongetTypeClassDef()StringgetTypeClassName()StringgetTypeName()FactTemplategetTypeTemplate()inthashCode()booleanisDefinition()booleanisDynamic()booleanisGeneratedFact()booleanisJavaBased()booleanisNovel()booleanisPropertyReactive()booleanisTypesafe()booleanisValid()booleanmatches(Object clazz)Returns true if the given parameter matches this type declarationstatic voidprocessTypeAnnotations(TypeDeclaration type, Annotated annotated, org.kie.internal.builder.conf.PropertySpecificOption propertySpecificOption)voidreadExternal(ObjectInput in)voidsetDurationAttribute(String durationAttribute)voidsetDurationExtractor(InternalReadAccessor durationExtractor)voidsetDynamic(boolean dynamic)voidsetExpirationOffset(long expirationOffset)voidsetExpirationType(org.kie.api.definition.type.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(org.kie.api.io.Resource resource)voidsetRole(org.kie.api.definition.type.Role.Type role)voidsetTimestampAttribute(String timestampAttribute)voidsetTimestampExtractor(InternalReadAccessor timestampExtractor)voidsetTypeClass(Class<?> typeClass)voidsetTypeClassDef(ClassDefinition typeClassDef)voidsetTypeClassName(String typeClassName)voidsetTypesafe(boolean typesafe)voidsetTypeTemplate(FactTemplate typeTemplate)voidsetValid(boolean valid)StringtoString()voidwriteExternal(ObjectOutput out)
-
-
-
Field Detail
-
NEVER_EXPIRES
public static final long NEVER_EXPIRES
- See Also:
- Constant Field Values
-
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
-
NATURE_BIT
public static final int NATURE_BIT
- 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:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
getSetMask
public int getSetMask()
-
getTypeName
public String getTypeName()
- Returns:
- the type
-
getRole
public org.kie.api.definition.type.Role.Type getRole()
- Returns:
- the category
-
setRole
public void setRole(org.kie.api.definition.type.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()
-
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
-
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.kie.api.io.Resource getResource()
-
setResource
public void setResource(org.kie.api.io.Resource resource)
-
getObjectType
public ObjectType getObjectType()
-
getExpirationOffset
public long getExpirationOffset()
-
setExpirationOffset
public void setExpirationOffset(long expirationOffset)
-
getExpirationPolicy
public org.kie.api.definition.type.Expires.Policy getExpirationPolicy()
-
setExpirationType
public void setExpirationType(org.kie.api.definition.type.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)
-
getKnowledgeType
public org.kie.api.definition.KieDefinition.KnowledgeType getKnowledgeType()
- Specified by:
getKnowledgeTypein interfaceorg.kie.api.definition.KieDefinition
-
getNamespace
public String getNamespace()
- Specified by:
getNamespacein interfaceorg.kie.api.definition.KieDefinition
-
getFullName
public String getFullName()
-
getId
public String getId()
- Specified by:
getIdin interfaceorg.kie.api.definition.KieDefinition
-
getOrder
public int getOrder()
-
setOrder
public void setOrder(int order)
-
compareTo
public int compareTo(TypeDeclaration o)
- Specified by:
compareToin interfaceComparable<TypeDeclaration>
-
createTypeDeclarationForBean
public static TypeDeclaration createTypeDeclarationForBean(Class<?> cls)
-
createTypeDeclarationForBean
public static TypeDeclaration createTypeDeclarationForBean(Class<?> cls, org.kie.internal.builder.conf.PropertySpecificOption propertySpecificOption)
-
createTypeDeclarationForBean
public static TypeDeclaration createTypeDeclarationForBean(Class<?> cls, Annotated annotated, org.kie.internal.builder.conf.PropertySpecificOption propertySpecificOption)
-
processTypeAnnotations
public static void processTypeAnnotations(TypeDeclaration type, Annotated annotated, org.kie.internal.builder.conf.PropertySpecificOption propertySpecificOption)
-
-