Package com.microstrategy.web.transform
Class FormalParameterImpl
- java.lang.Object
-
- com.microstrategy.web.transform.FormalParameterImpl
-
- All Implemented Interfaces:
FormalParameter
public class FormalParameterImpl extends java.lang.Object implements FormalParameter
FormalParameterImpl implements the FormalParameter interface and defines the structure of a single formal parameter.- Since:
- MicroStrategy Web 7.3.1 or earlier
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
name
-
Fields inherited from interface com.microstrategy.web.transform.FormalParameter
PARAM_TYPE_BOOLEAN, PARAM_TYPE_FLOAT, PARAM_TYPE_INTEGER, PARAM_TYPE_STRING, PARAM_TYPE_UNKNOWN
-
-
Constructor Summary
Constructors Constructor Description FormalParameterImpl(java.lang.String name, int type)
Constructor of FormalparameterImpl class.FormalParameterImpl(java.lang.String name, int type, FormalParameterAnnotation annotation)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkValue(java.lang.Object value)
Verifies that the value correspons to the type of the FormalParameter object.FormalParameterAnnotation
getAnnotation()
java.lang.Object
getDefaultValue()
Returns the default value of the FormalParameter object.java.lang.String
getDescription()
Returns the textual description of the FormalParameter objectjava.lang.String
getName()
Returns the name of the FormalParameter object.java.lang.String
getStringKey()
int
getType()
Returns the data type of the FormalParameter object.java.lang.Object
getValue()
Returns the actual value of the FormalParameter object.java.lang.Object
getValue(boolean returnDefault)
Returns the actual value of the FormalParameter object.boolean
isRequired()
Returns whether the FormalParameter object is required by the transform.java.lang.String
paramTypeToString(int paramType)
Returns the type of the FormalParamber object as string.void
setAnnotation(FormalParameterAnnotation annotation)
void
setDefaultValue(java.lang.Object defaultValue)
Sets the default value of the FormalParameter object.void
setDescription(java.lang.String description)
Sets the description of the FormalParameter object.void
setRequired(boolean required)
Sets the FormalParameter object as required.void
setValue(java.lang.Object value)
Sets the actual value of the FormalParameter object.
-
-
-
Constructor Detail
-
FormalParameterImpl
public FormalParameterImpl(java.lang.String name, int type)
Constructor of FormalparameterImpl class.- Parameters:
name
- the name of the FormalParameter object.type
- the type of the FormalParameter object.
-
FormalParameterImpl
public FormalParameterImpl(java.lang.String name, int type, FormalParameterAnnotation annotation)
- Since:
- MicroStrategy Web 8.0.0
-
-
Method Detail
-
checkValue
public void checkValue(java.lang.Object value) throws java.lang.IllegalArgumentException
Verifies that the value correspons to the type of the FormalParameter object.- Specified by:
checkValue
in interfaceFormalParameter
- Parameters:
value
- the value wanted to be checked.- Throws:
java.lang.IllegalArgumentException
- thrown if the default value is null or does not correspond to the data type of the FormalParameter object.
-
getDefaultValue
public java.lang.Object getDefaultValue()
Returns the default value of the FormalParameter object.- Specified by:
getDefaultValue
in interfaceFormalParameter
- Returns:
- default value of FormalParameter object.
-
getDescription
public java.lang.String getDescription()
Returns the textual description of the FormalParameter object- Specified by:
getDescription
in interfaceFormalParameter
- Returns:
- description of the FormalParameter object
-
getName
public java.lang.String getName()
Returns the name of the FormalParameter object.- Specified by:
getName
in interfaceFormalParameter
- Returns:
- name of the FormalParameter object.
-
getType
public int getType()
Returns the data type of the FormalParameter object.- Specified by:
getType
in interfaceFormalParameter
- Returns:
- data type of FormalParameter object.
-
getValue
public java.lang.Object getValue()
Returns the actual value of the FormalParameter object. If the actual value is null, then it will return the default value.- Specified by:
getValue
in interfaceFormalParameter
- Returns:
- actual value of FormalParameter object.
-
getValue
public java.lang.Object getValue(boolean returnDefault)
Returns the actual value of the FormalParameter object. If it is null and the parameter is set to True, then it will return the default value.- Parameters:
returnDefault
- specifies whether it will return the default value in case the actual value is null.- Returns:
- the actual value or default value of FormalParameter object.
-
isRequired
public boolean isRequired()
Returns whether the FormalParameter object is required by the transform.- Specified by:
isRequired
in interfaceFormalParameter
- Returns:
- whether the FormalParamber object is required or not.
-
paramTypeToString
public java.lang.String paramTypeToString(int paramType)
Returns the type of the FormalParamber object as string.- Specified by:
paramTypeToString
in interfaceFormalParameter
- Parameters:
paramType
- the type of the FormalParameter object.- Returns:
- string that specifies the type of the FormalParameter object.
-
setDefaultValue
public void setDefaultValue(java.lang.Object defaultValue) throws java.lang.IllegalArgumentException
Sets the default value of the FormalParameter object.- Parameters:
defaultValue
- the default value of the FormalParameter object.- Throws:
java.lang.IllegalArgumentException
- thrown if the default value is null or does not correspond to the data type of the FormalParameter object.
-
setDescription
public void setDescription(java.lang.String description)
Sets the description of the FormalParameter object.- Parameters:
description
- the description of the FromalParameter object.
-
setValue
public void setValue(java.lang.Object value) throws java.lang.IllegalArgumentException
Sets the actual value of the FormalParameter object.- Specified by:
setValue
in interfaceFormalParameter
- Parameters:
value
- the actual value of the FormalParameter ojbect.- Throws:
java.lang.IllegalArgumentException
- thrown if the actual value is null or does not correspond to the data type of the FormalParameter object.
-
setRequired
public void setRequired(boolean required)
Sets the FormalParameter object as required.- Parameters:
required
- whether you want to set the FormalParameter as required or not.
-
getAnnotation
public FormalParameterAnnotation getAnnotation()
- Since:
- MicroStrategy Web 8.0.0
-
setAnnotation
public void setAnnotation(FormalParameterAnnotation annotation)
- Since:
- MicroStrategy Web 8.0.0
-
getStringKey
public java.lang.String getStringKey()
- Since:
- MicroStrategy Web 8.0.0
-
-