/** * Returns the name of the {@link ExpressionNode}. * * @return */ public String getName() { return node.toStringAST(); }
@Override public String toStringAST() { StringBuilder sb = new StringBuilder("T("); sb.append(getChild(0).toStringAST()); for (int d = 0; d < this.dimensions; d++) { sb.append("[]"); } sb.append(")"); return sb.toString(); }
@Override public String toStringAST() { return getChild(0).toStringAST() + " ? " + getChild(1).toStringAST() + " : " + getChild(2).toStringAST(); }
@Override public String toStringAST() { return getChild(0).toStringAST() + " ?: " + getChild(1).toStringAST(); }
@Override public String toStringAST() { return getChild(0).toStringAST() + "=" + getChild(1).toStringAST(); }
@Override public String toStringAST() { return "!" + getChild(0).toStringAST(); }
@Override public String toStringAST() { return "![" + getChild(0).toStringAST() + "]"; }
@Override public String toStringAST() { StringBuilder sb = new StringBuilder("#").append(this.name); sb.append("("); for (int i = 0; i < getChildCount(); i++) { if (i > 0) { sb.append(","); } sb.append(getChild(i).toStringAST()); } sb.append(")"); return sb.toString(); }
@Override public String toStringAST() { StringBuilder sb = new StringBuilder(); switch (this.variant) { case ALL: sb.append("?["); break; case FIRST: sb.append("^["); break; case LAST: sb.append("$["); break; } return sb.append(getChild(0).toStringAST()).append("]").toString(); }
@Override public String toStringAST() { StringBuilder sb = new StringBuilder(); for (int i = 0; i < getChildCount(); i++) { if (i > 0) { sb.append("."); } sb.append(getChild(i).toStringAST()); } return sb.toString(); }
@Override public String toStringAST() { StringBuilder sb = new StringBuilder("["); for (int i = 0; i < getChildCount(); i++) { if (i > 0) { sb.append(","); } sb.append(getChild(i).toStringAST()); } sb.append("]"); return sb.toString(); }
@Override public String toStringAST() { StringBuilder sb = new StringBuilder("new "); int index = 0; sb.append(getChild(index++).toStringAST()); sb.append("("); for (int i = index; i < getChildCount(); i++) { if (i > index) { sb.append(","); } sb.append(getChild(i).toStringAST()); } sb.append(")"); return sb.toString(); }
@Override public String toStringAST() { StringBuilder sb = new StringBuilder(this.name); sb.append("("); for (int i = 0; i < getChildCount(); i++) { if (i > 0) { sb.append(","); } sb.append(getChild(i).toStringAST()); } sb.append(")"); return sb.toString(); }
@Override public String toStringAST() { StringBuilder sb = new StringBuilder("{"); int count = getChildCount(); for (int c = 0; c < count; c++) { if (c > 0) { sb.append(","); } sb.append(getChild(c++).toStringAST()); sb.append(":"); sb.append(getChild(c).toStringAST()); } sb.append("}"); return sb.toString(); }
@Override public String toStringAST() { StringBuilder sb = new StringBuilder("{"); // String ast matches input string, not the 'toString()' of the resultant collection, which would use [] int count = getChildCount(); for (int c = 0; c < count; c++) { if (c > 0) { sb.append(","); } sb.append(getChild(c).toStringAST()); } sb.append("}"); return sb.toString(); }
/** * String format for all operators is the same * {@code '(' [operand] [operator] [operand] ')'}. */ @Override public String toStringAST() { StringBuilder sb = new StringBuilder("("); sb.append(getChild(0).toStringAST()); for (int i = 1; i < getChildCount(); i++) { sb.append(" ").append(getOperatorName()).append(" "); sb.append(getChild(i).toStringAST()); } sb.append(")"); return sb.toString(); }
@Override public String toStringAST() { StringBuilder sb = new StringBuilder(); if (this.value != null) { sb.append(this.value.getValue()); } else { for (int i = 0; i < getChildCount(); i++) { if (i > 0) { sb.append("."); } sb.append(getChild(i).toStringAST()); } } return sb.toString(); }
@Override public String toStringAST() { StringBuilder sb = new StringBuilder("["); for (int i = 0; i < getChildCount(); i++) { if (i > 0) { sb.append(","); } sb.append(getChild(i).toStringAST()); } sb.append("]"); return sb.toString(); }
@Override public String toStringAST() { StringBuilder sb = new StringBuilder(); for (int i = 0; i < getChildCount(); i++) { if (i > 0) { sb.append("."); } sb.append(getChild(i).toStringAST()); } return sb.toString(); }
private static void printAST(PrintStream out, SpelNode t, String indent) { if (t != null) { StringBuilder sb = new StringBuilder(); sb.append(indent).append(t.getClass().getSimpleName()); sb.append(" value:").append(t.toStringAST()); sb.append(t.getChildCount() < 2 ? "" : " #children:" + t.getChildCount()); out.println(sb.toString()); for (int i = 0; i < t.getChildCount(); i++) { printAST(out, t.getChild(i), indent + " "); } } }