Examples of FieldDeclaration


Examples of org.codehaus.janino.Java.FieldDeclaration

        if (icd instanceof AnonymousClassDeclaration || icd instanceof LocalClassDeclaration) {
            Java.ClassDeclaration cd = (Java.ClassDeclaration) icd;
            for (int i = 0; i < cd.variableDeclaratorsAndInitializers.size(); ++i) {
                TypeBodyDeclaration tbd = (TypeBodyDeclaration) cd.variableDeclaratorsAndInitializers.get(i);
                if (tbd instanceof FieldDeclaration) {
                    FieldDeclaration fd = (FieldDeclaration) tbd;
                    for (int j = 0; j < fd.variableDeclarators.length; ++j) {
                        VariableDeclarator vd = fd.variableDeclarators[j];
                        if (vd.optionalInitializer != null) {
                            this.fakeCompile(vd.optionalInitializer);
                        }
View Full Code Here

Examples of org.eclipse.dltk.ast.declarations.FieldDeclaration

      this.processPackage(statement);
      super.fNodes.pop();
      return false;
    }
    if (statement instanceof FieldDeclaration) {
      FieldDeclaration fieldDecl = (FieldDeclaration) statement;
      processFieldDeclaration(fieldDecl.getRef(), fieldDecl);
      super.fNodes.pop();
      return false;
    }
    // TODO handle tm-import statement
    if (statement instanceof RutaImportStatement) {
View Full Code Here

Examples of org.eclipse.jdt.core.dom.FieldDeclaration

     * @return field builder
     */
    public FieldBuilder addField(String name, Type type) {
        VariableDeclarationFragment vfrag = getAST().newVariableDeclarationFragment();
        vfrag.setName(getAST().newSimpleName(name));
        FieldDeclaration fdecl = getAST().newFieldDeclaration(vfrag);
        fdecl.setType(type);
        m_fields.add(fdecl);
        return new FieldBuilder(this, fdecl);
    }
View Full Code Here

Examples of org.eclipse.jdt.core.dom.FieldDeclaration

     * @return sorted pairs
     */
    public StringPair[] getSortedFields() {
        StringPair[] pairs = new StringPair[m_fields.size()];
        for (int i = 0; i < m_fields.size(); i++) {
            FieldDeclaration field = (FieldDeclaration)m_fields.get(i);
            String name = ((VariableDeclarationFragment)field.fragments().get(0)).getName().toString();
            pairs[i] = new StringPair(name, field.getType().toString());
        }
        Arrays.sort(pairs);
        return pairs;
    }
View Full Code Here

Examples of org.eclipse.jdt.core.dom.FieldDeclaration

            // parse class text to get field declaration
            String text = "class gorph { private static final long serialVersionUID = " + m_serialVersion + "; }";
            m_parser.setSource(text.toCharArray());
            CompilationUnit unit = (CompilationUnit)m_parser.createAST(null);
            TypeDeclaration type = (TypeDeclaration)unit.types().get(0);
            FieldDeclaration field = (FieldDeclaration)type.bodyDeclarations().get(0);
            holder.addField(field);
           
        }
    }
View Full Code Here

Examples of org.eclipse.jdt.core.dom.FieldDeclaration

          values.sourceLocation(loc, 0, 0)));
    }
   
    ASTNode parentASTNode = node.getParent();
    if (parentASTNode instanceof FieldDeclaration) {
      FieldDeclaration parent = (FieldDeclaration)parentASTNode;
      parent.getType().accept(this);
      visitListOfModifiers(parent.modifiers());
      if (parent.getJavadoc() != null) {
        parent.getJavadoc().accept(this);
      }
    }
    else if (parentASTNode instanceof VariableDeclarationExpression) {
      VariableDeclarationExpression parent = (VariableDeclarationExpression)parentASTNode;
      parent.getType().accept(this);
      visitListOfModifiers(parent.modifiers());
    }
    else {
      VariableDeclarationStatement parent = (VariableDeclarationStatement)parentASTNode;
      parent.getType().accept(this);
      visitListOfModifiers(parent.modifiers());
    }
    scopeManager.pop();
    return true;
  }
View Full Code Here

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

    needRecheck = false;
    FieldBinding existingField;
    if ((existingField = this.getField(synthField.name, true /*resolve*/)) != null) {
      TypeDeclaration typeDecl = this.scope.referenceContext;
      for (int i = 0, max = typeDecl.fields.length; i < max; i++) {
        FieldDeclaration fieldDecl = typeDecl.fields[i];
        if (fieldDecl.binding == existingField) {
          synthField.name = CharOperation.concat(
            TypeConstants.SYNTHETIC_OUTER_LOCAL_PREFIX,
            actualOuterLocalVariable.name,
            ("$" + String.valueOf(index++)).toCharArray()); //$NON-NLS-1$
View Full Code Here

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

    needRecheck = false;
    FieldBinding existingField;
    if ((existingField = this.getField(synthField.name, true /*resolve*/)) != null) {
      TypeDeclaration typeDecl = this.scope.referenceContext;
      for (int i = 0, max = typeDecl.fields.length; i < max; i++) {
        FieldDeclaration fieldDecl = typeDecl.fields[i];
        if (fieldDecl.binding == existingField) {
          if (this.scope.compilerOptions().complianceLevel >= ClassFileConstants.JDK1_5) {
            synthField.name = CharOperation.concat(
              synthField.name,
              "$".toCharArray()); //$NON-NLS-1$
View Full Code Here

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

  // ensure there is not already such a field defined by the user
  FieldBinding existingField;
  if ((existingField = this.getField(synthField.name, true /*resolve*/)) != null) {
    TypeDeclaration typeDecl = blockScope.referenceType();
    for (int i = 0, max = typeDecl.fields.length; i < max; i++) {
      FieldDeclaration fieldDecl = typeDecl.fields[i];
      if (fieldDecl.binding == existingField) {
        blockScope.problemReporter().duplicateFieldInType(this, fieldDecl);
        break;
      }
    }
View Full Code Here

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

    needRecheck = false;
    FieldBinding existingField;
    if ((existingField = this.getField(synthField.name, true /*resolve*/)) != null) {
      TypeDeclaration typeDecl = this.scope.referenceContext;
      for (int i = 0, max = typeDecl.fields.length; i < max; i++) {
        FieldDeclaration fieldDecl = typeDecl.fields[i];
        if (fieldDecl.binding == existingField) {
          synthField.name = CharOperation.concat(
            TypeConstants.SYNTHETIC_ASSERT_DISABLED,
            ("_" + String.valueOf(index++)).toCharArray()); //$NON-NLS-1$
          needRecheck = true;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.