Class ValueResolver
java.lang.Object
io.jenkins.plugins.restlistparam.logic.ValueResolver
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
convertToString
(Object obj) static String
parseDisplayValue
(MimeType mime, String valueStr, String displayExpression) Apply the display expression filter on a given value (only JSON supported).static ResultContainer<List<ValueItem>>
resolveJsonPath
(String jsonStr, String expression, String displayExpression) Parses ajsonStr
, applies a Json-Pathexpression
and returns a list of strings based on the resultstatic ResultContainer<List<ValueItem>>
resolveXPath
(String xmlStr, String expression, String displayExpression) Parses axmlStr
, applies a xPathexpression
and returns a list of strings based on the result
-
Method Details
-
resolveXPath
public static ResultContainer<List<ValueItem>> resolveXPath(String xmlStr, String expression, String displayExpression) Parses axmlStr
, applies a xPathexpression
and returns a list of strings based on the result- Parameters:
xmlStr
- The XML text as stringexpression
- The xPath expressiondisplayExpression
- The xPath expression- Returns:
- A
ResultContainer
capsuling either a list of strings or a user-friendly error message
-
resolveJsonPath
public static ResultContainer<List<ValueItem>> resolveJsonPath(String jsonStr, String expression, String displayExpression) Parses ajsonStr
, applies a Json-Pathexpression
and returns a list of strings based on the result- Parameters:
jsonStr
- The Json text as stringexpression
- The Json-Path expressiondisplayExpression
- The Json-Path expression- Returns:
- A
ResultContainer
capsuling either a list of strings or a user-friendly error message
-
convertToString
-
parseDisplayValue
Apply the display expression filter on a given value (only JSON supported).- Parameters:
mime
- TheMimeType
of the value to pars for the display value.valueStr
- The value the display value should be parsed from.displayExpression
- The display expression to filter for the display value invalueStr
.- Returns:
- Returns the display value.
-