Package com.sun.javadoc

Examples of com.sun.javadoc.Type


    final ClassDoc foundClassDoc = findAnnotatedInterface(klass, soughtAnnotations);
    if (foundClassDoc != null) {
      return foundClassDoc;
    }

    final Type superclass = klass.superclassType();
    if (superclass != null && superclass.asClassDoc() != null) {
      return findAnnotatedClass(superclass.asClassDoc(), soughtAnnotations);
    }
    return null;
  }
View Full Code Here


    for (final Type interfaceType : interfaceTypes) {
      final ClassDoc interfaceClassDoc = interfaceType.asClassDoc();
      if (interfaceClassDoc != null) {
        if (interfaceClassDoc.qualifiedTypeName().equals(typeName))
          return interfaceClassDoc;
        final Type foundType = findSuperTypeFromInterface(interfaceClassDoc, typeName);
        if (foundType != null) {
          return foundType;
        }
      }
    }
View Full Code Here

  public static Type findSuperTypeFromClass(final ClassDoc klass, String typeName) {
    if (klass.qualifiedTypeName().equals(typeName))
      return klass;

    // find it in the interfaces
    final Type foundType = findSuperTypeFromInterface(klass, typeName);
    if (foundType != null) {
      return foundType;
    }

    final Type superclass = klass.superclassType();
    if (superclass != null && superclass.asClassDoc() != null) {
      return findSuperTypeFromClass(superclass.asClassDoc(), typeName);
    }
    return null;
  }
View Full Code Here

    }
    return false;
  }

  public static boolean isCollection(Type type) {
    Type collectionType = Utils.findSuperType(type, "java.util.Collection");
    // FIXME: this is dodgy at best
    return collectionType != null;
  }
View Full Code Here

    String dimension = type.dimension();
    return dimension != null && dimension.length() > 0;
  }

  public static Type getCollectionType(Type type, JAXDoclet<?> doclet) {
    Type collectionType = Utils.findSuperType(type, "java.util.Collection");
    // FIXME: this is dodgy at best
    if (collectionType != null) {
      ParameterizedType parameterizedType = type.asParameterizedType();
      Type[] types = parameterizedType == null ? null : parameterizedType.typeArguments();
      if (types != null && types.length == 1)
View Full Code Here

      }
    } catch (NullPointerException e) {

    }
    // now try FQDN
    Type type = doclet.forName(typeName);
    if (type != null)
      return type;
    log("resolving failed for " + typeName + " in " + klass.qualifiedTypeName());
    return null;
  }
View Full Code Here

      jaxbClasses.add(jaxbClass);
      registry.addJAXBClass(jaxbClass);
      // load all used types
      List<JAXBMember> members = jaxbClass.getMembers();
      for (JAXBMember member : members) {
        Type type = member.getJavaType();
        ClassDoc doc = type.asClassDoc();
        if (doc != null) {
          handleJAXBClass(doc);
        }
      }
    }
View Full Code Here

  @Override
  public String getName() {
    if (!isManyToMany())
      return super.getName();
    String table, property;
    Type target = getJavaType();
    JPAClass targetJPA = klass.getRegistry().getJPAClass(target.qualifiedTypeName());
    if (!owning) {
      Relation inverseRelation = targetJPA.getRelation(mappedBy);
      joinTable = inverseRelation.joinTable;
    }
    if (joinTable == null) {
      table = klass.getName() + "_" + target.typeName();
      property = target.typeName();
    } else {
      table = (String) Utils.getAnnotationValue(joinTable, "name");
      AnnotationValue[] joinColumns = (AnnotationValue[]) Utils
          .getAnnotationValue(joinTable, owning ? "joinColumns" : "inverseJoinColumns");
      AnnotationDesc joinColumn = (AnnotationDesc) joinColumns[0].value();
View Full Code Here

      jpaClasses.add(jpaClass);
      registry.addJPAClass(jpaClass);
      // load all used types
      List<JPAMember> members = jpaClass.getMembers();
      for (JPAMember member : members) {
        Type type = member.getJavaType();
        ClassDoc doc = type.asClassDoc();
        if (doc != null && Utils.findAnnotatedClass(doc, jpaAnnotations) != null) {
          handleJPAClass(doc);
        }
      }
    }
View Full Code Here

    return typeName;
  }

  public boolean isJPAType() {
    Type type = getJavaType();
    return !type.isPrimitive() && klass.getRegistry().isJPAClass(type.qualifiedTypeName());
  }
View Full Code Here

TOP

Related Classes of com.sun.javadoc.Type

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.