Class TagFunction
- java.lang.Object
-
- com.inductiveautomation.ignition.common.expressions.functions.BaseFunction
-
- com.inductiveautomation.ignition.common.expressions.functions.AbstractFunction
-
- com.inductiveautomation.ignition.common.expressions.functions.TagFunction
-
- All Implemented Interfaces:
Function
,TagChangeListener
,java.util.EventListener
public class TagFunction extends AbstractFunction implements TagChangeListener
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TagFunction.EvaluationMode
-
Constructor Summary
Constructors Constructor Description TagFunction()
TagFunction(boolean useReads)
Create a tag function that can use reads instead of subscribing.TagFunction(TagFunction.EvaluationMode mode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
connect(CommonContext context, InteractionListener updateListener)
Empty implementation from BaseFunction.Function
copy()
Returns this.void
disconnect()
Empty implementation from BaseFunction.QualifiedValue
execute(Expression[] args)
Execute this function, and return the function's qualified value.protected void
executeRead()
protected void
fireInteractionListener()
java.lang.String
getArgDocString()
Returns a string to be used in the auto-generated function documentation.protected java.lang.String
getFunctionDisplayName()
SecurityContext
getSecurityContext()
java.lang.Class<?>
getType()
Returns the type that this function will return upon executionjava.lang.Object
getValue()
void
setType(java.lang.Class<?> type)
void
setValue(java.lang.Object value)
void
shutdown()
Empty implementation from BaseFunction.void
startup()
Empty implementation from BaseFunction.void
tagChanged(TagChangeEvent e)
Invoked when the tag has changedprotected void
updatePath(TagPath path)
protected void
updateValueSynched(QualifiedValue value)
protected boolean
validateNumArgs(int num)
-
Methods inherited from class com.inductiveautomation.ignition.common.expressions.functions.AbstractFunction
executeArg, initArgs, log
-
Methods inherited from class com.inductiveautomation.ignition.common.expressions.functions.BaseFunction
executeAll
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.inductiveautomation.ignition.common.tags.model.event.TagChangeListener
isLightweight
-
-
-
-
Constructor Detail
-
TagFunction
public TagFunction()
-
TagFunction
public TagFunction(boolean useReads)
Create a tag function that can use reads instead of subscribing. If false, it will use Subscribed_ReadInitial, due to changes that were made in the 8.0 line, which introduced that semantic. If that is not desired, the more specific constructor that tags EvaluationMode should be used.
-
TagFunction
public TagFunction(TagFunction.EvaluationMode mode)
-
-
Method Detail
-
executeRead
protected void executeRead() throws ExpressionException
- Throws:
ExpressionException
-
updatePath
protected void updatePath(TagPath path) throws java.lang.Exception
- Throws:
java.lang.Exception
-
execute
public QualifiedValue execute(Expression[] args) throws ExpressionException
Description copied from interface:Function
Execute this function, and return the function's qualified value.- Specified by:
execute
in interfaceFunction
- Throws:
ExpressionException
-
validateNumArgs
protected boolean validateNumArgs(int num)
- Overrides:
validateNumArgs
in classAbstractFunction
-
copy
public Function copy()
Description copied from class:BaseFunction
Returns this. Override to create a clone if you need a unique function object per Expression.- Specified by:
copy
in interfaceFunction
- Overrides:
copy
in classBaseFunction
-
connect
public void connect(CommonContext context, InteractionListener updateListener)
Description copied from class:BaseFunction
Empty implementation from BaseFunction. Override if necessary.- Specified by:
connect
in interfaceFunction
- Overrides:
connect
in classBaseFunction
-
disconnect
public void disconnect()
Description copied from class:BaseFunction
Empty implementation from BaseFunction. Override if necessary.- Specified by:
disconnect
in interfaceFunction
- Overrides:
disconnect
in classBaseFunction
-
shutdown
public void shutdown()
Description copied from class:BaseFunction
Empty implementation from BaseFunction. Override if necessary.- Specified by:
shutdown
in interfaceFunction
- Overrides:
shutdown
in classBaseFunction
-
startup
public void startup()
Description copied from class:BaseFunction
Empty implementation from BaseFunction. Override if necessary.- Specified by:
startup
in interfaceFunction
- Overrides:
startup
in classBaseFunction
-
getArgDocString
public java.lang.String getArgDocString()
Description copied from interface:Function
Returns a string to be used in the auto-generated function documentation. The string should represent the arguments for the function, such as "string, count" for the "repeat" function.- Specified by:
getArgDocString
in interfaceFunction
-
getType
public java.lang.Class<?> getType()
Description copied from interface:Function
Returns the type that this function will return upon execution
-
setType
public void setType(java.lang.Class<?> type)
-
getSecurityContext
public SecurityContext getSecurityContext()
- Specified by:
getSecurityContext
in interfaceTagChangeListener
- Returns:
- the
SecurityContext
associated with thisTagChangeListener
-
tagChanged
public void tagChanged(TagChangeEvent e)
Description copied from interface:TagChangeListener
Invoked when the tag has changed- Specified by:
tagChanged
in interfaceTagChangeListener
- Parameters:
e
- a ChangeEvent object
-
updateValueSynched
protected void updateValueSynched(QualifiedValue value)
-
fireInteractionListener
protected void fireInteractionListener()
-
getValue
public java.lang.Object getValue()
-
setValue
public void setValue(java.lang.Object value)
-
getFunctionDisplayName
protected java.lang.String getFunctionDisplayName()
- Specified by:
getFunctionDisplayName
in classAbstractFunction
-
-