java.lang.Object
org.sejda.conversion.AdapterUtils
Cli adapters parsing utils
- Author:
- Eduard Weissmann
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisAllPages(String rawString) static intParse input string into an integer, throwing an exception in case the input cannot be parsedstatic IntegerparseIntSilently(String input) Parse input string into an integer, silently returning anullin case the input cannot be parsedstatic String[]Splits an input string using the default ":" separatorstatic String[]splitAndTrim(String input) Same assplitAndTrim(String, String)only it uses default ":" separatorstatic String[]splitAndTrim(String input, String separator) Splits an input string using the specified separator.
-
Method Details
-
parseInt
Parse input string into an integer, throwing an exception in case the input cannot be parsed- Parameters:
input-explainedInput- the user-friendly name of what the input represents, to be used in exception message. Ex: "page number" or "phone number"- Returns:
- parsed int value
- Throws:
SejdaRuntimeException- if the input cannot be parsed- See Also:
-
split
Splits an input string using the default ":" separator- Parameters:
input-- Returns:
- an array of String tokens that result from the split
-
splitAndTrim
Same assplitAndTrim(String, String)only it uses default ":" separator- Parameters:
input-- Returns:
- an array of String tokens that result from the split
-
splitAndTrim
Splits an input string using the specified separator. The input string is trimmed before being split, and the same trim operation is applied to all the split tokens- Parameters:
input-separator-- Returns:
- an array of String tokens that result from the split
-
parseIntSilently
Parse input string into an integer, silently returning anullin case the input cannot be parsed- Parameters:
input-- Returns:
- an Integer matching the string input, or null if the input cannot be parsed as an Integer
- See Also:
-
isAllPages
- Parameters:
rawString-- Returns:
- true if the input raw string represent the sejda-console convention string for 'all', where 'all' is usually used when defining page selection to select all pages.
-