Package org.eclipse.jdt.core.dom

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


   @Override
   public O addGenericType(String genericType)
   {
      TypeDeclaration type = (TypeDeclaration) body;
      TypeParameter tp2 = unit.getAST().newTypeParameter();
      tp2.setName(unit.getAST().newSimpleName(genericType));
      type.typeParameters().add(tp2);
      return (O) this;
   }
View Full Code Here


      if (typeParameters != null)
      {
         Iterator<TypeParameter> it = typeParameters.iterator();
         while (it.hasNext())
         {
            TypeParameter typeParameter = it.next();
            if (typeParameter.getName().getIdentifier().equals(genericType))
            {
               it.remove();
            }
         }
      }
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

   @Override
   public O addGenericType(String genericType)
   {
      TypeDeclaration type = (TypeDeclaration) body;
      TypeParameter tp2 = unit.getAST().newTypeParameter();
      tp2.setName(unit.getAST().newSimpleName(genericType));
      type.typeParameters().add(tp2);
      return (O) this;
   }
View Full Code Here

      if (typeParameters != null)
      {
         Iterator<TypeParameter> it = typeParameters.iterator();
         while (it.hasNext())
         {
            TypeParameter typeParameter = it.next();
            if (typeParameter.getName().getIdentifier().equals(genericType))
            {
               it.remove();
            }
         }
      }
View Full Code Here

   @Override
   public O addGenericType(String genericType)
   {
      TypeDeclaration type = (TypeDeclaration) body;
      TypeParameter tp2 = unit.getAST().newTypeParameter();
      tp2.setName(unit.getAST().newSimpleName(genericType));
      type.typeParameters().add(tp2);
      return (O) this;
   }
View Full Code Here

      if (typeParameters != null)
      {
         Iterator<TypeParameter> it = typeParameters.iterator();
         while (it.hasNext())
         {
            TypeParameter typeParameter = it.next();
            if (typeParameter.getName().getIdentifier().equals(genericType))
            {
               it.remove();
            }
         }
      }
View Full Code Here

    List<TypeParameter> typeParameters = typeDeclaration.typeParameters();
    if (!typeParameters.isEmpty() && isSourceLevelGreaterOrEqual(1, 5)) {
      source.append('<');
      Iterator<TypeParameter> iter = typeParameters.iterator();
      TypeParameter typeParameter = iter.next();
      source.append(typeParameter.getName().getIdentifier());
      List<Type> typeBounds = typeParameter.typeBounds();
      if (!typeBounds.isEmpty()) {
        source.append(" extends "); //$NON-NLS-1$
        Iterator<Type> iter2 = typeBounds.iterator();
        source.append(getTypeName(iter2.next()));
        while (iter2.hasNext()) {
          source.append('&');
          source.append(getTypeName(iter2.next()));
        }
      }
      while (iter.hasNext()) {
        source.append(',');
        typeParameter = iter.next();
        source.append(typeParameter.getName().getIdentifier());
        typeBounds = typeParameter.typeBounds();
        if (!typeBounds.isEmpty()) {
          source.append(" extends "); //$NON-NLS-1$
          Iterator<Type> iter2 = typeBounds.iterator();
          source.append(getTypeName(iter2.next()));
          while (iter2.hasNext()) {
View Full Code Here

  public boolean visit(MethodDeclaration node) {
    List<TypeParameter> typeParameters = node.typeParameters();
    if (!typeParameters.isEmpty()) {
      Iterator<TypeParameter> iterator = typeParameters.iterator();
      while (iterator.hasNext()) {
        TypeParameter typeParameter = iterator.next();
        fTypeParameters.add(typeParameter.toString());
      }
    }
    if (rightTypeFound()) {
      return false;
    }
View Full Code Here

  public boolean visit(TypeDeclaration node) {
    List<TypeParameter> typeParameters = node.typeParameters();
    if (!typeParameters.isEmpty()) {
      Iterator<TypeParameter> iterator = typeParameters.iterator();
      while (iterator.hasNext()) {
        TypeParameter typeParameter = iterator.next();
        fTypeParameters.add(typeParameter.getName().getIdentifier());
      }
    }
    if (rightTypeFound()) {
      fEvaluateNextEndTypeDeclaration = false;
      return false;
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.