space translation

@param buf The buffer to append into
@param parsedArgs arguments
@throws SQLException if something wrong happens
184879
public static void sqlspace(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException {
    singleArgumentFunctionCall(buf, "repeat(' ',", "space", parsedArgs);
  }
495877
protected void appendColumns (Iterable<String> columns, StringBuilder buf) {
        int ii = 0;
        for (String column : columns) {
            if (ii++ > 0) {
                buf.append(", ");
            }
            buf.append(columnSQL(column));
        }
    }
655961
protected void process(StringBuffer buf, Object p) {
		buf.append('<');
		buf.append(p);
		buf.append('>');
		buf.append(this.get(p));
		buf.append("</");
		buf.append(p);
		buf.append('>');
	}
18356
@SuppressWarnings("fallthrough")
    protected void quotedString() {
        int pos = bp;
        nextChar();

        loop:
        while (bp < buflen) {
            switch (ch) {
                case '\n': case '\r': case '\f':
                    newline = true;
                    break;

                case ' ': case '\t':
                    break;

                case '"':
                    nextChar();
                    // trim trailing white-space?
                    return;

                case '@':
                    if (newline)
                        break loop;

            }
            nextChar();
        }
    }
400042
@GwtIncompatible("incompatible method")
    public StrBuilder append(final CharBuffer buf) {
        if (buf == null) {
            return appendNull();
        }
        if (buf.hasArray()) {
            final int length = buf.remaining();
            final int len = length();
            ensureCapacity(len + length);
            System.arraycopy(buf.array(), buf.arrayOffset() + buf.position(), buffer, len, length);
            size += length;
        } else {
            append(buf.toString());
        }
        return this;
    }
1076669
private static <T> StringBuilder appendAllTo(final StringBuilder buf, final String sep, final T... types) {
        Assert.requireNonNullEntries(types, "types");
        Assert.requireNotEmpty(types, "types");
        if (types.length > 0) {
            buf.append(toString(types[0]));
            for (int i = 1; i < types.length; i++) {
                buf.append(sep).append(toString(types[i]));
            }
        }
        return buf;
    }
1043251
@Override
	public void format(Buffer buf) {
		int pos = 0;
		// initial the number of records as 0
		setVal(buf, pos, Constant.defaultInstance(INTEGER));
		int flagSize = Page.maxSize(BIGINT);
		pos += Page.maxSize(INTEGER);
		// set flags
		for (int i = 0; i < flags.length; i++) {
			setVal(buf, pos, new BigIntConstant(flags[i]));
			pos += flagSize;
		}
		int slotSize = BTreePage.slotSize(sch);
		for (int p = pos; p + slotSize <= Buffer.BUFFER_SIZE; p += slotSize)
			makeDefaultRecord(buf, p);
	}
692217
public static void sqllocate(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException {
    if (parsedArgs.size() == 2) {
      appendCall(buf, "position(", " in ", ")", parsedArgs);
    } else if (parsedArgs.size() == 3) {
      String tmp = "position(" + parsedArgs.get(0) + " in substring(" + parsedArgs.get(1) + " from "
          + parsedArgs.get(2) + "))";
      buf.append("(")
          .append(parsedArgs.get(2))
          .append("*sign(")
          .append(tmp)
          .append(")+")
          .append(tmp)
          .append(")");
    } else {
      throw new PSQLException(GT.tr("{0} function takes two or three arguments.", "locate"),
          PSQLState.SYNTAX_ERROR);
    }
  }
46294
public void skipWhiteSpace(final CharSequence buf, final ParserCursor cursor) {
        Args.notNull(buf, "Char sequence");
        Args.notNull(cursor, "Parser cursor");
        int pos = cursor.getPos();
        final int indexFrom = cursor.getPos();
        final int indexTo = cursor.getUpperBound();
        for (int i = indexFrom; i < indexTo; i++) {
            final char current = buf.charAt(i);
            if (!isWhitespace(current)) {
                break;
            }
            pos++;
        }
        cursor.updatePos(pos);
    }
575624
@Override
  public StringBuilder appendToBuffer(StringBuilder buf) {
    buf.append(getTask());
    buf.append(": ");
    buf.append(getProcessed());
    return buf;
  }
827848
public static void sqllog(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException {
    singleArgumentFunctionCall(buf, "ln(", "log", parsedArgs);
  }
156801
static void appendConstant(final StringBuffer buf, final Object cst) {
        if (cst == null) {
            buf.append("null");
        } else if (cst instanceof String) {
            appendString(buf, (String) cst);
        } else if (cst instanceof Type) {
            buf.append("Type.getType(\"");
            buf.append(((Type) cst).getDescriptor());
            buf.append("\")");
        } else if (cst instanceof Handle) {
            buf.append("new Handle(");
            Handle h = (Handle) cst;
            buf.append("Opcodes.").append(HANDLE_TAG[h.getTag()])
                    .append(", \"");
            buf.append(h.getOwner()).append("\", \"");
            buf.append(h.getName()).append("\", \"");
            buf.append(h.getDesc()).append("\")");
        } else if (cst instanceof Byte) {
            buf.append("new Byte((byte)").append(cst).append(')');
        } else if (cst instanceof Boolean) {
            buf.append(((Boolean) cst).booleanValue() ? "Boolean.TRUE"
                    : "Boolean.FALSE");
        } else if (cst instanceof Short) {
            buf.append("new Short((short)").append(cst).append(')');
        } else if (cst instanceof Character) {
            int c = ((Character) cst).charValue();
            buf.append("new Character((char)").append(c).append(')');
        } else if (cst instanceof Integer) {
            buf.append("new Integer(").append(cst).append(')');
        } else if (cst instanceof Float) {
            buf.append("new Float(\"").append(cst).append("\")");
        } else if (cst instanceof Long) {
            buf.append("new Long(").append(cst).append("L)");
        } else if (cst instanceof Double) {
            buf.append("new Double(\"").append(cst).append("\")");
        } else if (cst instanceof byte[]) {
            byte[] v = (byte[]) cst;
            buf.append("new byte[] {");
            for (int i = 0; i < v.length; i++) {
                buf.append(i == 0 ? "" : ",").append(v[i]);
            }
            buf.append('}');
        }
1316911
@Override
    public Parser newFixedLengthParser(final Connection con, final InputStream dataSourceStream, final String dataDefinition) {
        return new DBFixedLengthParser(con, dataSourceStream, dataDefinition);
    }
959998
private SQLExpression parseExpression(final SQLStatement sqlStatement) {
        String literals = lexerEngine.getCurrentToken().getLiterals();
        final int beginPosition = lexerEngine.getCurrentToken().getEndPosition() - literals.length();
        final SQLExpression expression = getExpression(literals, sqlStatement);
        lexerEngine.nextToken();
        if (lexerEngine.skipIfEqual(Symbol.DOT)) {
            String property = lexerEngine.getCurrentToken().getLiterals();
            lexerEngine.nextToken();
            return skipIfCompositeExpression(sqlStatement)
                    ? new SQLIgnoreExpression(lexerEngine.getInput().substring(beginPosition, lexerEngine.getCurrentToken().getEndPosition()))
                    : new SQLPropertyExpression(new SQLIdentifierExpression(literals), property);
        }
        if (lexerEngine.equalAny(Symbol.LEFT_PAREN)) {
            lexerEngine.skipParentheses(sqlStatement);
            skipRestCompositeExpression(sqlStatement);
            return new SQLIgnoreExpression(lexerEngine.getInput().substring(beginPosition,
                    lexerEngine.getCurrentToken().getEndPosition() - lexerEngine.getCurrentToken().getLiterals().length()).trim());
        }
        return skipIfCompositeExpression(sqlStatement)
                ? new SQLIgnoreExpression(lexerEngine.getInput().substring(beginPosition, lexerEngine.getCurrentToken().getEndPosition())) : expression;
    }
1340600
public static String sqlconcat(List<?> parsedArgs) {
    StringBuilder buf = new StringBuilder();
    buf.append('(');
    for (int iArg = 0; iArg < parsedArgs.size(); iArg++) {
      buf.append(parsedArgs.get(iArg));
      if (iArg != (parsedArgs.size() - 1)) {
        buf.append(" || ");
      }
    }
    return buf.append(')').toString();
  }
593945
protected void appendSQLClause(SelectionCriteria c, StringBuffer buf)
    {
        // BRJ : handle SqlCriteria
        if (c instanceof SqlCriteria)
        {
            buf.append(c.getAttribute());
            return;
        }
        
        // BRJ : criteria attribute is a query
        if (c.getAttribute() instanceof Query)
        {
            Query q = (Query) c.getAttribute();
            buf.append("(");
            buf.append(getSubQuerySQL(q));
            buf.append(")");
            buf.append(c.getClause());
            appendParameter(c.getValue(), buf);
            return;
        }

		AttributeInfo attrInfo = getAttributeInfo((String) c.getAttribute(), false, c.getUserAlias(), c.getPathClasses());
        TableAlias alias = attrInfo.tableAlias;

        if (alias != null)
        {
            boolean hasExtents = alias.hasExtents();

            if (hasExtents)
            {
                // BRJ : surround with braces if alias has extents
                buf.append("(");
                appendCriteria(alias, attrInfo.pathInfo, c, buf);

                c.setNumberOfExtentsToBind(alias.extents.size());
                Iterator iter = alias.iterateExtents();
                while (iter.hasNext())
                {
                    TableAlias tableAlias = (TableAlias) iter.next();
                    buf.append(" OR ");
                    appendCriteria(tableAlias, attrInfo.pathInfo, c, buf);
                }
                buf.append(")");
            }
            else
            {
                // no extents
                appendCriteria(alias, attrInfo.pathInfo, c, buf);
            }
        }
        else
        {
            // alias null
            appendCriteria(alias, attrInfo.pathInfo, c, buf);
        }

    }
1220625
protected void addCommandLineArgument(StringBuilder buffer,String argument,String value)
    {
        if((value!=null)&&(value.length()>0))
        {
            buffer.append(argument);
            buffer.append(Fax4jExeConstants.SPACE_STR);
            buffer.append(Fax4jExeConstants.VALUE_WRAPPER);
            buffer.append(value);
            buffer.append(Fax4jExeConstants.VALUE_WRAPPER);
            buffer.append(Fax4jExeConstants.SPACE_STR);
        }
    }