Package ilog.rules.dt.expression
Class ExpressionPlaceHolder
- java.lang.Object
-
- ilog.rules.shared.model.IlrDecorableElementImpl
-
- ilog.rules.dt.model.common.impl.DTAbstractElement
-
- ilog.rules.dt.expression.ExpressionPlaceHolder
-
- All Implemented Interfaces:
DTTimeStampable,IlrDTExpression,IlrDTExpressionPlaceHolder,IlrDTExpressionRole,IlrDTExpressionText,IlrDTElement,IlrDecorableElement,Serializable,Cloneable
public class ExpressionPlaceHolder extends ilog.rules.dt.model.common.impl.DTAbstractElement implements IlrDTExpressionPlaceHolder, IlrDTExpressionRole
ExpressionPlaceHolderrepresents the expression placeholder part of an expression definition. This class is the implementation ofIlrDTExpressionDefinition.- Since:
- JRules 7.0
- See Also:
IlrDTExpressionPlaceHolder, Serialized Form
-
-
Field Summary
-
Fields inherited from interface ilog.rules.shared.model.IlrDecorableElement
INSTANCE, TRANSIENT, VOLATILE
-
Fields inherited from interface ilog.rules.dt.model.expression.IlrDTExpression
NIL
-
Fields inherited from interface ilog.rules.dt.model.expression.IlrDTExpressionRole
HOLDER_ROLE_INDEX
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddError(IlrDTError err)Deprecated.Objectclone()Clones this expression placeholder.IlrDTExpressionclone(IlrDTContext context)Deprecated.IlrCardinalitygetCardinality()Returns the cardinality of this placeholder.IlrConceptgetConcept()Returns the concept of this placeholder.StringgetDefaultValue()Returns the default value of this placeholder.IlrDTExpressionDefinitiongetDefinition()Returns the expression definition this placeholder belongs to.IlrDTContextgetDTContext()IlrDTErrorManagergetErrorManager()Returns the error manager associated with this expression parameter.IlrConceptgetExpressionConcept()Deprecated.IlrDTExpressionSentencegetExpressionSentence()Deprecated.IlrSyntaxTree.NodegetExpressionSyntaxNode()Deprecated.StringgetExpressionText()Deprecated.CollectiongetExpressionTexts()Deprecated.IlrConceptgetParameterConcept()Deprecated.intgetParameterIndex()Deprecated.intgetSentenceIndex()Deprecated.IlrSyntacticRolegetSyntacticRole()Deprecated.StringgetText()Returns the placeholder text.StringgetType()Returns the concept of the placeholder as aString.ObjectgetValue()Deprecated.booleanhasSyntacticErrors()Deprecated.booleanisCollection()Deprecated.booleanisExpressionValid()Deprecated.booleanisLiteral()Deprecated.booleanisValid()Tests if this placeholder is valid.intoverlap(IlrDTExpression expression)Deprecated.booleanreset()Drops all references to vocabulary, and will requires parsing.voidsetDefaultValue(String defaultValue)Sets the default value of this placeholder.voidsetExpressionSentence(IlrDTExpressionSentence expressionSentence)Deprecated.voidsetExpressionText(String text)Deprecated.voidsetExpressionTexts(Collection collection)Deprecated.voidsetParameterIndex(int parameterIndex)Deprecated.voidsetText(String text)Sets the text of the expression.StringtoString()Objectvisit(IlrDTExpression.Visitor visitor)Deprecated.-
Methods inherited from class ilog.rules.dt.model.common.impl.DTAbstractElement
getTimeStamp, setTimeStamp
-
Methods inherited from class ilog.rules.shared.model.IlrDecorableElementImpl
addProperties, clearProperties, clearVolatileProperties, getProperties, getProperty, setProperty
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface ilog.rules.dt.model.common.DTTimeStampable
getTimeStamp, setTimeStamp
-
Methods inherited from interface ilog.rules.shared.model.IlrDecorableElement
addProperties, clearProperties, clearVolatileProperties, getProperties, getProperty, setProperty
-
Methods inherited from interface ilog.rules.dt.model.expression.IlrDTExpression
equals
-
-
-
-
Method Detail
-
getDefinition
public IlrDTExpressionDefinition getDefinition()
Description copied from interface:IlrDTExpressionPlaceHolderReturns the expression definition this placeholder belongs to.- Specified by:
getDefinitionin interfaceIlrDTExpressionPlaceHolder- Returns:
- The definition.
-
getText
public String getText()
Description copied from interface:IlrDTExpressionPlaceHolderReturns the placeholder text.- Specified by:
getTextin interfaceIlrDTExpressionPlaceHolder- Returns:
- The placeholder text.
-
getExpressionText
public String getExpressionText()
Deprecated.Description copied from interface:IlrDTExpressionTextReturns the expression text.For an
IlrDTExpressionDefinition, the definition text is returned with placeholders.For an
IlrDTExpressionInstance, the expression text is returned and the placeholders are replaced by expression parameter values.- Specified by:
getExpressionTextin interfaceIlrDTExpressionText- Returns:
- The expression text.
-
setExpressionText
public void setExpressionText(String text)
Deprecated.Description copied from interface:IlrDTExpressionRoleSets the text of the expression.- Specified by:
setExpressionTextin interfaceIlrDTExpressionRole- Parameters:
text- the text of the expression.
-
setText
public void setText(String text)
Description copied from interface:IlrDTExpressionRoleSets the text of the expression.- Specified by:
setTextin interfaceIlrDTExpressionRole- Parameters:
text- The expression in a text string.
-
getType
public String getType()
Description copied from interface:IlrDTExpressionPlaceHolderReturns the concept of the placeholder as aString.- Specified by:
getTypein interfaceIlrDTExpressionPlaceHolder- Returns:
- The placeholder type. If the referenced definition
is invalid,
nullis returned.
-
getConcept
public IlrConcept getConcept()
Description copied from interface:IlrDTExpressionPlaceHolderReturns the concept of this placeholder.- Specified by:
getConceptin interfaceIlrDTExpressionPlaceHolder- Returns:
- The placeholder concept. If the referenced definition
is invalid,
nullis returned.
-
getCardinality
public IlrCardinality getCardinality()
Description copied from interface:IlrDTExpressionPlaceHolderReturns the cardinality of this placeholder.- Specified by:
getCardinalityin interfaceIlrDTExpressionPlaceHolder- Returns:
- The cardinality of this parameter. If the referenced definition
is invalid,
nullis returned.
-
getDefaultValue
public String getDefaultValue()
Description copied from interface:IlrDTExpressionPlaceHolderReturns the default value of this placeholder.- Specified by:
getDefaultValuein interfaceIlrDTExpressionPlaceHolder- Returns:
- The default value of this placeholder.
-
setDefaultValue
public void setDefaultValue(String defaultValue)
Description copied from interface:IlrDTExpressionPlaceHolderSets the default value of this placeholder.- Specified by:
setDefaultValuein interfaceIlrDTExpressionPlaceHolder- Parameters:
defaultValue- The new default value.
-
isValid
public boolean isValid()
Description copied from interface:IlrDTExpressionPlaceHolderTests if this placeholder is valid. A placeholder is valid if it has been interpreted in the context of this expression definition and no syntax errors have been reported.An invalid placeholder only has a text object. It has no type, concept, cardinality or path.
- Specified by:
isValidin interfaceIlrDTExpressionPlaceHolder- Returns:
- If the placeholder is valid,
trueis returned.
-
getDTContext
public IlrDTContext getDTContext()
- Specified by:
getDTContextin interfaceIlrDTExpression- Returns:
- The DT context which connects the expression to its environment.
-
reset
public boolean reset()
Description copied from interface:IlrDTExpressionDrops all references to vocabulary, and will requires parsing. Generally used when the context of the expression changes.- Specified by:
resetin interfaceIlrDTExpression
-
clone
public Object clone()
Description copied from interface:IlrDTExpressionPlaceHolderClones this expression placeholder.- Specified by:
clonein interfaceIlrDecorableElement- Specified by:
clonein interfaceIlrDTExpression- Specified by:
clonein interfaceIlrDTExpressionPlaceHolder- Overrides:
clonein classIlrDecorableElementImpl- Returns:
- A copy of the object. Properties tagged
IlrDecorableElement.INSTANCEare not copied.
-
getExpressionSentence
public IlrDTExpressionSentence getExpressionSentence()
Deprecated.Description copied from interface:IlrDTExpressionRoleReturns the expression sentence holding this expression role.- Specified by:
getExpressionSentencein interfaceIlrDTExpressionRole- Returns:
- The expression sentence holding this expression role.
-
getExpressionTexts
public Collection getExpressionTexts()
Deprecated.Description copied from interface:IlrDTExpressionRoleReturns the collection of element's text ifIlrDTExpressionRole.isCollection()istrue.- Specified by:
getExpressionTextsin interfaceIlrDTExpressionRole- Returns:
- The collection of element's text.
-
getParameterConcept
public IlrConcept getParameterConcept()
Deprecated.Description copied from interface:IlrDTExpressionRoleReturns the vocabulary concept associated with the corresponding parameter.- Specified by:
getParameterConceptin interfaceIlrDTExpressionRole- Returns:
- The concept of the parameter.
-
getParameterIndex
public int getParameterIndex()
Deprecated.Description copied from interface:IlrDTExpressionRoleReturns the parameter index in expression sentence orIlrDTExpressionRole.HOLDER_ROLE_INDEXfor holder role expression.- Specified by:
getParameterIndexin interfaceIlrDTExpressionRole- Returns:
- The parameter index in expression sentence or
IlrDTExpressionRole.HOLDER_ROLE_INDEXfor holder role expression.
-
getSentenceIndex
public int getSentenceIndex()
Deprecated.Description copied from interface:IlrDTExpressionRoleReturns the role index in the sentence.- Specified by:
getSentenceIndexin interfaceIlrDTExpressionRole- Returns:
- The role index in the sentence.
-
getSyntacticRole
public IlrSyntacticRole getSyntacticRole()
Deprecated.Description copied from interface:IlrDTExpressionRoleReturns the syntactic role associated to this expression.- Specified by:
getSyntacticRolein interfaceIlrDTExpressionRole- Returns:
- The syntactic role associated to this expression.
-
getValue
public Object getValue()
Deprecated.Description copied from interface:IlrDTExpressionRoleReturns the value corresponding to the text and the concept of the expression. Valid only ifIlrDTExpressionRole.isLiteral()is true.- Specified by:
getValuein interfaceIlrDTExpressionRole- Returns:
- The value corresponding to the expression.
-
isCollection
public boolean isCollection()
Deprecated.Description copied from interface:IlrDTExpressionRoleReturns true if the cardinality of the related role is plural.- Specified by:
isCollectionin interfaceIlrDTExpressionRole- Returns:
- True if the cardinality of the related role is plural.
-
isLiteral
public boolean isLiteral()
Deprecated.Description copied from interface:IlrDTExpressionRoleIf the expression is a literal,IlrDTExpressionRole.getValue()returns the value corresponding to the text and the concept of the expression.- Specified by:
isLiteralin interfaceIlrDTExpressionRole- Returns:
- True if the expression is a literal value.
-
setExpressionSentence
public void setExpressionSentence(IlrDTExpressionSentence expressionSentence)
Deprecated.- Specified by:
setExpressionSentencein interfaceIlrDTExpressionRole
-
setExpressionTexts
public void setExpressionTexts(Collection collection)
Deprecated.Description copied from interface:IlrDTExpressionRoleSets the text of the expression according to the collection.- Specified by:
setExpressionTextsin interfaceIlrDTExpressionRole- Parameters:
collection- The collection defining the text of the expression.
-
setParameterIndex
public void setParameterIndex(int parameterIndex)
Deprecated.- Specified by:
setParameterIndexin interfaceIlrDTExpressionRole- Parameters:
parameterIndex- the parameter index in expression sentence orIlrDTExpressionRole.HOLDER_ROLE_INDEXfor holder role expression.
-
getExpressionConcept
public IlrConcept getExpressionConcept()
Deprecated.Description copied from interface:IlrDTExpressionTextReturns the vocabulary concept associated with the expression.- Specified by:
getExpressionConceptin interfaceIlrDTExpressionText- Returns:
- The concept of the expression.
-
getExpressionSyntaxNode
public IlrSyntaxTree.Node getExpressionSyntaxNode()
Deprecated.Description copied from interface:IlrDTExpressionTextReturns the syntax tree node corresponding to the expression.- Specified by:
getExpressionSyntaxNodein interfaceIlrDTExpressionText- Returns:
- The syntax tree node corresponding to the expression.
-
isExpressionValid
public boolean isExpressionValid()
Deprecated.Description copied from interface:IlrDTExpressionTextTests if the expression is valid. An expression is valid if it can be parsed against the current vocabulary without syntax error.The corresponding syntax tree for an invalid expression is either
nullor in error recovery.- Specified by:
isExpressionValidin interfaceIlrDTExpressionText- Returns:
- If the expression is syntactically valid,
trueis returned.
-
hasSyntacticErrors
public boolean hasSyntacticErrors()
Deprecated.Description copied from interface:IlrDTExpressionTextCheck if the expression has syntactic errors. return True if the expression has syntactic errors.- Specified by:
hasSyntacticErrorsin interfaceIlrDTExpressionText
-
clone
public IlrDTExpression clone(IlrDTContext context)
Deprecated.- Specified by:
clonein interfaceIlrDTExpression- Parameters:
context- The context of the cloned expression.- Returns:
- A copy of the expression attached to the given context.
-
getErrorManager
public IlrDTErrorManager getErrorManager()
Description copied from interface:IlrDTExpressionPlaceHolderReturns the error manager associated with this expression parameter.- Specified by:
getErrorManagerin interfaceIlrDTExpression- Specified by:
getErrorManagerin interfaceIlrDTExpressionPlaceHolder- Returns:
- The error manager.
-
addError
public void addError(IlrDTError err)
Deprecated.
-
overlap
public int overlap(IlrDTExpression expression)
Deprecated.- Specified by:
overlapin interfaceIlrDTExpression- Parameters:
expression- expression to be compared to.- Returns:
- return OVERLAP (+1) if expressions are overlapping, DISTINCT (-1) if not, UNDEFINED (0) if expressions are unrelated or if overlapping is not decidable.
-
visit
public Object visit(IlrDTExpression.Visitor visitor)
Deprecated.- Specified by:
visitin interfaceIlrDTExpression
-
-