Package org.jboss.virtual

Examples of org.jboss.virtual.VisitorAttributes


      return cf;
   }

   private List<VirtualFile> getClasses(VFSDeploymentUnit unit)
   {
      VisitorAttributes va = new VisitorAttributes();
      va.setLeavesOnly(true);
      ClassFileFilter filter = new ClassFileFilter();
      SuffixesExcludeFilter noJars = new SuffixesExcludeFilter(JarUtils.getSuffixes());
      va.setRecurseFilter(noJars);
      FilterVirtualFileVisitor visitor = new FilterVirtualFileVisitor(filter, va);

      for (VirtualFile vf : unit.getClassPath())
      {
         try
View Full Code Here


   }
  
   public void testIncludeRootVisitSimple() throws Exception
   {
      MockVFSContext context = createSimpleVFSContextWithChildrenAndNonLeafs();
      VisitorAttributes attributes = new VisitorAttributes();
      attributes.setIncludeRoot(true);
      MockVirtualFileVisitor visitor = new MockVirtualFileVisitor(attributes);
      HashSet<String> expected = new HashSet<String>();
      expected.add("");
      expected.add("child1");
      expected.add("child2");
View Full Code Here

   }
  
   public void testIncludeRootVisitStructured() throws Exception
   {
      MockVFSContext context = createStructuredVFSContextWithChildrenAndNonLeafs();
      VisitorAttributes attributes = new VisitorAttributes();
      attributes.setIncludeRoot(true);
      MockVirtualFileVisitor visitor = new MockVirtualFileVisitor(attributes);
      HashSet<String> expected = new HashSet<String>();
      expected.add("");
      expected.add("child1");
      expected.add("child2");
View Full Code Here

   }
  
   public void testIncludeHiddenVisitSimple() throws Exception
   {
      MockVFSContext context = createSimpleVFSContextWithChildrenAndNonLeafsWithHidden();
      VisitorAttributes attributes = new VisitorAttributes();
      attributes.setIncludeHidden(true);
      MockVirtualFileVisitor visitor = new MockVirtualFileVisitor(attributes);
      HashSet<String> expected = new HashSet<String>();
      expected.add("child1");
      expected.add("child2");
      expected.add("child3");
View Full Code Here

   }
  
   public void testIncludeHiddenVisitStructured() throws Exception
   {
      MockVFSContext context = createStructuredVFSContextWithChildrenAndNonLeafsWithHidden();
      VisitorAttributes attributes = new VisitorAttributes();
      attributes.setIncludeHidden(true);
      MockVirtualFileVisitor visitor = new MockVirtualFileVisitor(attributes);
      HashSet<String> expected = new HashSet<String>();
      expected.add("child1");
      expected.add("child2");
      expected.add("child3");
View Full Code Here

      assertVisited(visitor, expected);
   }

   public void testVisitWithRoot() throws Exception
   {
      VisitorAttributes attributes = new VisitorAttributes();
      attributes.setIncludeRoot(true);
      attributes.setRecurseFilter(VisitorAttributes.RECURSE_ALL);
      MockVirtualFileHandlerVisitor visitor = new MockVirtualFileHandlerVisitor(attributes);

      Set<String> expected = new HashSet<String>();
      expected.add("children" + getSuffix());
      expected.add("child1");
View Full Code Here

      if (handler == null)
         throw new IllegalArgumentException("Null handler");
      if (visitor == null)
         throw new IllegalArgumentException("Null visitor");

      VisitorAttributes attributes = visitor.getAttributes();
      boolean includeRoot = attributes.isIncludeRoot();
      boolean leavesOnly = attributes.isLeavesOnly();
      boolean ignoreErrors = attributes.isIgnoreErrors();
      boolean includeHidden = attributes.isIncludeHidden();
      VirtualFileFilter recurseFilter = attributes.getRecurseFilter();
      visit(handler, visitor, includeRoot, leavesOnly, ignoreErrors, includeHidden, recurseFilter);
   }
View Full Code Here

      assertVisited(visitor, expected);
   }

   public void testVisitWithRoot() throws Exception
   {
      VisitorAttributes attributes = new VisitorAttributes();
      attributes.setIncludeRoot(true);
      attributes.setRecurseFilter(VisitorAttributes.RECURSE_ALL);
      MockVirtualFileVisitor visitor = new MockVirtualFileVisitor(attributes);

      Set<String> expected = new HashSet<String>();
      expected.add("children" + getSuffix());
      expected.add("child1");
View Full Code Here

    * @param filter the filter
    * @return resources list
    */
   public List<VirtualFile> getResources(VirtualFileFilter filter)
   {
      VisitorAttributes va = new VisitorAttributes();
      va.setLeavesOnly(true);
      SuffixesExcludeFilter noJars = new SuffixesExcludeFilter(JarUtils.getSuffixes());
      va.setRecurseFilter(noJars);
      FilterVirtualFileVisitor visitor = new FilterVirtualFileVisitor(filter, va);
      try
      {
         vf.visit(visitor);
      }
View Full Code Here

   }
  
   public void testIncludeRootVisitSimple() throws Exception
   {
      MockVFSContext context = createSimpleVFSContextWithChildrenAndNonLeafs();
      VisitorAttributes attributes = new VisitorAttributes();
      attributes.setIncludeRoot(true);
      MockVirtualFileVisitor visitor = new MockVirtualFileVisitor(attributes);
      HashSet<String> expected = new HashSet<String>();
      expected.add("");
      expected.add("child1");
      expected.add("child2");
View Full Code Here

TOP

Related Classes of org.jboss.virtual.VisitorAttributes

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.