Class Field
- java.lang.Object
-
- com.inet.taskplanner.server.api.field.Field
-
- Direct Known Subclasses:
BooleanField
,ColorField
,DateField
,FilenameField
,FloatField
,FolderField
,GroupField
,LabelField
,LinkField
,NumberField
,PasswordField
,RangeField
,SelectField
,SelectInputField
,SelectInputFieldMulti
,TableField
,TextAreaField
,TextField
,TimeField
@JsonData public abstract class Field extends java.lang.Object
A field represents a component in the settings of a e.g. trigger or job. Each property that should be configured by the user in the WEB GUI must be provided as a field.
TheField
is also responsible to replace the placeholder in it's value for aserial
task.- Since:
- taskplanner 3.0
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Field(FieldType type, java.lang.String key, java.lang.String label)
Creates the field instanceprotected
Field(FieldType type, java.lang.String key, java.lang.String label, boolean valueSavable)
Creates the field instance with the possibility to define whether the setting will be stored in the definition or not.protected
Field(java.lang.String type, java.lang.String key, java.lang.String label)
Creates the field instanceprotected
Field(java.lang.String type, java.lang.String key, java.lang.String label, boolean valueSavable)
Creates the field instance with the possibility to define whether the setting will be stored in the definition or not.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<FieldCondition>
getConditions()
Returns the fields for the conditionjava.lang.String
getKey()
Returns the key that is stored in the definitionjava.lang.String
getLabel()
Returns the label to be should in front of the componentjava.lang.String
getPlaceholder()
Returns the placeholder text that is displayed if the field is left emptyjava.lang.String
getType()
Returns the type of the field which defines how the field is displayedjava.lang.String
getValue()
Returns the current value of the fieldboolean
isUpdateValuesOnChange()
Returns whether the whole values of the fields in the current dialog should be updated if the value of the current field changesprotected boolean
isValueSavable()
Returns whether the value should be storedjava.lang.String
patchResultPlaceholderInValue(java.lang.String value, java.util.List<JobResultContainer> results)
Override to replace the placeholders with the values from the resultsjava.lang.String
patchSeriesPlaceholderInValue(java.lang.String value, java.util.Map<java.lang.String,java.lang.String> seriesProperties)
Override to replace the placeholders with the values from the seriesprotected java.lang.String
replaceSeriesPlaceholders(java.lang.String value, java.util.Map<java.lang.String,java.lang.String> properties)
Replace placeholders in given string with values in given properties.void
setConditions(java.util.List<FieldCondition> conditions)
Sets the fields for the conditionvoid
setKey(java.lang.String key)
Sets the key that is stored in the definitionvoid
setLabel(java.lang.String label)
Sets the label to be should in front of the componentvoid
setPlaceholder(java.lang.String placeholder)
Sets the placeholder text that is displayed if the field is left emptyvoid
setType(FieldType type)
Sets the type of the field which defines how the field is displayedvoid
setType(java.lang.String type)
Sets the type of the field which defines how the field is displayedvoid
setUpdateValuesOnChange(boolean updateValuesOnChange)
Sets whether the whole values of the fields in the current dialog should be updated if the value of the current field changesvoid
setValue(java.lang.String value)
Sets the current value of the fieldprotected void
setValueSavable(boolean valueSavable)
Sets whether the value should be stored
-
-
-
Constructor Detail
-
Field
protected Field(FieldType type, java.lang.String key, java.lang.String label)
Creates the field instance- Parameters:
type
- the type of the fieldkey
- the key that is stored in the definitionlabel
- the label to be should in front of the component- Since:
- taskplanner 3.0
-
Field
protected Field(java.lang.String type, java.lang.String key, java.lang.String label)
Creates the field instance- Parameters:
type
- the type of the fieldkey
- the key that is stored in the definitionlabel
- the label to be should in front of the component- Since:
- taskplanner 3.0
-
Field
protected Field(FieldType type, java.lang.String key, java.lang.String label, boolean valueSavable)
Creates the field instance with the possibility to define whether the setting will be stored in the definition or not.- Parameters:
type
- the type of the fieldkey
- the key that is stored in the definitionlabel
- the label to be should in front of the componentvalueSavable
- true if the value should be stored, false otherwise- Since:
- taskplanner 3.0
-
Field
protected Field(java.lang.String type, java.lang.String key, java.lang.String label, boolean valueSavable)
Creates the field instance with the possibility to define whether the setting will be stored in the definition or not.- Parameters:
type
- the type of the fieldkey
- the key that is stored in the definitionlabel
- the label to be should in front of the componentvalueSavable
- true if the value should be stored, false otherwise- Since:
- taskplanner 3.0
-
-
Method Detail
-
getConditions
public java.util.List<FieldCondition> getConditions()
Returns the fields for the condition- Returns:
- the fields for the condition
- Since:
- taskplanner 3.0
-
setConditions
public void setConditions(java.util.List<FieldCondition> conditions)
Sets the fields for the condition- Parameters:
conditions
- the fields for the condition- Since:
- taskplanner 3.0
-
getType
public java.lang.String getType()
Returns the type of the field which defines how the field is displayed- Returns:
- the type of the field
- Since:
- taskplanner 3.0
-
setType
public void setType(FieldType type)
Sets the type of the field which defines how the field is displayed- Parameters:
type
- the type of the field- Since:
- taskplanner 3.0
-
setType
public void setType(java.lang.String type)
Sets the type of the field which defines how the field is displayed- Parameters:
type
- the type of the field- Since:
- taskplanner 3.0
-
getKey
public java.lang.String getKey()
Returns the key that is stored in the definition- Returns:
- the key that is stored in the definition
- Since:
- taskplanner 3.0
-
setKey
public void setKey(java.lang.String key)
Sets the key that is stored in the definition- Parameters:
key
- the key that is stored in the definition- Since:
- taskplanner 3.0
-
getLabel
public java.lang.String getLabel()
Returns the label to be should in front of the component- Returns:
- the label to be should in front of the component
- Since:
- taskplanner 3.0
-
setLabel
public void setLabel(java.lang.String label)
Sets the label to be should in front of the component- Parameters:
label
- the label to be should in front of the component- Since:
- taskplanner 3.0
-
getPlaceholder
public java.lang.String getPlaceholder()
Returns the placeholder text that is displayed if the field is left empty- Returns:
- the placeholder text
- Since:
- taskplanner 3.0
-
setPlaceholder
public void setPlaceholder(java.lang.String placeholder)
Sets the placeholder text that is displayed if the field is left empty- Parameters:
placeholder
- the placeholder text- Since:
- taskplanner 3.0
-
getValue
public java.lang.String getValue()
Returns the current value of the field- Returns:
- the current value of the field
- Since:
- taskplanner 3.0
-
setValue
public void setValue(java.lang.String value)
Sets the current value of the field- Parameters:
value
- the current value of the field- Since:
- taskplanner 3.0
-
isValueSavable
protected boolean isValueSavable()
Returns whether the value should be stored- Returns:
- true if the value should be stored, false otherwise
- Since:
- taskplanner 3.0
-
setValueSavable
protected void setValueSavable(boolean valueSavable)
Sets whether the value should be stored- Parameters:
valueSavable
- true if the value should be stored, false otherwise- Since:
- taskplanner 3.0
-
isUpdateValuesOnChange
public boolean isUpdateValuesOnChange()
Returns whether the whole values of the fields in the current dialog should be updated if the value of the current field changes- Returns:
- true if the values should be updated, false otherwise
- Since:
- taskplanner 3.0
-
setUpdateValuesOnChange
public void setUpdateValuesOnChange(boolean updateValuesOnChange)
Sets whether the whole values of the fields in the current dialog should be updated if the value of the current field changes- Parameters:
updateValuesOnChange
- true if the values should be updated, false otherwise- Since:
- taskplanner 3.0
-
patchSeriesPlaceholderInValue
public java.lang.String patchSeriesPlaceholderInValue(@Nullable java.lang.String value, @Nonnull java.util.Map<java.lang.String,java.lang.String> seriesProperties)
Override to replace the placeholders with the values from the series- Parameters:
value
- the value to be patchedseriesProperties
- properties from the current series set- Returns:
- the new value with replaced placeholders
- Since:
- taskplanner 3.0
-
patchResultPlaceholderInValue
public java.lang.String patchResultPlaceholderInValue(@Nullable java.lang.String value, @Nonnull java.util.List<JobResultContainer> results)
Override to replace the placeholders with the values from the results- Parameters:
value
- the value to be patchedresults
- the results that contain the meta properties that are replaced- Returns:
- the new value with replaced placeholders
- Since:
- taskplanner 3.0
-
replaceSeriesPlaceholders
protected final java.lang.String replaceSeriesPlaceholders(java.lang.String value, java.util.Map<java.lang.String,java.lang.String> properties)
Replace placeholders in given string with values in given properties. Placeholders of missing values will be removed.- Parameters:
value
- the value to replaceproperties
- the properties with what to replace- Returns:
- the replaced String.
- Since:
- taskplanner 3.0
-
-