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 VariableReferenceampersand(Variable v)VariableReferenceasterisk(Variable v)protected java.lang.StringcomposeMessage(java.lang.String input)Compose a message which includes the current class name, so we can see what type of variable it is.VariableReferencedoubleAmpersand(Variable v)VariableReferencedoubleEquals(Variable v)VariableReferencedoublePipe(Variable v)VariableReferenceexclamationEquals(Variable v)VariableReferencegetAttribute(java.lang.String attributeName)Get a named attribute of the variable; e.g.booleangetBooleanValue()Get the variable's value as a booleanConfigurationNodegetConfigurationNodeValue()Get the variable's value as a ConfigurationNode objectConfigurationgetConfigurationValue()Get the variable's value as a Configuration objectdoublegetDoubleValue()Get the variable's value as a doubleVariableReferencegetIndexed(Variable index)Get an indexed property of the variableintgetIntValue()Get the variable's value as an integerjava.lang.StringgetQueryArgumentValue()Get the variable's value as a properly-encoded query argumentjava.lang.StringgetScriptValue()Get the variable's script valuejava.lang.StringgetStringValue()Get the variable's value as a stringjava.lang.StringgetURLPathValue()Get the variable's value as a URL path componentVariableReferencegreaterAngle(Variable v)VariableReferencegreaterAngleEquals(Variable v)booleanhasBooleanValue()Check if the variable has a boolean valuebooleanhasConfigurationNodeValue()Check if the variable has a ConfigurationNode valuebooleanhasConfigurationValue()Check if the variable has a Configuration valuebooleanhasDoubleValue()Check if the variable has a double valuebooleanhasIntValue()Check if the variable has an int valuebooleanhasQueryArgumentValue()Check if the variable has a query argument valuebooleanhasScriptValue()Check if the variable has a script valuebooleanhasStringValue()Check if the variable has a string valuebooleanhasURLPathValue()Check if the variable has a URL path valuevoidinsertAt(Variable v, Variable index)Insert an object into this variable at a position.booleanisNull()Check if this reference is nullVariableReferencelesserAngle(Variable v)VariableReferencelesserAngleEquals(Variable v)VariableReferenceminus(Variable v)VariableReferencepipe(Variable v)VariableReferenceplus(Variable v)voidremoveAt(Variable index)Delete an object from this variable at a position.Variableresolve()Resolve the referencevoidsetReference(Variable object)Set the referenceVariableReferenceslash(Variable v)VariableReferenceunaryExclamation()VariableReferenceunaryMinus()
-
-
-
Method Detail
-
hasStringValue
public boolean hasStringValue() throws ScriptExceptionCheck if the variable has a string value- Specified by:
hasStringValuein interfaceVariable- Throws:
ScriptException
-
hasScriptValue
public boolean hasScriptValue() throws ScriptExceptionCheck if the variable has a script value- Specified by:
hasScriptValuein interfaceVariable- Throws:
ScriptException
-
hasConfigurationValue
public boolean hasConfigurationValue() throws ScriptExceptionCheck if the variable has a Configuration value- Specified by:
hasConfigurationValuein interfaceVariable- Throws:
ScriptException
-
hasConfigurationNodeValue
public boolean hasConfigurationNodeValue() throws ScriptExceptionCheck if the variable has a ConfigurationNode value- Specified by:
hasConfigurationNodeValuein interfaceVariable- Throws:
ScriptException
-
hasBooleanValue
public boolean hasBooleanValue() throws ScriptExceptionCheck if the variable has a boolean value- Specified by:
hasBooleanValuein interfaceVariable- Throws:
ScriptException
-
hasIntValue
public boolean hasIntValue() throws ScriptExceptionCheck if the variable has an int value- Specified by:
hasIntValuein interfaceVariable- Throws:
ScriptException
-
hasDoubleValue
public boolean hasDoubleValue() throws ScriptExceptionCheck if the variable has a double value- Specified by:
hasDoubleValuein interfaceVariable- Throws:
ScriptException
-
hasQueryArgumentValue
public boolean hasQueryArgumentValue() throws ScriptExceptionCheck if the variable has a query argument value- Specified by:
hasQueryArgumentValuein interfaceVariable- Throws:
ScriptException
-
hasURLPathValue
public boolean hasURLPathValue() throws ScriptExceptionCheck if the variable has a URL path value- Specified by:
hasURLPathValuein interfaceVariable- Throws:
ScriptException
-
getScriptValue
public java.lang.String getScriptValue() throws ScriptExceptionGet the variable's script value- Specified by:
getScriptValuein interfaceVariable- Throws:
ScriptException
-
getStringValue
public java.lang.String getStringValue() throws ScriptExceptionGet the variable's value as a string- Specified by:
getStringValuein interfaceVariable- Throws:
ScriptException
-
getConfigurationValue
public Configuration getConfigurationValue() throws ScriptException
Get the variable's value as a Configuration object- Specified by:
getConfigurationValuein interfaceVariable- Throws:
ScriptException
-
getConfigurationNodeValue
public ConfigurationNode getConfigurationNodeValue() throws ScriptException
Get the variable's value as a ConfigurationNode object- Specified by:
getConfigurationNodeValuein interfaceVariable- Throws:
ScriptException
-
getBooleanValue
public boolean getBooleanValue() throws ScriptExceptionGet the variable's value as a boolean- Specified by:
getBooleanValuein interfaceVariable- Throws:
ScriptException
-
getIntValue
public int getIntValue() throws ScriptExceptionGet the variable's value as an integer- Specified by:
getIntValuein interfaceVariable- Throws:
ScriptException
-
getDoubleValue
public double getDoubleValue() throws ScriptExceptionGet the variable's value as a double- Specified by:
getDoubleValuein interfaceVariable- Throws:
ScriptException
-
getQueryArgumentValue
public java.lang.String getQueryArgumentValue() throws ScriptExceptionGet the variable's value as a properly-encoded query argument- Specified by:
getQueryArgumentValuein interfaceVariable- Throws:
ScriptException
-
getURLPathValue
public java.lang.String getURLPathValue() throws ScriptExceptionGet the variable's value as a URL path component- Specified by:
getURLPathValuein interfaceVariable- Throws:
ScriptException
-
plus
public VariableReference plus(Variable v) throws ScriptException
- Specified by:
plusin interfaceVariable- Throws:
ScriptException
-
minus
public VariableReference minus(Variable v) throws ScriptException
- Specified by:
minusin interfaceVariable- Throws:
ScriptException
-
asterisk
public VariableReference asterisk(Variable v) throws ScriptException
- Specified by:
asteriskin interfaceVariable- Throws:
ScriptException
-
slash
public VariableReference slash(Variable v) throws ScriptException
- Specified by:
slashin interfaceVariable- Throws:
ScriptException
-
unaryMinus
public VariableReference unaryMinus() throws ScriptException
- Specified by:
unaryMinusin interfaceVariable- Throws:
ScriptException
-
greaterAngle
public VariableReference greaterAngle(Variable v) throws ScriptException
- Specified by:
greaterAnglein interfaceVariable- Throws:
ScriptException
-
lesserAngle
public VariableReference lesserAngle(Variable v) throws ScriptException
- Specified by:
lesserAnglein interfaceVariable- Throws:
ScriptException
-
doubleEquals
public VariableReference doubleEquals(Variable v) throws ScriptException
- Specified by:
doubleEqualsin interfaceVariable- Throws:
ScriptException
-
greaterAngleEquals
public VariableReference greaterAngleEquals(Variable v) throws ScriptException
- Specified by:
greaterAngleEqualsin interfaceVariable- Throws:
ScriptException
-
lesserAngleEquals
public VariableReference lesserAngleEquals(Variable v) throws ScriptException
- Specified by:
lesserAngleEqualsin interfaceVariable- Throws:
ScriptException
-
exclamationEquals
public VariableReference exclamationEquals(Variable v) throws ScriptException
- Specified by:
exclamationEqualsin interfaceVariable- Throws:
ScriptException
-
ampersand
public VariableReference ampersand(Variable v) throws ScriptException
- Specified by:
ampersandin interfaceVariable- Throws:
ScriptException
-
pipe
public VariableReference pipe(Variable v) throws ScriptException
- Specified by:
pipein interfaceVariable- Throws:
ScriptException
-
doubleAmpersand
public VariableReference doubleAmpersand(Variable v) throws ScriptException
- Specified by:
doubleAmpersandin interfaceVariable- Throws:
ScriptException
-
doublePipe
public VariableReference doublePipe(Variable v) throws ScriptException
- Specified by:
doublePipein interfaceVariable- Throws:
ScriptException
-
unaryExclamation
public VariableReference unaryExclamation() throws ScriptException
- Specified by:
unaryExclamationin 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:
getAttributein interfaceVariable- Throws:
ScriptException
-
insertAt
public void insertAt(Variable v, Variable index) throws ScriptException
Insert an object into this variable at a position.- Specified by:
insertAtin interfaceVariable- Throws:
ScriptException
-
removeAt
public void removeAt(Variable index) throws ScriptException
Delete an object from this variable at a position.- Specified by:
removeAtin interfaceVariable- Throws:
ScriptException
-
getIndexed
public VariableReference getIndexed(Variable index) throws ScriptException
Get an indexed property of the variable- Specified by:
getIndexedin interfaceVariable- Throws:
ScriptException
-
setReference
public void setReference(Variable object) throws ScriptException
Set the reference- Specified by:
setReferencein interfaceVariableReference- Throws:
ScriptException
-
resolve
public Variable resolve() throws ScriptException
Resolve the reference- Specified by:
resolvein interfaceVariableReference- Throws:
ScriptException
-
isNull
public boolean isNull()
Check if this reference is null- Specified by:
isNullin 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.
-
-