Package org.zkybase.cmdb.cli

Examples of org.zkybase.cmdb.cli.ParseException


   * @see org.zkybase.cmdb.cli.Command#parse(java.lang.String[])
   */
  @Override
  public Request parse(String[] tokens) {
    if (tokens.length > 0) {
      throw new ParseException("list expects an empty list of arguments.");
    }
    return new ListRequest();
  }
View Full Code Here


   * @see org.zkybase.cmdb.cli.Command#parse(java.lang.String[])
   */
  @Override
  public Request parse(String[] tokens) {
    if (tokens.length > 0) {
      throw new ParseException("quit expects an empty list of arguments.");
    }
    return new QuitRequest();
  }
View Full Code Here

   * @see org.zkybase.cmdb.cli.Command#parse(java.lang.String[])
   */
  @Override
  public Request parse(String[] tokens) {
    if (tokens.length != 1) {
      throw new ParseException("delete requires exactly one argument.");
    }
   
    DeleteRequest request = new DeleteRequest();
    try {
      request.id = Long.parseLong(tokens[0]);
    } catch (NumberFormatException e) {
      throw new ParseException("id must be an integer.");
    }
    return request;
  }
View Full Code Here

TOP

Related Classes of org.zkybase.cmdb.cli.ParseException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.