Class ValueResolver
java.lang.Object
io.jenkins.plugins.restlistparam.logic.ValueResolver
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringconvertToString(Object obj) static StringparseDisplayValue(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-Pathexpressionand returns a list of strings based on the resultstatic ResultContainer<List<ValueItem>>resolveXPath(String xmlStr, String expression, String displayExpression) Parses axmlStr, applies a xPathexpressionand 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 xPathexpressionand returns a list of strings based on the result- Parameters:
xmlStr- The XML text as stringexpression- The xPath expressiondisplayExpression- The xPath expression- Returns:
- A
ResultContainercapsuling 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-Pathexpressionand 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
ResultContainercapsuling 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- TheMimeTypeof 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.
-