Examples of newSimpleName()


Examples of com.asakusafw.utils.java.model.syntax.ModelFactory.newSimpleName()

                new AttributeBuilder(f)
                    .annotation(context.resolve(Override.class))
                    .Public()
                    .toAttributes(),
                context.resolve(long.class),
                f.newSimpleName("__tgc__SystemId"),
                Collections.<FormalParameterDeclaration>emptyList(),
                statements);
    }

    private MethodDeclaration createDeletedMethod(
View Full Code Here

Examples of com.asakusafw.utils.java.model.syntax.ModelFactory.newSimpleName()

            statements.add(new ExpressionBuilder(f, Models.toLiteral(f, false))
                .toReturnStatement());
        } else {
            statements.add(new ExpressionBuilder(f, f.newThis())
                .method(context.getOptionGetterName(deleteFlagOrNull.findDeclaration()))
                .method("has", f.newSimpleName(FIELD_DELETE_FLAG_VALUE))
                .toReturnStatement());
        }
        return f.newMethodDeclaration(
                null,
                new AttributeBuilder(f)
View Full Code Here

Examples of com.asakusafw.utils.java.model.syntax.ModelFactory.newSimpleName()

                new AttributeBuilder(f)
                    .annotation(context.resolve(Override.class))
                    .Public()
                    .toAttributes(),
                context.resolve(boolean.class),
                f.newSimpleName("__tgc__Deleted"),
                Collections.<FormalParameterDeclaration>emptyList(),
                statements);
    }

    private boolean isTarget(ModelDeclaration model) {
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.core.dom.AST.newSimpleName()

          IType currentType = types[i];
          if (currentType.getElementName().equals(oldTypeName)) {
            AbstractTypeDeclaration typeNode = (AbstractTypeDeclaration) ((JavaElement) currentType).findNode(astCU);
            if (typeNode != null) {
              // rename type
              rewriter.replace(typeNode.getName(), ast.newSimpleName(newTypeName), null);
              // rename constructors
              Iterator bodyDeclarations = typeNode.bodyDeclarations().iterator();
              while (bodyDeclarations.hasNext()) {
                Object bodyDeclaration = bodyDeclarations.next();
                if (bodyDeclaration instanceof MethodDeclaration) {
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.core.dom.AST.newSimpleName()

                if (bodyDeclaration instanceof MethodDeclaration) {
                  MethodDeclaration methodDeclaration = (MethodDeclaration) bodyDeclaration;
                  if (methodDeclaration.isConstructor()) {
                    SimpleName methodName = methodDeclaration.getName();
                    if (methodName.getIdentifier().equals(oldTypeName)) {
                      rewriter.replace(methodName, ast.newSimpleName(newTypeName), null);
                    }
                  }
                }
              }
            }
View Full Code Here

Examples of org.eclipse.jdt.core.dom.AST.newSimpleName()

          try {
            AST ast = AST.newAST(AST.JLS3);
            CompilationUnit unit = ast.newCompilationUnit();
            PackageDeclaration packageDeclaration = ast
                .newPackageDeclaration();
            packageDeclaration.setName(ast.newSimpleName(pkg
                .getElementName()));
            unit.setPackage(packageDeclaration);
            TypeDeclaration type = ast.newTypeDeclaration();
            Javadoc comment = ast.newJavadoc();
            TagElement tag = ast.newTagElement();
View Full Code Here

Examples of org.eclipse.jdt.core.dom.AST.newSimpleName()

            comment.tags().add(tag);
            type.setJavadoc(comment);
            type.setInterface(false);
            type.modifiers()
                .add(ast.newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD));
            type.setName(ast.newSimpleName(className));
            type.bodyDeclarations().add(
                BodyDeclaration.copySubtree(type.getAST(),
                    methodDec));
            unit.types().add(type);
View Full Code Here

Examples of org.eclipse.jdt.core.dom.AST.newSimpleName()

          IType currentType = types[i];
          if (currentType.getElementName().equals(oldTypeName)) {
            AbstractTypeDeclaration typeNode = (AbstractTypeDeclaration) ((JavaElement) currentType).findNode(astCU);
            if (typeNode != null) {
              // rename type
              rewriter.replace(typeNode.getName(), ast.newSimpleName(newTypeName), null);
              // rename constructors
              Iterator bodyDeclarations = typeNode.bodyDeclarations().iterator();
              while (bodyDeclarations.hasNext()) {
                Object bodyDeclaration = bodyDeclarations.next();
                if (bodyDeclaration instanceof MethodDeclaration) {
View Full Code Here

Examples of org.eclipse.jdt.core.dom.AST.newSimpleName()

                if (bodyDeclaration instanceof MethodDeclaration) {
                  MethodDeclaration methodDeclaration = (MethodDeclaration) bodyDeclaration;
                  if (methodDeclaration.isConstructor()) {
                    SimpleName methodName = methodDeclaration.getName();
                    if (methodName.getIdentifier().equals(oldTypeName)) {
                      rewriter.replace(methodName, ast.newSimpleName(newTypeName), null);
                    }
                  }
                }
              }
            }
View Full Code Here

Examples of org.eclipse.jdt.core.dom.AST.newSimpleName()

            MethodDeclaration aMethod = (MethodDeclaration) currDeclaration;
            aMethod.setReturnType2(ast.newPrimitiveType(PrimitiveType.VOID));

            // Add AsyncCallback parameter
            SingleVariableDeclaration asyncCallbackParam = ast.newSingleVariableDeclaration();
            asyncCallbackParam.setName(ast.newSimpleName("callback")); //$NON-NLS-1$
            asyncCallbackParam.setType(ast.newSimpleType(ast.newName("AsyncCallback"))); //$NON-NLS-1$
            aMethod.parameters().add(asyncCallbackParam);

            // Remove throws
            aMethod.thrownExceptions().clear();
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.