/* Generated By:JJTree: Do not edit this line. OInsertBody.java Version 4.3 */ /* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=true,NODE_PREFIX=O,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ package com.orientechnologies.orient.core.sql.parser; import java.util.List; import java.util.Map; public class OInsertBody extends SimpleNode { protected List<OIdentifier> identifierList; protected List<List<OExpression>> valueExpressions; protected List<OInsertSetExpression> setExpressions; protected OSelectStatement selectStatement; protected boolean selectInParentheses; protected OJson content; protected OProjection returnProjection; public OInsertBody(int id) { super(id); } public OInsertBody(OrientSql p, int id) { super(p, id); } /** Accept the visitor. **/ public Object jjtAccept(OrientSqlVisitor visitor, Object data) { return visitor.visit(this, data); } public void toString(Map<Object, Object> params, StringBuilder builder) { if (identifierList != null) { builder.append("("); boolean first = true; for (OIdentifier item : identifierList) { if (!first) { builder.append(", "); } item.toString(params, builder); first = false; } builder.append(") VALUES "); if (valueExpressions != null) { boolean firstList = true; for (List<OExpression> itemList : valueExpressions) { if (firstList) { builder.append("("); } else { builder.append("),("); } first = true; for (OExpression item : itemList) { if (!first) { builder.append(", "); } item.toString(params, builder); first = false; } firstList = false; } } builder.append(")"); } if (setExpressions != null) { builder.append("SET "); boolean first = true; for (OInsertSetExpression item : setExpressions) { if (!first) { builder.append(", "); } item.toString(params, builder); first = false; } } if (selectStatement != null) { builder.append("FROM "); if (selectInParentheses) { builder.append("( "); } selectStatement.toString(params, builder); if (selectInParentheses) { builder.append(")"); } } if (content != null) { builder.append("CONTENT "); content.toString(params, builder); } if (returnProjection != null) { builder.append(" RETURN "); returnProjection.toString(params, builder); } } } /* JavaCC - OriginalChecksum=7d2079a41a1fc63a812cb679e729b23a (do not edit this line) */