Package org.eclipse.jdt.core.dom

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


      CompilationUnit cu = compilationUnitCache.getCompilationUnit(targetClass);
      addImportToCompilationUnit(interfaceClass, cu);

      TypeDeclaration typeDeclaration = compilationUnitCache.getTypeDeclaration(targetClass);
      AST ast = cu.getAST();
      SimpleType interfaceType = ast.newSimpleType(createQualifiedName(ast, interfaceClass));

      typeDeclaration.superInterfaceTypes().add(interfaceType);
    } catch (Exception e) {
      warnings.add(String.format(Messages.getString("org.apache.openejb.helper.annotation.warnings.12"), interfaceClass, targetClass)); //$NON-NLS-1$
    }
View Full Code Here


      PrimitiveType type = PrimitiveType.class.cast(someType);
      return new TypeWrapperPrimitive(type);
    }

    if (someType.isSimpleType()) {
      SimpleType type = SimpleType.class.cast(someType);
      return new TypeWrapperSimple(type);
    }

    throw new UnsupportedOperationException();
  }
View Full Code Here

  public void throwNew(Class<? extends Exception> exceptionClass) {
    String simpleName = exceptionClass.getSimpleName();
    SimpleName exName = ast.newSimpleName(simpleName);

    SimpleType exType = ast.newSimpleType(exName);
    ClassInstanceCreation newExType = ast.newClassInstanceCreation();
    newExType.setType(exType);

    ThrowStatement statement = ast.newThrowStatement();
    statement.setExpression(newExType);
View Full Code Here

                getModel().addRelation(inheritance);
            }
        } else {
            String lClassID = AbstractASTNodeHandler.UNDEFINED_BINDING;
            if (getASTNode().getParent() instanceof ClassInstanceCreation) {
                SimpleType castedType = (SimpleType) ((ClassInstanceCreation) getASTNode().getParent()).getType();
                lClassID += AbstractFamixEntity.NAME_DELIMITER + castedType.getName().getFullyQualifiedName();
            }
            lImplementedType = getFactory().createClass(lClassID, null);
            lImplementedType = (FamixClass) getModel().addElement(lImplementedType);
            // We do not know whether it is a superclass or an interface; we create a Subtype
            FamixAssociation subtyping = getFactory().createSubtyping(getCurrType(), lImplementedType);
View Full Code Here

        if (AstNodeUtils.getEnclosingNode(node, ImportDeclaration.class) != null) {
          return;
        }
        // check known cases
        if (node instanceof SimpleType) {
          SimpleType simpleType = (SimpleType) node;
          ITypeBinding typeBinding = simpleType.resolveBinding();
          checkNode(node, typeBinding);
        } else if (node instanceof SimpleName) {
          SimpleName simpleName = (SimpleName) node;
          if (simpleName.resolveBinding().getKind() == IBinding.TYPE
              && node.getLocationInParent() == MethodInvocation.EXPRESSION_PROPERTY) {
View Full Code Here

        String superServiceName = AstNodeUtils.getFullyQualifiedName(typeBinding, false);
        String superAsyncName = superServiceName + "Async";
        if (javaProject.findType(superAsyncName) != null) {
          if (type instanceof SimpleType) {
            {
              SimpleType simpleType = (SimpleType) type;
              String superAsyncNameSimple = CodeUtils.getShortClass(superAsyncName);
              simpleType.setName(ast.newSimpleName(superAsyncNameSimple));
            }
            if (!CodeUtils.isSamePackage(serviceName, superAsyncName)) {
              addImport(serviceUnit, superAsyncName);
            }
            continue;
View Full Code Here

   }

   @Override
   public JavaClass setSuperType(final String type)
   {
      SimpleType simpleType = unit.getAST().newSimpleType(unit.getAST().newSimpleName(Types.toSimpleName(type)));
      getBodyDeclaration().setStructuralProperty(TypeDeclaration.SUPERCLASS_TYPE_PROPERTY, simpleType);
      return this;
   }
View Full Code Here

   }

   @Override
   public JavaClass setSuperType(final String type)
   {
      SimpleType simpleType = unit.getAST().newSimpleType(unit.getAST().newSimpleName(Types.toSimpleName(type)));
      getBodyDeclaration().setStructuralProperty(TypeDeclaration.SUPERCLASS_TYPE_PROPERTY, simpleType);

      if (!hasImport(type) && Types.isQualified(type))
      {
         addImport(type);
View Full Code Here

    String typeName = null;
    if(syntaxTreeNode!=null) {
      //If we don't have a tool for manipulating the supplier,
      if(syntaxTreeNode.getReturnType2() instanceof SimpleType) {
        //Then we try to find it in the model
        SimpleType supplierType =
          (SimpleType)syntaxTreeNode.getReturnType2();
        ITypeBinding binding = supplierType.resolveBinding();
        if(binding!=null) {
          typeName = binding.getQualifiedName();
        }
      }
    }
View Full Code Here

    boolean imported = false;
    // If we don't have a tool for manipulating the supplier,
    if(syntaxTreeNode!=null) {
      if(syntaxTreeNode.getType() instanceof SimpleType) {
        // Then we try to find it in the model
        SimpleType supplierType =
          (SimpleType)syntaxTreeNode.getType();
        ITypeBinding binding = supplierType.resolveBinding();
        if(binding!=null) {
          typeName = binding.getQualifiedName();
        }
      }
    }
View Full Code Here

TOP

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

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.