Package org.eclipse.jdt.core.dom

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


   
    IValueList genericTypes = new IValueList(values);
    if (node.getAST().apiLevel() >= AST.JLS3) {
      if (!node.typeParameters().isEmpty()) {
        for (Iterator it = node.typeParameters().iterator(); it.hasNext();) {
          TypeParameter t = (TypeParameter) it.next();
          genericTypes.add(visitChild(t));
        }
      }
    }
 
View Full Code Here


   
    IValueList genericTypes = new IValueList(values);
    if (node.getAST().apiLevel() >= AST.JLS3) {
      if (!node.typeParameters().isEmpty()) {     
        for (Iterator it = node.typeParameters().iterator(); it.hasNext();) {
          TypeParameter t = (TypeParameter) it.next();
          genericTypes.add(visitChild(t));     
        }
      }
    }
   
View Full Code Here

    if (node.getAST().apiLevel() >= AST.JLS3) {
      printModifiers(node.modifiers());
      if (!node.typeParameters().isEmpty()) {
        this.buffer.append("<");//$NON-NLS-1$
        for (Iterator it = node.typeParameters().iterator(); it.hasNext(); ) {
          TypeParameter t = (TypeParameter) it.next();
          t.accept(this);
          if (it.hasNext()) {
            this.buffer.append(",");//$NON-NLS-1$
          }
        }
        this.buffer.append(">");//$NON-NLS-1$
View Full Code Here

    node.getName().accept(this);
    if (node.getAST().apiLevel() >= AST.JLS3) {
      if (!node.typeParameters().isEmpty()) {
        this.buffer.append("<");//$NON-NLS-1$
        for (Iterator it = node.typeParameters().iterator(); it.hasNext(); ) {
          TypeParameter t = (TypeParameter) it.next();
          t.accept(this);
          if (it.hasNext()) {
            this.buffer.append(",");//$NON-NLS-1$
          }
        }
        this.buffer.append(">");//$NON-NLS-1$
      }
    }
    this.buffer.append(" ");//$NON-NLS-1$
    if (node.getAST().apiLevel() == JLS2) {
      if (getSuperclass(node) != null) {
        this.buffer.append("extends ");//$NON-NLS-1$
        getSuperclass(node).accept(this);
        this.buffer.append(" ");//$NON-NLS-1$
      }
      if (!superInterfaces(node).isEmpty()) {
        this.buffer.append(node.isInterface() ? "extends " : "implements ");//$NON-NLS-2$//$NON-NLS-1$
        for (Iterator it = superInterfaces(node).iterator(); it.hasNext(); ) {
          Name n = (Name) it.next();
          n.accept(this);
          if (it.hasNext()) {
            this.buffer.append(", ");//$NON-NLS-1$
          }
        }
        this.buffer.append(" ");//$NON-NLS-1$
      }
    }
    if (node.getAST().apiLevel() >= AST.JLS3) {
      if (node.getSuperclassType() != null) {
        this.buffer.append("extends ");//$NON-NLS-1$
        node.getSuperclassType().accept(this);
        this.buffer.append(" ");//$NON-NLS-1$
      }
      if (!node.superInterfaceTypes().isEmpty()) {
        this.buffer.append(node.isInterface() ? "extends " : "implements ");//$NON-NLS-2$//$NON-NLS-1$
        for (Iterator it = node.superInterfaceTypes().iterator(); it.hasNext(); ) {
          Type t = (Type) it.next();
          t.accept(this);
          if (it.hasNext()) {
            this.buffer.append(", ");//$NON-NLS-1$
          }
        }
        this.buffer.append(" ");//$NON-NLS-1$
View Full Code Here

        if (!node.typeParameters().isEmpty()) {
            _output("<");

            Iterator it;
            for (it = node.typeParameters().iterator(); it.hasNext();) {
                TypeParameter t = (TypeParameter) it.next();
                t.accept(this);
                if (it.hasNext()) {
                    _output(", ");
                }
            }
View Full Code Here

                _output("<");

                Iterator it;

                for (it = node.typeParameters().iterator(); it.hasNext();) {
                    TypeParameter t = (TypeParameter) it.next();
                    t.accept(this);

                    if (it.hasNext()) {
                        _output(", ");
                    }
                }

                _output(">");
            }
        }

        _output(" ");

        if (node.getSuperclassType() != null) {
            _output("extends ");
            node.getSuperclassType().accept(this);
            _output(" ");
        }

        if (!node.superInterfaceTypes().isEmpty()) {
            _output(node.isInterface() ? "extends " : "implements ");
            //$NON-NLS-2$
            Iterator it;
            for (it = node.superInterfaceTypes().iterator(); it.hasNext();) {
                Type t = (Type) it.next();
                t.accept(this);
                if (it.hasNext()) {
                    _output(", ");
                }
            }
            _output(" ");
View Full Code Here

   @SuppressWarnings("unchecked")
   @Override
   public TypeVariableSource<O> addTypeVariable()
   {
      TypeParameter tp2 = method.getAST().newTypeParameter();
      method.typeParameters().add(tp2);
      return new TypeVariableImpl<O>(parent, tp2);
   }
View Full Code Here

   @SuppressWarnings("unchecked")
   @Override
   public TypeVariableSource<O> addTypeVariable()
   {
      TypeParameter tp2 = method.getAST().newTypeParameter();
      method.typeParameters().add(tp2);
      return new TypeVariableImpl<O>(parent, tp2);
   }
View Full Code Here

        "java", "util", "Set" }));
    cu.imports().add(id);

    TypeDeclaration td = ast.newTypeDeclaration();
    td.setName(ast.newSimpleName("Foo"));
    TypeParameter tp = ast.newTypeParameter();
    tp.setName(ast.newSimpleName("X"));
    td.typeParameters().add(tp);
    cu.types().add(td);

    MethodDeclaration md = ast.newMethodDeclaration();
    md.modifiers().add(ast.newModifier(ModifierKeyword.PUBLIC_KEYWORD));
View Full Code Here

   private org.eclipse.jdt.core.dom.Type parseTypeBound(String bound)
   {
      String stub = "public class Stub<T extends " + bound + "> {}";
      JavaClassSource temp = Roaster.parse(JavaClassSource.class, stub);
      TypeParameter v = (TypeParameter) temp.getTypeVariables().get(0).getInternal();
      return (org.eclipse.jdt.core.dom.Type) v.typeBounds().get(0);
   }
View Full Code Here

TOP

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

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.