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 Details

    • ParsingContext

      public ParsingContext(String[] args)
    • ParsingContext

      public ParsingContext(String[] args, int offset)
    • ParsingContext

      public ParsingContext(String[] args, int offset, int pos)
  • Method Details

    • 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()