Examples of TypeParameter


Examples of ceylon.language.meta.declaration.TypeParameter

        }
        return result;
    }
   
    protected TypeParameter makeTypeParameter(Declaration packageOrType, String typeParameter) {
        final TypeParameter result;
        if (packageOrType instanceof ClassOrInterfaceDeclaration) {
            result = ((ClassOrInterfaceDeclaration)packageOrType).getTypeParameterDeclaration(typeParameter);
        } else if (packageOrType instanceof FunctionDeclaration) {
            result = ((FunctionDeclaration)packageOrType).getTypeParameterDeclaration(typeParameter);
        } else if (packageOrType instanceof AliasDeclaration) {
View Full Code Here

Examples of com.bacoder.parser.java.api.TypeParameter

    super(adapters);
  }

  @Override
  public TypeParameter adapt(TypeParameterContext context) {
    TypeParameter typeParameter = createNode(context);

    TerminalNode identifierNode = getTerminalNode(context, JavaParser.Identifier);
    if (identifierNode != null) {
      typeParameter.setName(getAdapter(IdentifierAdapter.class).adapt(identifierNode));
    }

    TypeBoundContext typeBoundContext = getChild(context, TypeBoundContext.class);
    if (typeBoundContext != null) {
      List<Type> extendsTypes =
          transform(typeBoundContext, TypeContext.class, new Function<TypeContext, Type>() {
            @Override
            public Type apply(TypeContext context) {
              return getAdapter(TypeAdapter.class).adapt(context);
            }
          });
      typeParameter.setExtendsTypes(extendsTypes);
    }

    return typeParameter;
  }
View Full Code Here

Examples of com.github.antlrjavaparser.api.TypeParameter

                                        + " extends ", "", 1);
                        pNameExpr = new NameExpr(tempName);
                        final ClassOrInterfaceType pResolvedName = JavaParserUtils
                                .getClassOrInterfaceType(pNameExpr);
                        classOrInterfaceDeclaration.getTypeParameters().add(
                                new TypeParameter(param.getArgName()
                                        .getSymbolName(), Collections
                                        .singletonList(pResolvedName)));
                    }
                }
            }
View Full Code Here

Examples of com.redhat.ceylon.compiler.typechecker.model.TypeParameter

        if (otherType == null) {
            expr.addUnexpectedError("Right term of intersection operator should have type parameter named " + rightTpName);
            return null;
        }
        targs = new HashMap<>();
        TypeParameter mtp = null;
        for (TypeParameter tp : md.getTypeParameters()) {
            if (tp.getName().equals(leftTpName)) {
                mtp = tp;
                break;
            }
View Full Code Here

Examples of japa.parser.ast.TypeParameter

                                        + " extends ", "", 1);
                        pNameExpr = new NameExpr(tempName);
                        final ClassOrInterfaceType pResolvedName = JavaParserUtils
                                .getClassOrInterfaceType(pNameExpr);
                        classOrInterfaceDeclaration.getTypeParameters().add(
                                new TypeParameter(param.getArgName()
                                        .getSymbolName(), Collections
                                        .singletonList(pResolvedName)));
                    }
                }
            }
View Full Code Here

Examples of japa.parser.ast.TypeParameter

  private void printTypeParameters(List<TypeParameter> args, Object arg) {
    if (args != null) {
      printer.print("<");
      for (Iterator<TypeParameter> i = args.iterator(); i.hasNext();) {
        TypeParameter t = i.next();
        t.accept(this, arg);
        if (i.hasNext()) {
          printer.print(", ");
        }
      }
      printer.print(">");
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeParameter

      modifiers);
  }

  private TypeParameter createTypeParameter(char[] typeParameterName, char[][] typeParameterBounds, int start, int end) {

    TypeParameter parameter = new TypeParameter();
    parameter.name = typeParameterName;
    parameter.sourceStart = start;
    parameter.sourceEnd = end;
    if (typeParameterBounds != null) {
      int length = typeParameterBounds.length;
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeParameter

  private String genSourceSignature(MethodDeclaration methodDeclaration) {
    StringBuffer output = new StringBuffer();
    ASTNode.printModifiers(methodDeclaration.modifiers, output);

    // Append Type Parameters if any
    TypeParameter types[] = methodDeclaration.typeParameters();
    if (types != null && types.length != 0) {
      output.append("<");
      for (int i = 0; i < types.length; i++) {
        if (i > 0) {
          output.append(", ");
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeParameter

  private String genSourceSignature(ConstructorDeclaration constructorDeclaration) {
    StringBuffer output = new StringBuffer();
    ASTNode.printModifiers(constructorDeclaration.modifiers, output);

    // Append Type Parameters if any
    TypeParameter types[] = constructorDeclaration.typeParameters();
    if (types != null && types.length != 0) {
      output.append("<");
      for (int i = 0; i < types.length; i++) {
        if (i > 0) {
          output.append(", ");
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeParameter

* we replace the TypeParameter(s) with SingleTypeReference(s) so that everything will go
* smoothly down the line.
*/
private void convertTypeParametersToSingleTypeReferences() {
  for(int typeParameterIndex = 0; typeParameterIndex < genericsLengthStack[genericsLengthPtr]; typeParameterIndex++) {
    TypeParameter tp = (TypeParameter) genericsStack[genericsPtr - typeParameterIndex];
    SingleTypeReference str = new SingleTypeReference(tp.name,tp.declarationSourceStart);
    genericsStack[genericsPtr - typeParameterIndex] = str;
  }
}
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.