コード例 #1
0
  public StringBuffer printStatement(int indent, StringBuffer output) {

    printIndent(indent, output);
    printModifiers(this.modifiers, output);
    type.print(0, output).append(' ').append(this.name);
    if (initialization != null) {
      output.append(" = "); // $NON-NLS-1$
      initialization.printExpression(indent, output);
    }
    return output.append(';');
  }
コード例 #2
0
  public StringBuffer printExpression(int indent, StringBuffer output) {

    output.append("new "); // $NON-NLS-1$
    type.print(0, output);
    for (int i = 0; i < dimensions.length; i++) {
      if (dimensions[i] == null) output.append("[]"); // $NON-NLS-1$
      else {
        output.append('[');
        dimensions[i].printExpression(0, output);
        output.append(']');
      }
    }
    if (initializer != null) initializer.printExpression(0, output);
    return output;
  }