Class ParsingContext
- java.lang.Object
-
- org.keycloak.client.registration.cli.common.ParsingContext
-
public class ParsingContext extends Object
An iterator wrapping command line- Author:
- Marko Strukelj
-
-
Constructor Summary
Constructors Constructor Description ParsingContext(String[] args)ParsingContext(String[] args, int offset)ParsingContext(String[] args, int offset, int pos)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringcurrent()Get current argumentString[]getArgs()booleanhasNext()booleanhasNext(int count)booleanhasPrevious()Stringnext()Get next argumentStringnext(int n)Get next n-th argumentStringnextRequired()Check that a next argument is availableStringprevious()Get previous argument
-
-
-
Method Detail
-
hasNext
public boolean hasNext()
-
hasNext
public boolean hasNext(int count)
-
hasPrevious
public boolean hasPrevious()
-
next
public String next()
Get next argument- Returns:
- Next argument or null if beyond the end of arguments
-
nextRequired
public String nextRequired()
Check that a next argument is available- Returns:
- Next argument or RuntimeException if next argument is not available
-
next
public String next(int n)
Get next n-th argument- Returns:
- Next n-th argument or null if beyond the end of arguments
-
previous
public String previous()
Get previous argument- Returns:
- Previous argument or null if previous call was at the beginning of the arguments (pos == 0)
-
current
public String current()
Get current argument- Returns:
- Current argument or null if current parsing position is beyond end, or before start
-
getArgs
public String[] getArgs()
-
-