Package com.sun.mirror.type

Examples of com.sun.mirror.type.ClassType


        }
      }
    }

    if (delegate instanceof ClassDeclaration) {
      ClassType superclass = ((ClassDeclaration) delegate).getSuperclass();
      if (superclass != null && superclass.getDeclaration() != null) {
        List<SubResourceLocator> superMethods = getSubresourceLocators(superclass.getDeclaration());
        for (SubResourceLocator superMethod : superMethods) {
          if (!isOverridden(superMethod, resourceLocators)) {
            resourceLocators.add(superMethod);
          }
        }
View Full Code Here


        }
      }
    }

    if (delegate instanceof ClassDeclaration) {
      ClassType superclass = ((ClassDeclaration) delegate).getSuperclass();
      if (superclass != null && superclass.getDeclaration() != null) {
        List<ResourceMethod> superMethods = getResourceMethods(superclass.getDeclaration());
        for (ResourceMethod superMethod : superMethods) {
          if (!isOverridden(superMethod, resourceMethods)) {
            resourceMethods.add(superMethod);
          }
        }
View Full Code Here

    }
    else if (Throwable.class.getName().equals(declaration.getQualifiedName())) {
      return false;
    }
    else {
      ClassType superClass = ((ClassDeclaration) declaration).getSuperclass();
      return ((DecoratedTypeMirror) TypeMirrorDecorator.decorate(superClass)).isInstanceOf(Throwable.class.getName());
    }
  }
View Full Code Here

      }
    }

    if (isClass()) {
      //the spec says we need to consider superclass methods, too...
      ClassType superclass = ((ClassDeclaration) getDelegate()).getSuperclass();
      if (superclass != null) {
        ClassDeclaration declaration = superclass.getDeclaration();
        while ((declaration != null) && (!Object.class.getName().equals(declaration.getQualifiedName()))) {
          for (MethodDeclaration method : declaration.getMethods()) {
            if (isWebMethod(method)) {
              //todo: if this method is overridden, don't add it.
              webMethods.add(new WebMethod(method, this));
            }
          }

          superclass = declaration.getSuperclass();
          if (superclass == null) {
            declaration = null;
          }
          else {
            declaration = superclass.getDeclaration();
          }
        }
      }
    }
View Full Code Here

  public WebFault(ClassDeclaration delegate) {
    super(delegate);

    this.annotation = getAnnotation(javax.xml.ws.WebFault.class);

    ClassType explicitFaultBeanType = null;
    Collection<PropertyDeclaration> properties = getProperties();
    PropertyDeclaration faultInfoProperty = null;
    for (PropertyDeclaration propertyDeclaration : properties) {
      if ("faultInfo".equals(propertyDeclaration.getPropertyName())) {
        faultInfoProperty = propertyDeclaration;
        break;
      }
    }

    if ((faultInfoProperty != null) && (faultInfoProperty.getPropertyType() instanceof ClassType)) {
      ClassType faultInfoType = (ClassType) faultInfoProperty.getPropertyType();
      if (faultInfoType.getDeclaration() == null) {
        throw new ValidationException(getPosition(), getQualifiedName() + ": class not found: " + faultInfoType + ".");
      }

      boolean messageConstructorFound = false;
      boolean messageAndThrowableConstructorFound = false;
      Collection<ConstructorDeclaration> constructors = getConstructors();
      for (ConstructorDeclaration constructor : constructors) {
        if (constructor.getModifiers().contains(Modifier.PUBLIC)) {
          ParameterDeclaration[] parameters = constructor.getParameters().toArray(new ParameterDeclaration[constructor.getParameters().size()]);
          if (parameters.length >= 2) {
            DecoratedTypeMirror param0Type = (DecoratedTypeMirror) TypeMirrorDecorator.decorate(parameters[0].getType());
            DecoratedTypeMirror param1Type = (DecoratedTypeMirror) TypeMirrorDecorator.decorate(parameters[1].getType());
            if (parameters.length == 2) {
              messageConstructorFound |= param0Type.isInstanceOf(String.class.getName()) && param1Type.isInstanceOf(faultInfoType.getDeclaration().getQualifiedName());
            }
            else if (parameters.length == 3) {
              DecoratedTypeMirror param2Type = (DecoratedTypeMirror) TypeMirrorDecorator.decorate(parameters[2].getType());
              messageAndThrowableConstructorFound |= param0Type.isInstanceOf(String.class.getName())
                && param1Type.isInstanceOf(faultInfoType.getDeclaration().getQualifiedName())
                && param2Type.isInstanceOf(Throwable.class.getName());
            }
          }
        }
      }
View Full Code Here

  private static final class ExtensionDepthComparator implements Comparator<TypeDefinition> {
    public int compare(TypeDefinition t1, TypeDefinition t2) {
      int depth1 = 0;
      int depth2 = 0;

      ClassType superClass = t1.getSuperclass();
      while (superClass != null && superClass.getDeclaration() != null && !Object.class.getName().equals(superClass.getDeclaration().getQualifiedName())) {
        depth1++;
        superClass = superClass.getDeclaration().getSuperclass();
      }

      superClass = t2.getSuperclass();
      while (superClass != null && superClass.getDeclaration() != null && !Object.class.getName().equals(superClass.getDeclaration().getQualifiedName())) {
        depth2++;
        superClass = superClass.getDeclaration().getSuperclass();
      }

      return depth1 - depth2;
    }
View Full Code Here

  private static final class ExtensionDepthComparator implements Comparator<TypeDefinition> {
    public int compare(TypeDefinition t1, TypeDefinition t2) {
      int depth1 = 0;
      int depth2 = 0;

      ClassType superClass = t1.getSuperclass();
      while (superClass != null && superClass.getDeclaration() != null && !Object.class.getName().equals(superClass.getDeclaration().getQualifiedName())) {
        depth1++;
        superClass = superClass.getDeclaration().getSuperclass();
      }

      superClass = t2.getSuperclass();
      while (superClass != null && superClass.getDeclaration() != null && !Object.class.getName().equals(superClass.getDeclaration().getQualifiedName())) {
        depth2++;
        superClass = superClass.getDeclaration().getSuperclass();
      }

      return depth1 - depth2;
    }
View Full Code Here

  private static final class ExtensionDepthComparator implements Comparator<TypeDefinition> {
    public int compare(TypeDefinition t1, TypeDefinition t2) {
      int depth1 = 0;
      int depth2 = 0;

      ClassType superClass = t1.getSuperclass();
      while (superClass != null && superClass.getDeclaration() != null && !Object.class.getName().equals(superClass.getDeclaration().getQualifiedName())) {
        depth1++;
        superClass = superClass.getDeclaration().getSuperclass();
      }

      superClass = t2.getSuperclass();
      while (superClass != null && superClass.getDeclaration() != null && !Object.class.getName().equals(superClass.getDeclaration().getQualifiedName())) {
        depth2++;
        superClass = superClass.getDeclaration().getSuperclass();
      }

      return depth1 - depth2;
    }
View Full Code Here

    }

    public TypeDeclaration getSuperClass(TypeDeclaration t) {
        if (t instanceof ClassDeclaration) {
            ClassDeclaration c = (ClassDeclaration) t;
            ClassType sup = c.getSuperclass();
            if(sup!=null)
                return sup.getDeclaration();
            else
                return null;
        }
        return env.getTypeDeclaration(Object.class.getName());
    }
View Full Code Here

    public static boolean isSubtype(TypeDeclaration d1, TypeDeclaration d2) {
        if (d1.equals(d2))
            return true;
        ClassDeclaration superClassDecl = null;
        if (d1 instanceof ClassDeclaration) {
            ClassType superClass = ((ClassDeclaration)d1).getSuperclass();
            if (superClass != null) {
                superClassDecl = superClass.getDeclaration();
                if (superClassDecl.equals(d2))
                    return true;
            }
        }
        InterfaceDeclaration superIntf = null;
View Full Code Here

TOP

Related Classes of com.sun.mirror.type.ClassType

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.