@Override public void removeSourceLocation() { super.removeSourceLocation(); for (ModelASTWhenContent c : conditions) { c.removeSourceLocation(); } }
@Override public String toGroovy() { StringBuilder result = new StringBuilder("when {\n"); for (ModelASTWhenContent c : conditions) { result.append(c.toGroovy()).append("\n"); } result.append("}\n"); return result.toString(); }
@Override public void validate(@Nonnull final ModelValidator validator) { validator.validateElement(this); for (ModelASTWhenContent c : conditions) { c.validate(validator); } } }
@Override public Object toJSON() { final JSONArray a = new JSONArray(); for (ModelASTWhenContent c : conditions) { a.add(c.toJSON()); } return new JSONObject().accumulate("conditions", a); }
@Override public JSONObject toJSON() { JSONObject o = new JSONObject(); o.accumulate("name", name); if (args != null) { o.accumulate("arguments", args.toJSON()); } if (!children.isEmpty()) { final JSONArray a = new JSONArray(); for (ModelASTWhenContent child : children) { a.add(child.toJSON()); } o.accumulate("children", a); } return o; }
@Override public void validate(final ModelValidator validator) { validator.validateElement(this); for (ModelASTWhenContent c : conditions) { c.validate(validator); } } }
@Override public void removeSourceLocation() { super.removeSourceLocation(); for (ModelASTWhenContent c : conditions) { c.removeSourceLocation(); } }
@Override public JSONObject toJSON() { JSONObject o = new JSONObject(); o.accumulate("name", name); if (args != null) { o.accumulate("arguments", args.toJSON()); } if (!children.isEmpty()) { final JSONArray a = new JSONArray(); for (ModelASTWhenContent child : children) { a.add(child.toJSON()); } o.accumulate("children", a); } return o; }
@Override public String toGroovy() { StringBuilder result = new StringBuilder("when {\n"); if (beforeAgent != null && beforeAgent) { result.append("beforeAgent true\n"); } if (beforeInput != null && beforeInput) { result.append("beforeInput true\n"); } for (ModelASTWhenContent c : conditions) { result.append(c.toGroovy()).append("\n"); } result.append("}\n"); return result.toString(); }
@Override public void validate(@Nonnull ModelValidator validator) { validator.validateElement(this); if (args != null) { args.validate(validator); } for (ModelASTWhenContent c : children) { c.validate(validator); } }
@Override public void removeSourceLocation() { super.removeSourceLocation(); if (args != null) { args.removeSourceLocation(); } for (ModelASTWhenContent child : children) { child.removeSourceLocation(); } }
@Override public Object toJSON() { final JSONObject o = new JSONObject(); final JSONArray a = new JSONArray(); for (ModelASTWhenContent c : conditions) { a.add(c.toJSON()); } o.accumulate("conditions", a); if (beforeAgent != null) { o.accumulate("beforeAgent", beforeAgent); } if (beforeInput != null) { o.accumulate("beforeInput", beforeInput); } return o; }
@Override public String toGroovy() { StringBuilder result = new StringBuilder(); if (!children.isEmpty()) { result.append(name).append(" {\n"); for (ModelASTWhenContent child : children) { result.append(child.toGroovy()).append("\n"); } result.append("}\n"); } else { result.append(name).append(" ").append(getArgs().toGroovy()); } return result.toString(); }
@Override public void validate(@Nonnull ModelValidator validator) { validator.validateElement(this); if (args != null) { args.validate(validator); } for (ModelASTWhenContent c : children) { c.validate(validator); } }
@Override public void removeSourceLocation() { super.removeSourceLocation(); if (args != null) { args.removeSourceLocation(); } for (ModelASTWhenContent child : children) { child.removeSourceLocation(); } }
@Override public String toGroovy() { StringBuilder result = new StringBuilder(); if (!children.isEmpty()) { result.append(name).append(" {\n"); for (ModelASTWhenContent child : children) { result.append(child.toGroovy()).append("\n"); } result.append("}\n"); } else { result.append(name).append(" ").append(getArgs().toGroovy()); } return result.toString(); }