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.Stringname-
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 voidcheckValue(java.lang.Object value)Verifies that the value correspons to the type of the FormalParameter object.FormalParameterAnnotationgetAnnotation()java.lang.ObjectgetDefaultValue()Returns the default value of the FormalParameter object.java.lang.StringgetDescription()Returns the textual description of the FormalParameter objectjava.lang.StringgetName()Returns the name of the FormalParameter object.java.lang.StringgetStringKey()intgetType()Returns the data type of the FormalParameter object.java.lang.ObjectgetValue()Returns the actual value of the FormalParameter object.java.lang.ObjectgetValue(boolean returnDefault)Returns the actual value of the FormalParameter object.booleanisRequired()Returns whether the FormalParameter object is required by the transform.java.lang.StringparamTypeToString(int paramType)Returns the type of the FormalParamber object as string.voidsetAnnotation(FormalParameterAnnotation annotation)voidsetDefaultValue(java.lang.Object defaultValue)Sets the default value of the FormalParameter object.voidsetDescription(java.lang.String description)Sets the description of the FormalParameter object.voidsetRequired(boolean required)Sets the FormalParameter object as required.voidsetValue(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.IllegalArgumentExceptionVerifies that the value correspons to the type of the FormalParameter object.- Specified by:
checkValuein 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:
getDefaultValuein interfaceFormalParameter- Returns:
- default value of FormalParameter object.
-
getDescription
public java.lang.String getDescription()
Returns the textual description of the FormalParameter object- Specified by:
getDescriptionin interfaceFormalParameter- Returns:
- description of the FormalParameter object
-
getName
public java.lang.String getName()
Returns the name of the FormalParameter object.- Specified by:
getNamein interfaceFormalParameter- Returns:
- name of the FormalParameter object.
-
getType
public int getType()
Returns the data type of the FormalParameter object.- Specified by:
getTypein 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:
getValuein 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:
isRequiredin 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:
paramTypeToStringin 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.IllegalArgumentExceptionSets 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.IllegalArgumentExceptionSets the actual value of the FormalParameter object.- Specified by:
setValuein 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
-
-