All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.docx4j.finders.ClassFinder Maven / Gradle / Ivy

Go to download

docx4j is a library which helps you to work with the Office Open XML file format as used in docx documents, pptx presentations, and xlsx spreadsheets.

There is a newer version: 11.4.11
Show newest version
package org.docx4j.finders;

import java.util.ArrayList;
import java.util.List;

import org.docx4j.TraversalUtil.CallbackImpl;

public class ClassFinder extends CallbackImpl {
	  
	  protected Class typeToFind;
	  
	  public ClassFinder(Class typeToFind) {
		  this.typeToFind = typeToFind;
	  }
		
		public List results = new ArrayList(); 
		
		@Override
		public List apply(Object o) {
			
			// Adapt as required
			if (o.getClass().equals(typeToFind)) {
				results.add(o);
			}
			return null;
		}
}