Package org.springframework.osgi.test.internal.util

Examples of org.springframework.osgi.test.internal.util.DependencyVisitor


   * @param resource
   * @return
   */
  private Set determineImportsForClass(String className, Resource resource) {
    Assert.notNull(resource, "a not-null class is required");
    DependencyVisitor visitor = new DependencyVisitor();

    boolean trace = logger.isTraceEnabled();

    ClassReader reader;

    try {
      if (trace)
        logger.trace("Visiting class " + className);
      reader = new ClassReader(resource.getInputStream());
    }
    catch (Exception ex) {
      throw (RuntimeException) new IllegalArgumentException("Cannot read class " + className).initCause(ex);
    }
    reader.accept(visitor, false);

    // convert from / to . format
    Set originalPackages = visitor.getPackages();
    Set pkgs = new LinkedHashSet(originalPackages.size());

    for (Iterator iterator = originalPackages.iterator(); iterator.hasNext();) {
      String pkg = (String) iterator.next();
      pkgs.add(pkg.replace('/', '.'));
View Full Code Here


   * @param resource
   * @return
   */
  private Set determineImportsForClass(String className, Resource resource) {
    Assert.notNull(resource, "a not-null class is required");
    DependencyVisitor visitor = new DependencyVisitor();

    boolean trace = logger.isTraceEnabled();

    ClassReader reader;

    try {
      if (trace)
        logger.trace("Visiting class " + className);
      reader = new ClassReader(resource.getInputStream());
    }
    catch (Exception ex) {
      throw (RuntimeException) new IllegalArgumentException("Cannot read class " + className).initCause(ex);
    }
    reader.accept(visitor, false);

    // convert from / to . format
    Set originalPackages = visitor.getPackages();
    Set pkgs = new LinkedHashSet(originalPackages.size());

    for (Iterator iterator = originalPackages.iterator(); iterator.hasNext();) {
      String pkg = (String) iterator.next();
      pkgs.add(pkg.replace('/', '.'));
View Full Code Here

TOP

Related Classes of org.springframework.osgi.test.internal.util.DependencyVisitor

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.