Package org.eclipse.jdt.core.dom

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


   {
      for (Object f : field.fragments())
      {
         if (f instanceof VariableDeclarationFragment)
         {
            VariableDeclarationFragment frag = (VariableDeclarationFragment) f;
            frag.setName(ast.newSimpleName(name));
            break;
         }
      }
      return this;
   }
View Full Code Here


      int extraDimensions = 0;
      for (Object f : field.fragments())
      {
         if (f instanceof VariableDeclarationFragment)
         {
            VariableDeclarationFragment frag = (VariableDeclarationFragment) f;
            extraDimensions = frag.getExtraDimensions();
            break;
         }
      }
      if (fieldType != null)
      {
View Full Code Here

      String result = null;
      for (Object f : field.fragments())
      {
         if (f instanceof VariableDeclarationFragment)
         {
            VariableDeclarationFragment frag = (VariableDeclarationFragment) f;
            result = frag.getInitializer().toString();
            break;
         }
      }
      return result;
   }
View Full Code Here

      String result = null;
      for (Object f : field.fragments())
      {
         if (f instanceof VariableDeclarationFragment)
         {
            VariableDeclarationFragment frag = (VariableDeclarationFragment) f;
            result = Strings.unquote(frag.getInitializer().toString());
            break;
         }
      }
      return result;
   }
View Full Code Here

      for (Object f : internal.fragments())
      {
         if (f instanceof VariableDeclarationFragment)
         {
            VariableDeclarationFragment tempFrag = (VariableDeclarationFragment) f;
            VariableDeclarationFragment localFrag = getFragment(field);
            localFrag.setInitializer((Expression) ASTNode.copySubtree(ast, tempFrag.getInitializer()));
            break;
         }
      }

      return this;
View Full Code Here

      return setLiteralInitializer(Strings.enquote(value));
   }

   private VariableDeclarationFragment getFragment(final FieldDeclaration field)
   {
      VariableDeclarationFragment result = null;
      for (Object f : field.fragments())
      {
         if (f instanceof VariableDeclarationFragment)
         {
            result = (VariableDeclarationFragment) f;
View Full Code Here

  return Messages.operation_createFieldProgress;
}
private VariableDeclarationFragment getFragment(ASTNode node) {
  Iterator fragments =  ((FieldDeclaration) node).fragments().iterator();
  if (this.anchorElement != null) {
    VariableDeclarationFragment fragment = null;
    String fragmentName = this.anchorElement.getElementName();
    while (fragments.hasNext()) {
      fragment = (VariableDeclarationFragment) fragments.next();
      if (fragment.getName().getIdentifier().equals(fragmentName)) {
        return fragment;
      }
    }
    return fragment;
  } else {
View Full Code Here

private String getASTNodeName() {
  if (this.alteredName != null) return this.alteredName;
  return getFragment(this.createdNode).getName().getIdentifier();
}
protected SimpleName rename(ASTNode node, SimpleName newName) {
  VariableDeclarationFragment fragment = getFragment(node);
  SimpleName oldName = fragment.getName();
  fragment.setName(newName);
  return oldName;
}
View Full Code Here

   public FieldImpl(final O parent, final Object internal, boolean copy)
   {
      init(parent);
      if (copy)
      {
         VariableDeclarationFragment newFieldFragment = (VariableDeclarationFragment) internal;
         FieldDeclaration newFieldDeclaration = (FieldDeclaration) newFieldFragment.getParent();
         this.field = (FieldDeclaration) ASTNode.copySubtree(ast, newFieldDeclaration);
         Iterator<VariableDeclarationFragment> fragmentsIterator = this.field.fragments().iterator();
         VariableDeclarationFragment temp = null;
         while (fragmentsIterator.hasNext())
         {
            VariableDeclarationFragment variableDeclarationFragment = fragmentsIterator.next();
            if (newFieldFragment.getName().getFullyQualifiedName()
                     .equals(variableDeclarationFragment.getName().getFullyQualifiedName()))
            {
               temp = variableDeclarationFragment;
            }
            else
            {
View Full Code Here

      String result = null;
      for (Object f : field.fragments())
      {
         if (f instanceof VariableDeclarationFragment)
         {
            VariableDeclarationFragment frag = (VariableDeclarationFragment) f;
            result = frag.getName().getFullyQualifiedName();
            break;
         }
      }
      return result;
   }
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.core.dom.VariableDeclarationFragment

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.