Class AbstractParser
java.lang.Object
io.jenkins.plugins.pipeline.parsers.AbstractParser
- Direct Known Subclasses:
AgentParser,EnvironmentParser,InputParser,LibraryParser,OptionsParser,ParallelParser,ParametersParser,PipelineParser,PostParser,ScriptParser,StageParser,StagesParser,StepsParser,SubScriptParser,ToolsParser,TriggersParser,WhenConditionalParser,WhenParser
Abstract parser class which Parsers extends
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected List<EnvironmentVariableModel>convertEnvironmentVariableModel(List<KeyValueModel> keyValueModels) protected List<VariableModel>convertVariableModel(List<KeyValueModel> keyValueModels) Convert List ofKeyValueModelto List ofVariableModelprotected List<KeyValueModel>extractParameters(Object parameter) protected LinkedHashMapgetChildNodeAsLinkedHashMap(LinkedHashMap parentNode) Get child node of the parent node asLinkedHashMap.protected ListgetChildNodeAsList(LinkedHashMap parentNode) Get child node of the parent node asList.protected ObjectgetChildNodeAsObject(LinkedHashMap parentNode) Get child node of the parent node asObject.protected StringgetChildNodeAsString(LinkedHashMap parentNode) Get child node of the parent node asString.protected StringgetKey(LinkedHashMap node) Get key name from Nodeprotected ObjectgetValue(LinkedHashMap parentNode, String key) Get Value from aLinkedHashMapwith a given key
-
Field Details
-
yamlNodeName
-
yaml
protected org.yaml.snakeyaml.Yaml yaml
-
-
Constructor Details
-
AbstractParser
public AbstractParser()
-
-
Method Details
-
getValue
protected Object getValue(LinkedHashMap parentNode, String key) throws PipelineAsYamlKeyEmptyException Get Value from aLinkedHashMapwith a given key- Parameters:
parentNode- Parent map to get value fromkey- Key to get it's value- Returns:
- Value of the key
- Throws:
PipelineAsYamlKeyEmptyException- if key is empty
-
getChildNodeAsLinkedHashMap
protected LinkedHashMap getChildNodeAsLinkedHashMap(LinkedHashMap parentNode) throws PipelineAsYamlNodeNotFoundException Get child node of the parent node asLinkedHashMap. Key is yamlNodeName- Parameters:
parentNode- Parent Map- Returns:
- Child node as
LinkedHashMapretrieved with yamlNodeName - Throws:
PipelineAsYamlNodeNotFoundException- if child node is not found in parent node
-
getChildNodeAsList
protected List getChildNodeAsList(LinkedHashMap parentNode) throws PipelineAsYamlNodeNotFoundException Get child node of the parent node asList. Key is yamlNodeName- Parameters:
parentNode- Parent Map- Returns:
- Child node as
Listretrieved with yamlNodeName - Throws:
PipelineAsYamlNodeNotFoundException- if child node is not found in parent node
-
getChildNodeAsString
protected String getChildNodeAsString(LinkedHashMap parentNode) throws PipelineAsYamlNodeNotFoundException Get child node of the parent node asString. Key is yamlNodeName- Parameters:
parentNode- Parent Map- Returns:
- Child node as
Stringretrieved with yamlNodeName - Throws:
PipelineAsYamlNodeNotFoundException- if child node is not found in parent node
-
getChildNodeAsObject
protected Object getChildNodeAsObject(LinkedHashMap parentNode) throws PipelineAsYamlNodeNotFoundException Get child node of the parent node asObject. Key is yamlNodeName- Parameters:
parentNode- Parent Map- Returns:
- Child node as
Objectretrieved with yamlNodeName - Throws:
PipelineAsYamlNodeNotFoundException- if child node is not found in parent node
-
getKey
Get key name from Node- Parameters:
node- Node to extract key from- Returns:
- Key Name
- Throws:
PipelineAsYamlKeyEmptyException- if key is empty
-
extractParameters
- Parameters:
parameter- Parameter to be converted- Returns:
- List of
KeyValueModel
-
convertVariableModel
Convert List ofKeyValueModelto List ofVariableModel- Parameters:
keyValueModels- List ofKeyValueModelto be converted- Returns:
- List of
VariableModel
-
convertEnvironmentVariableModel
protected List<EnvironmentVariableModel> convertEnvironmentVariableModel(List<KeyValueModel> keyValueModels)
-