Package org.eclipse.jdt.core.dom

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


      if (method.isConstructor())
        return false;
      List modifiers = method.modifiers();
      boolean isPublic = false;
      for (Object mod : modifiers) {
        IExtendedModifier exm = (IExtendedModifier) mod;
        if (exm instanceof Modifier) {
          Modifier m = (Modifier) exm;
          if (m.getKeyword().equals(ModifierKeyword.PUBLIC_KEYWORD)) {
            isPublic = true;
          }
View Full Code Here


  }

  private void removeAbstractModifier(List modifiers) {
    Iterator iterator = modifiers.iterator();
    while (iterator.hasNext()) {
      IExtendedModifier modifier = (IExtendedModifier) iterator.next();
      if (modifier instanceof Modifier) {
        if (((Modifier) modifier).isAbstract()) {
          iterator.remove();
        }
      }
View Full Code Here

      List modifiers = typeDeclaration.modifiers();
      Iterator iterator = modifiers.iterator();

      while (iterator.hasNext()) {
        IExtendedModifier modifier = (IExtendedModifier) iterator.next();
        if (modifier.isAnnotation()) {
          Annotation annotation = (Annotation) modifier;
          if (cls.getCanonicalName().equals(annotation.resolveTypeBinding().getQualifiedName())) {
            iterator.remove();
          }
        }
View Full Code Here

    List<IExtendedModifier> modifierOrAnnotations = node.modifiers();
    unitWillBeModified();

    // delete any "public" or "protected" modifiers
    for (Iterator iter = modifierOrAnnotations.iterator(); iter.hasNext();) {
      IExtendedModifier modifierOrAnnotation = (IExtendedModifier) iter
          .next();

      if (modifierOrAnnotation instanceof Modifier) {
        Modifier modifier = (Modifier) modifierOrAnnotation;
        ModifierKeyword keyword = modifier.getKeyword();
View Full Code Here

    List<?> nodes = res.getTypedNodeList(res.getResourceCompUnit(), ASTNode.METHOD_DECLARATION, true);
   
    for (Object obj : nodes) {
      MethodDeclaration decl = (MethodDeclaration) obj;
      for (Object modObj : decl.modifiers()) {
        IExtendedModifier mod = (IExtendedModifier) modObj;
        if (mod instanceof Modifier) {
          if (((Modifier) mod).isStatic()) {
            generateResultsForASTNode(history, decl, res,
                "The method "+ decl.getName().getFullyQualifiedName() +
                " may not be static. Use singletons declared in the "
View Full Code Here

   * annotation of the given annotationNames.  If it contains even 1 true will be returned.
   * If it contains none false will be returned
   */
  public static boolean containsAnyAnnotation(BodyDeclaration bodyDeclaration, String[] annotationNames) {
    for (Iterator stream = bodyDeclaration.modifiers().iterator(); stream.hasNext(); ) {
      IExtendedModifier modifier = (IExtendedModifier) stream.next();
      if (modifier.isAnnotation()) {
        if (CollectionTools.contains(annotationNames, ((Annotation) modifier).getTypeName().getFullyQualifiedName())) {
          return true;
        }
      }
    }
View Full Code Here

   * Return the annotation with the annotationName from the given BodyDeclaration.
   * Return null if no annotation exists on the BodyDeclaration with the name.
   */
  public static Annotation annotation(BodyDeclaration bodyDeclaration, String annotationName) {
    for (Iterator stream = bodyDeclaration.modifiers().iterator(); stream.hasNext(); ) {
      IExtendedModifier modifier = (IExtendedModifier) stream.next();
      if (modifier.isAnnotation()) {
        if (((Annotation) modifier).getTypeName().getFullyQualifiedName().equals(annotationName)) {
          return (Annotation) modifier;
        }
      }
    }
View Full Code Here

   * Return the annotation with the annotationName from the given SingleVariableDeclaration.
   * Return null if no annotation exists on the SingleVariableDeclaration with the name.
   */
  public static Annotation annotation(SingleVariableDeclaration singleVariableDeclaration, String annotationName) {
    for (Iterator stream = singleVariableDeclaration.modifiers().iterator(); stream.hasNext(); ) {
      IExtendedModifier modifier = (IExtendedModifier) stream.next();
      if (modifier.isAnnotation()) {
        if (((Annotation) modifier).getTypeName().getFullyQualifiedName().equals(annotationName)) {
          return (Annotation) modifier;
        }
      }
    }
View Full Code Here

   * technically they can be interspersed with modifiers.
   */
  public static int annotationLocation(BodyDeclaration bodyDeclaration) {
    int count = 0;
    for (Iterator i = bodyDeclaration.modifiers().listIterator(); i.hasNext();) {
      IExtendedModifier modifier = (IExtendedModifier) i.next();
      if (modifier.isModifier()) {
        break;
      }
      count++;
    }
    return count;
View Full Code Here

   * technically they can be interspersed with modifiers.
   */
  public static int annotationLocation(BodyDeclaration declaration) {
    int count = 0;
    for (Iterator i = declaration.modifiers().listIterator(); i.hasNext();) {
      IExtendedModifier modifier = (IExtendedModifier) i.next();
      if (modifier.isModifier()) {
        break;
      }
      count++;
    }
    return count;
View Full Code Here

TOP

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

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.