Package org.eclipse.jdt.internal.compiler.ast

Examples of org.eclipse.jdt.internal.compiler.ast.ArrayInitializer


        } else if ("fields".equals(name)) {
          if (value instanceof StringLiteral) {
            fields = new String[] {value.constant.stringValue()};
          } else if (value instanceof ArrayInitializer) {
            ArrayInitializer init = (ArrayInitializer) value;
            fields = new String[init.expressions == null ? 0
                : init.expressions.length];
            for (int i = 0, j = fields.length; i < j; i++) {
              fields[i] = init.expressions[i].constant.stringValue();
            }
          }

        } else if ("instantiable".equals(name)) {
          instantiable = value.constant.booleanValue();

        } else if ("methods".equals(name)) {
          if (value instanceof StringLiteral) {
            methods = new String[] {value.constant.stringValue()};
          } else if (value instanceof ArrayInitializer) {
            ArrayInitializer init = (ArrayInitializer) value;
            methods = new String[init.expressions == null ? 0
                : init.expressions.length];
            for (int i = 0, j = methods.length; i < j; i++) {
              methods[i] = init.expressions[i].constant.stringValue();
            }
View Full Code Here


        } else if ("fields".equals(name)) {
          if (value instanceof StringLiteral) {
            fields = new String[] {value.constant.stringValue()};
          } else if (value instanceof ArrayInitializer) {
            ArrayInitializer init = (ArrayInitializer) value;
            fields = new String[init.expressions == null ? 0
                : init.expressions.length];
            for (int i = 0, j = fields.length; i < j; i++) {
              fields[i] = init.expressions[i].constant.stringValue();
            }
          }

        } else if ("instantiable".equals(name)) {
          instantiable = value.constant.booleanValue();

        } else if ("methods".equals(name)) {
          if (value instanceof StringLiteral) {
            methods = new String[] {value.constant.stringValue()};
          } else if (value instanceof ArrayInitializer) {
            ArrayInitializer init = (ArrayInitializer) value;
            methods = new String[init.expressions == null ? 0
                : init.expressions.length];
            for (int i = 0, j = methods.length; i < j; i++) {
              methods[i] = init.expressions[i].constant.stringValue();
            }
View Full Code Here

                // @SuppressWarnings("Foo")
                values = new String[] {((StringLiteral) valueExpr).constant.stringValue()};

              } else if (valueExpr instanceof ArrayInitializer) {
                // @SuppressWarnings({ "Foo", "Bar"})
                ArrayInitializer ai = (ArrayInitializer) valueExpr;
                values = new String[ai.expressions.length];
                for (int i = 0, j = values.length; i < j; i++) {
                  values[i] = ((StringLiteral) ai.expressions[i]).constant.stringValue();
                }
              } else {
View Full Code Here

    private String[] stringArrayFromValue(Expression value) {
      if (value instanceof StringLiteral) {
        return new String[] {value.constant.stringValue()};
      } else if (value instanceof ArrayInitializer) {
        ArrayInitializer init = (ArrayInitializer) value;
        String[] toReturn = new String[init.expressions == null ? 0
            : init.expressions.length];
        for (int i = 0; i < toReturn.length; i++) {
          toReturn[i] = init.expressions[i].constant.stringValue();
        }
View Full Code Here

                // @SuppressWarnings("Foo")
                return Sets.create(((StringLiteral) valueExpr).constant.stringValue().toLowerCase(
                    Locale.ENGLISH));
              } else if (valueExpr instanceof ArrayInitializer) {
                // @SuppressWarnings({ "Foo", "Bar"})
                ArrayInitializer ai = (ArrayInitializer) valueExpr;
                String[] values = new String[ai.expressions.length];
                for (int i = 0, j = values.length; i < j; i++) {
                  values[i] = ((StringLiteral) ai.expressions[i]).constant.stringValue().toLowerCase(
                      Locale.ENGLISH);
                }
View Full Code Here

    private String[] stringArrayFromValue(Expression value) {
      if (value instanceof StringLiteral) {
        return new String[] {value.constant.stringValue()};
      } else if (value instanceof ArrayInitializer) {
        ArrayInitializer init = (ArrayInitializer) value;
        String[] toReturn = new String[init.expressions == null ? 0
            : init.expressions.length];
        for (int i = 0; i < toReturn.length; i++) {
          toReturn[i] = init.expressions[i].constant.stringValue();
        }
View Full Code Here

        if (this.contentsOffset + 3 >= this.contents.length) {
          resizeContents(3);
        }
        this.contents[this.contentsOffset++] = (byte) '[';
        if (defaultValue instanceof ArrayInitializer) {
          ArrayInitializer arrayInitializer = (ArrayInitializer) defaultValue;
          int arrayLength = arrayInitializer.expressions != null ? arrayInitializer.expressions.length : 0;
          this.contents[this.contentsOffset++] = (byte) (arrayLength >> 8);
          this.contents[this.contentsOffset++] = (byte) arrayLength;
          for (int i = 0; i < arrayLength; i++) {
            generateElementValue(arrayInitializer.expressions[i], defaultValueBinding.leafComponentType(), attributeOffset);
View Full Code Here

          this.scribe.printNextToken(TerminalTokens.TokenNameRBRACKET, this.preferences.insert_space_before_closing_bracket_in_array_allocation_expression);
        } else {
          this.scribe.printNextToken(TerminalTokens.TokenNameRBRACKET, this.preferences.insert_space_between_empty_brackets_in_array_allocation_expression);
        }
      }
      final ArrayInitializer initializer = arrayAllocationExpression.initializer;
      if (initializer != null) {
        initializer.traverse(this, scope);
      }

      if (numberOfParens > 0) {
        manageClosingParenthesizedExpression(arrayAllocationExpression, numberOfParens);
      }
View Full Code Here

                // @SuppressWarnings("Foo")
                return Sets.create(((StringLiteral) valueExpr).constant.stringValue().toLowerCase(
                    Locale.ENGLISH));
              } else if (valueExpr instanceof ArrayInitializer) {
                // @SuppressWarnings({ "Foo", "Bar"})
                ArrayInitializer ai = (ArrayInitializer) valueExpr;
                String[] values = new String[ai.expressions.length];
                for (int i = 0, j = values.length; i < j; i++) {
                  values[i] = ((StringLiteral) ai.expressions[i]).constant.stringValue().toLowerCase(
                      Locale.ENGLISH);
                }
View Full Code Here

    private String[] stringArrayFromValue(Expression value) {
      if (value instanceof StringLiteral) {
        return new String[] {value.constant.stringValue()};
      } else if (value instanceof ArrayInitializer) {
        ArrayInitializer init = (ArrayInitializer) value;
        String[] toReturn = new String[init.expressions == null ? 0
            : init.expressions.length];
        for (int i = 0; i < toReturn.length; i++) {
          toReturn[i] = init.expressions[i].constant.stringValue();
        }
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.internal.compiler.ast.ArrayInitializer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.