Package org.eclipse.jdt.core.dom

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


                lParameter.setModifiers(((SingleVariableDeclaration) lParamDeclaration).getModifiers());
                lParameter.setSourceAnchor(getSourceAnchor((SingleVariableDeclaration) lParamDeclaration));
                getCurrMethod().getParameters().add(lParameter);

                // set data type
                ITypeBinding pBinding = ((SingleVariableDeclaration) lParamDeclaration).getType().resolveBinding();
                FamixClass lDataType = getClass(pBinding, ((SingleVariableDeclaration) lParamDeclaration).getType(), false);
                lDataType = (FamixClass) getModel().addElement(lDataType);
                lParameter.setDeclaredClass(lDataType);

                position++;
View Full Code Here


    public boolean visit(ASTNode instanceofExpression) {
        boolean visitChildren = true;
        setASTNode(instanceofExpression);

        try {
            ITypeBinding lBinding = getASTNode().getRightOperand().resolveBinding();
            FamixClass lClass = getClass(lBinding, getASTNode().getRightOperand(), false);
            lClass = (FamixClass) getModel().addElement(lClass);
            FamixAssociation instanceOf = getFactory().createCheckInstanceOf(getCurrMethod(), lClass);
            instanceOf.setSourceAnchor(getSourceAnchor());
            getModel().addRelation(instanceOf);
View Full Code Here

    public void endVisit() {
    // currently not used
    }

    private void initDataType() {
        ITypeBinding lTypeBinding = getASTNode().getType().resolveBinding();
        FamixClass lDataType = getClass(lTypeBinding, getASTNode().getType(), false);
        lDataType = (FamixClass) getModel().addElement(lDataType);
        setDataType(lDataType);
    }
View Full Code Here

     */
    private void addAnonymousClass(UnresolvedMethodInvocation unresolvedMethodInvocation, FamixMethod calleeMethod) {
        ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) unresolvedMethodInvocation.getASTNode();
        // determine the anonymous class from the string
        FamixClass lDeclaringClass = null;
        ITypeBinding lTypeBinding = classInstanceCreation.resolveTypeBinding();
        if (lTypeBinding != null) {
            lDeclaringClass = unresolvedMethodInvocation.getInvocationHandler().getClass(lTypeBinding, null, true);
        } else {
            String lClassID = calleeMethod.getUniqueName();
            lClassID = lClassID.substring(0, lClassID.indexOf(AbstractFamixEntity.CONSTRUCTOR_PREFIX) - 1);
View Full Code Here

     * {@inheritDoc}
     */
    @Override
    public void resolveObjectIdentifier() {
        if (!isObjectIDResolved()) {
            ITypeBinding lTBinding = ((ClassInstanceCreation) getASTNode()).resolveTypeBinding();
            String classID = "";
            if (lTBinding != null) {
                classID = getInvocationHandler().convert(lTBinding);
            } else {
                classID = getInvocationHandler().convert(((ClassInstanceCreation) getASTNode()).getType());
View Full Code Here

      public void associationTemplate(JavaInfo component, String[] source) throws Exception {
        // Column creation
        if (component instanceof ColumnInfo && component.getParent() == AbstractCellTableInfo.this) {
          String rowTypeName;
          {
            ITypeBinding rowTypeBinding = getRowTypeBinding();
            rowTypeName = AstNodeUtils.getFullyQualifiedName(rowTypeBinding, false);
          }
          // apply "%rowType%" into creation source
          source[0] = StringUtils.replace(source[0], "%rowType%", rowTypeName);
        }
View Full Code Here

    String cellTypeName = null;
    // if anonymous, then it was mocked as TextColumn
    if (getCreationSupport().getNode() instanceof ClassInstanceCreation) {
      ClassInstanceCreation creation = (ClassInstanceCreation) getCreationSupport().getNode();
      if (creation.getAnonymousClassDeclaration() != null) {
        ITypeBinding anonymousBinding = AstNodeUtils.getTypeBinding(creation);
        ITypeBinding superBinding = anonymousBinding.getSuperclass();
        String superName = AstNodeUtils.getFullyQualifiedName(superBinding, false);
        if ("com.google.gwt.user.cellview.client.Column".equals(superName)) {
          Expression cellExpression = DomGenerics.arguments(creation).get(0);
          cellTypeName = AstNodeUtils.getFullyQualifiedName(cellExpression, false);
        }
View Full Code Here

  public Object evaluateParameter(EvaluationContext context,
      MethodDeclaration methodDeclaration,
      String methodSignature,
      SingleVariableDeclaration parameter,
      int index) throws Exception {
    ITypeBinding typeBinding = AstNodeUtils.getTypeBinding(parameter);
    // special support for:
    //    com.google.gwt.user.client.ui.ImageBundle
    //    com.google.gwt.i18n.client.Constants
    if (AstNodeUtils.isSuccessorOf(typeBinding, "com.google.gwt.user.client.ui.ImageBundle")
        || AstNodeUtils.isSuccessorOf(typeBinding, "com.google.gwt.i18n.client.Constants")) {
View Full Code Here

          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) {
            ITypeBinding typeBinding = simpleName.resolveTypeBinding();
            checkNode(node, typeBinding);
          }
        }
      }

      private void checkNode(ASTNode node, ITypeBinding typeBinding) throws Exception {
        if (typeBinding != null) {
          // ignore generics type variable
          if (typeBinding.isTypeVariable()) {
            return;
          }
          // only top level types can be found as source
          while (typeBinding.getDeclaringClass() != null) {
            typeBinding = typeBinding.getDeclaringClass();
          }
          // check this type
          String typeName = AstNodeUtils.getFullyQualifiedName(typeBinding, true);
          if (isSecondarySourceType(typeName)) {
            return;
View Full Code Here

   * @return the icon {@link Image} which corresponds to the type argument of this
   *         <code>NumberLabel</code> instance.
   */
  private Image getTypeIcon() {
    Expression creationExpression = (Expression) getCreationSupport().getNode();
    ITypeBinding creationBinding = AstNodeUtils.getTypeBinding(creationExpression);
    ITypeBinding typeBinding = AstNodeUtils.getTypeBindingArgument(creationBinding, 0);
    String typeName = AstNodeUtils.getFullyQualifiedName(typeBinding, false);
    for (CreationDescription creation : getDescription().getCreations()) {
      if (StringUtils.endsWith(typeName, "." + creation.getId())) {
        return creation.getIcon();
      }
View Full Code Here

TOP

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

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.