Package org.drools.base.rule
Class Declaration
java.lang.Object
org.drools.base.rule.Declaration
- All Implemented Interfaces:
Externalizable,Serializable,Cloneable,AcceptsReadAccessor,TupleValueExtractor
public class Declaration
extends Object
implements Externalizable, AcceptsReadAccessor, TupleValueExtractor
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDeclaration(String identifier, ReadAccessor extractor, Pattern pattern) Construct.Declaration(String identifier, ReadAccessor extractor, Pattern pattern, boolean internalFact) Declaration(String identifier, Pattern pattern) Construct. -
Method Summary
Modifier and TypeMethodDescriptionclone()cloneWithPattern(Pattern pattern) booleanbooleangetBooleanValue(ValueResolver valueResolver, Object object) bytegetByteValue(ValueResolver valueResolver, Object object) chargetCharValue(ValueResolver valueResolver, Object object) Class<?>doublegetDoubleValue(ValueResolver valueResolver, Object object) Returns the Extractor expressionfloatgetFloatValue(ValueResolver valueResolver, Object object) intgetHashCode(ValueResolver valueResolver, Object object) Retrieve the variable's identifier.intgetIntValue(ValueResolver valueResolver, Object object) longgetLongValue(ValueResolver valueResolver, Object object) intReturns the index of the patternshortgetShortValue(ValueResolver valueResolver, Object object) intgetValue(ValueResolver valueResolver, Object object) getValue(ValueResolver valueResolver, BaseTuple tuple) getValue(ValueResolver valueResolver, FactHandle fh) Retrieve theValueType.intinthashCode()booleanbooleanisGlobal()booleanbooleanReturns true if this declaration is a pattern declarationvoidvoidsetBindingName(String bindingName) voidsetDeclarationClass(Class<?> declarationClass) voidsetPattern(Pattern pattern) voidsetReadAccessor(ReadAccessor readAccessor) voidsetxPathOffset(int xPathOffset) toString()voidMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.drools.base.rule.accessor.TupleValueExtractor
getIndex, getValue
-
Constructor Details
-
Declaration
public Declaration() -
Declaration
Construct.- Parameters:
identifier- The name of the variable.pattern- The pattern this variable is declared in
-
Declaration
Construct.- Parameters:
identifier- The name of the variable.extractor- The extractor for this variablepattern- The pattern this variable is declared in
-
Declaration
public Declaration(String identifier, ReadAccessor extractor, Pattern pattern, boolean internalFact) - Parameters:
identifier- The name of the variable.identifier- The name of the variable.extractor- The extractor for this variableinternalFact- True if this is an internal fact created by the engine, like a collection result of a collect CE
-
-
Method Details
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
writeExternal
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
getIdentifier
Retrieve the variable's identifier.- Returns:
- The variable's identifier.
-
getBindingName
-
setBindingName
-
getValueType
Retrieve theValueType.- Specified by:
getValueTypein interfaceTupleValueExtractor- Returns:
- The ValueType.
-
getPattern
Returns the index of the pattern- Returns:
- the pattern
-
setPattern
-
getObjectIndex
public int getObjectIndex() -
getTupleIndex
public int getTupleIndex() -
setxPathOffset
public void setxPathOffset(int xPathOffset) -
getxPathOffset
public int getxPathOffset() -
isFromXpathChunk
public boolean isFromXpathChunk() -
isPatternDeclaration
public boolean isPatternDeclaration()Returns true if this declaration is a pattern declaration -
setReadAccessor
- Specified by:
setReadAccessorin interfaceAcceptsReadAccessor
-
getExtractor
Returns the Extractor expression -
getDeclarationClass
-
setDeclarationClass
-
getValue
- Specified by:
getValuein interfaceTupleValueExtractor
-
getValue
-
getValue
-
getCharValue
-
getIntValue
-
getByteValue
-
getShortValue
-
getLongValue
-
getFloatValue
-
getDoubleValue
-
getBooleanValue
-
getHashCode
-
isGlobal
public boolean isGlobal() -
getNativeReadMethod
-
getNativeReadMethodName
-
getTypeName
-
getBoxedTypeName
-
toString
-
hashCode
public int hashCode() -
equals
-
isInternalFact
public boolean isInternalFact() -
clone
- Specified by:
clonein interfaceTupleValueExtractor- Overrides:
clonein classObject
-
cloneWithPattern
-