Package com.mattinsler.guiceymongo.data.generator.option

Examples of com.mattinsler.guiceymongo.data.generator.option.Option


  }
 
  @Override
  public String getKeyValue() {
    if (super.hasOption("identity")) {
      Option option = super.getOption("identity");
      if (option.getParameters().isEmpty())
        return "_id";
      String value = null;
      for (Map.Entry<String, Object> e : option.getParameters().entrySet()) {
        if ("value".equals(e.getKey()))
          value = e.getValue().toString();
      }
      if (value == null)
        throw new RuntimeException("Problems with the identity option... Can only be [identity] or [identity('key')] or [identity(value='key')]");
View Full Code Here


 
  private Option parseOptionTree(CommonTree tree) {
    assert GuiceyDataParser.OPTION == tree.getToken().getType();
   
    List<CommonTree> children = tree.getChildren();
    Option option = new Option(children.get(0).getText());
    if (children.size() == 2 && GuiceyDataParser.PAIR != children.get(1).getToken().getType())
      option.addParameter("value", parseLiteral(children.get(1)));
    else {
      for (int x = 1; x < children.size(); ++x) {
        if (GuiceyDataParser.PAIR == children.get(x).getToken().getType() && children.get(x).getChildCount() == 2)
          option.addParameter(children.get(x).getChild(0).getText(), parseLiteral(children.get(x).getChild(1)));
      }
    }
    return option;
  }
View Full Code Here

TOP

Related Classes of com.mattinsler.guiceymongo.data.generator.option.Option

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.