Class VariableBase
- java.lang.Object
-
- org.apache.manifoldcf.scriptengine.VariableBase
-
- All Implemented Interfaces:
Variable
,VariableReference
- Direct Known Subclasses:
VariableArray
,VariableBoolean
,VariableConfiguration
,VariableConfigurationNode
,VariableConnectionName
,VariableDict
,VariableFloat
,VariableInt
,VariableQueryArg
,VariableResult
,VariableString
,VariableURL
public class VariableBase extends java.lang.Object implements Variable, VariableReference
Base class for variables. Basically, everything is illegal until overridden.
-
-
Field Summary
-
Fields inherited from interface org.apache.manifoldcf.scriptengine.Variable
ATTRIBUTE_BOOLEAN, ATTRIBUTE_CREATEDSTATUS, ATTRIBUTE_DICT, ATTRIBUTE_FLOAT, ATTRIBUTE_INT, ATTRIBUTE_NOTFOUNDSTATUS, ATTRIBUTE_OKSTATUS, ATTRIBUTE_SCRIPT, ATTRIBUTE_SIZE, ATTRIBUTE_STRING, ATTRIBUTE_TYPE, ATTRIBUTE_UNAUTHORIZEDSTATUS, ATTRIBUTE_VALUE
-
-
Constructor Summary
Constructors Constructor Description VariableBase()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description VariableReference
ampersand(Variable v)
VariableReference
asterisk(Variable v)
protected java.lang.String
composeMessage(java.lang.String input)
Compose a message which includes the current class name, so we can see what type of variable it is.VariableReference
doubleAmpersand(Variable v)
VariableReference
doubleEquals(Variable v)
VariableReference
doublePipe(Variable v)
VariableReference
exclamationEquals(Variable v)
VariableReference
getAttribute(java.lang.String attributeName)
Get a named attribute of the variable; e.g.boolean
getBooleanValue()
Get the variable's value as a booleanConfigurationNode
getConfigurationNodeValue()
Get the variable's value as a ConfigurationNode objectConfiguration
getConfigurationValue()
Get the variable's value as a Configuration objectdouble
getDoubleValue()
Get the variable's value as a doubleVariableReference
getIndexed(Variable index)
Get an indexed property of the variableint
getIntValue()
Get the variable's value as an integerjava.lang.String
getQueryArgumentValue()
Get the variable's value as a properly-encoded query argumentjava.lang.String
getScriptValue()
Get the variable's script valuejava.lang.String
getStringValue()
Get the variable's value as a stringjava.lang.String
getURLPathValue()
Get the variable's value as a URL path componentVariableReference
greaterAngle(Variable v)
VariableReference
greaterAngleEquals(Variable v)
boolean
hasBooleanValue()
Check if the variable has a boolean valueboolean
hasConfigurationNodeValue()
Check if the variable has a ConfigurationNode valueboolean
hasConfigurationValue()
Check if the variable has a Configuration valueboolean
hasDoubleValue()
Check if the variable has a double valueboolean
hasIntValue()
Check if the variable has an int valueboolean
hasQueryArgumentValue()
Check if the variable has a query argument valueboolean
hasScriptValue()
Check if the variable has a script valueboolean
hasStringValue()
Check if the variable has a string valueboolean
hasURLPathValue()
Check if the variable has a URL path valuevoid
insertAt(Variable v, Variable index)
Insert an object into this variable at a position.boolean
isNull()
Check if this reference is nullVariableReference
lesserAngle(Variable v)
VariableReference
lesserAngleEquals(Variable v)
VariableReference
minus(Variable v)
VariableReference
pipe(Variable v)
VariableReference
plus(Variable v)
void
removeAt(Variable index)
Delete an object from this variable at a position.Variable
resolve()
Resolve the referencevoid
setReference(Variable object)
Set the referenceVariableReference
slash(Variable v)
VariableReference
unaryExclamation()
VariableReference
unaryMinus()
-
-
-
Method Detail
-
hasStringValue
public boolean hasStringValue() throws ScriptException
Check if the variable has a string value- Specified by:
hasStringValue
in interfaceVariable
- Throws:
ScriptException
-
hasScriptValue
public boolean hasScriptValue() throws ScriptException
Check if the variable has a script value- Specified by:
hasScriptValue
in interfaceVariable
- Throws:
ScriptException
-
hasConfigurationValue
public boolean hasConfigurationValue() throws ScriptException
Check if the variable has a Configuration value- Specified by:
hasConfigurationValue
in interfaceVariable
- Throws:
ScriptException
-
hasConfigurationNodeValue
public boolean hasConfigurationNodeValue() throws ScriptException
Check if the variable has a ConfigurationNode value- Specified by:
hasConfigurationNodeValue
in interfaceVariable
- Throws:
ScriptException
-
hasBooleanValue
public boolean hasBooleanValue() throws ScriptException
Check if the variable has a boolean value- Specified by:
hasBooleanValue
in interfaceVariable
- Throws:
ScriptException
-
hasIntValue
public boolean hasIntValue() throws ScriptException
Check if the variable has an int value- Specified by:
hasIntValue
in interfaceVariable
- Throws:
ScriptException
-
hasDoubleValue
public boolean hasDoubleValue() throws ScriptException
Check if the variable has a double value- Specified by:
hasDoubleValue
in interfaceVariable
- Throws:
ScriptException
-
hasQueryArgumentValue
public boolean hasQueryArgumentValue() throws ScriptException
Check if the variable has a query argument value- Specified by:
hasQueryArgumentValue
in interfaceVariable
- Throws:
ScriptException
-
hasURLPathValue
public boolean hasURLPathValue() throws ScriptException
Check if the variable has a URL path value- Specified by:
hasURLPathValue
in interfaceVariable
- Throws:
ScriptException
-
getScriptValue
public java.lang.String getScriptValue() throws ScriptException
Get the variable's script value- Specified by:
getScriptValue
in interfaceVariable
- Throws:
ScriptException
-
getStringValue
public java.lang.String getStringValue() throws ScriptException
Get the variable's value as a string- Specified by:
getStringValue
in interfaceVariable
- Throws:
ScriptException
-
getConfigurationValue
public Configuration getConfigurationValue() throws ScriptException
Get the variable's value as a Configuration object- Specified by:
getConfigurationValue
in interfaceVariable
- Throws:
ScriptException
-
getConfigurationNodeValue
public ConfigurationNode getConfigurationNodeValue() throws ScriptException
Get the variable's value as a ConfigurationNode object- Specified by:
getConfigurationNodeValue
in interfaceVariable
- Throws:
ScriptException
-
getBooleanValue
public boolean getBooleanValue() throws ScriptException
Get the variable's value as a boolean- Specified by:
getBooleanValue
in interfaceVariable
- Throws:
ScriptException
-
getIntValue
public int getIntValue() throws ScriptException
Get the variable's value as an integer- Specified by:
getIntValue
in interfaceVariable
- Throws:
ScriptException
-
getDoubleValue
public double getDoubleValue() throws ScriptException
Get the variable's value as a double- Specified by:
getDoubleValue
in interfaceVariable
- Throws:
ScriptException
-
getQueryArgumentValue
public java.lang.String getQueryArgumentValue() throws ScriptException
Get the variable's value as a properly-encoded query argument- Specified by:
getQueryArgumentValue
in interfaceVariable
- Throws:
ScriptException
-
getURLPathValue
public java.lang.String getURLPathValue() throws ScriptException
Get the variable's value as a URL path component- Specified by:
getURLPathValue
in interfaceVariable
- Throws:
ScriptException
-
plus
public VariableReference plus(Variable v) throws ScriptException
- Specified by:
plus
in interfaceVariable
- Throws:
ScriptException
-
minus
public VariableReference minus(Variable v) throws ScriptException
- Specified by:
minus
in interfaceVariable
- Throws:
ScriptException
-
asterisk
public VariableReference asterisk(Variable v) throws ScriptException
- Specified by:
asterisk
in interfaceVariable
- Throws:
ScriptException
-
slash
public VariableReference slash(Variable v) throws ScriptException
- Specified by:
slash
in interfaceVariable
- Throws:
ScriptException
-
unaryMinus
public VariableReference unaryMinus() throws ScriptException
- Specified by:
unaryMinus
in interfaceVariable
- Throws:
ScriptException
-
greaterAngle
public VariableReference greaterAngle(Variable v) throws ScriptException
- Specified by:
greaterAngle
in interfaceVariable
- Throws:
ScriptException
-
lesserAngle
public VariableReference lesserAngle(Variable v) throws ScriptException
- Specified by:
lesserAngle
in interfaceVariable
- Throws:
ScriptException
-
doubleEquals
public VariableReference doubleEquals(Variable v) throws ScriptException
- Specified by:
doubleEquals
in interfaceVariable
- Throws:
ScriptException
-
greaterAngleEquals
public VariableReference greaterAngleEquals(Variable v) throws ScriptException
- Specified by:
greaterAngleEquals
in interfaceVariable
- Throws:
ScriptException
-
lesserAngleEquals
public VariableReference lesserAngleEquals(Variable v) throws ScriptException
- Specified by:
lesserAngleEquals
in interfaceVariable
- Throws:
ScriptException
-
exclamationEquals
public VariableReference exclamationEquals(Variable v) throws ScriptException
- Specified by:
exclamationEquals
in interfaceVariable
- Throws:
ScriptException
-
ampersand
public VariableReference ampersand(Variable v) throws ScriptException
- Specified by:
ampersand
in interfaceVariable
- Throws:
ScriptException
-
pipe
public VariableReference pipe(Variable v) throws ScriptException
- Specified by:
pipe
in interfaceVariable
- Throws:
ScriptException
-
doubleAmpersand
public VariableReference doubleAmpersand(Variable v) throws ScriptException
- Specified by:
doubleAmpersand
in interfaceVariable
- Throws:
ScriptException
-
doublePipe
public VariableReference doublePipe(Variable v) throws ScriptException
- Specified by:
doublePipe
in interfaceVariable
- Throws:
ScriptException
-
unaryExclamation
public VariableReference unaryExclamation() throws ScriptException
- Specified by:
unaryExclamation
in interfaceVariable
- Throws:
ScriptException
-
getAttribute
public VariableReference getAttribute(java.lang.String attributeName) throws ScriptException
Get a named attribute of the variable; e.g. xxx.yyy- Specified by:
getAttribute
in interfaceVariable
- Throws:
ScriptException
-
insertAt
public void insertAt(Variable v, Variable index) throws ScriptException
Insert an object into this variable at a position.- Specified by:
insertAt
in interfaceVariable
- Throws:
ScriptException
-
removeAt
public void removeAt(Variable index) throws ScriptException
Delete an object from this variable at a position.- Specified by:
removeAt
in interfaceVariable
- Throws:
ScriptException
-
getIndexed
public VariableReference getIndexed(Variable index) throws ScriptException
Get an indexed property of the variable- Specified by:
getIndexed
in interfaceVariable
- Throws:
ScriptException
-
setReference
public void setReference(Variable object) throws ScriptException
Set the reference- Specified by:
setReference
in interfaceVariableReference
- Throws:
ScriptException
-
resolve
public Variable resolve() throws ScriptException
Resolve the reference- Specified by:
resolve
in interfaceVariableReference
- Throws:
ScriptException
-
isNull
public boolean isNull()
Check if this reference is null- Specified by:
isNull
in interfaceVariableReference
-
composeMessage
protected java.lang.String composeMessage(java.lang.String input)
Compose a message which includes the current class name, so we can see what type of variable it is.
-
-