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

org.docx4j.finders.TcFinder 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: 6.1.2
Show newest version
package org.docx4j.finders;

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

import org.docx4j.TraversalUtil.CallbackImpl;
import org.docx4j.wml.Tbl;
import org.docx4j.wml.Tc;

public class  TcFinder extends CallbackImpl {
	
	public List tcList = new ArrayList();  
			
	@Override
	public List apply(Object o) {
		
		if (o instanceof Tc ) {
			
			tcList.add((Tc)o);
		}			
		return null; 
	}
	
	@Override
	public boolean shouldTraverse(Object o) {
		
		// Yes, unless its a nested Tbl
		return !(o instanceof Tbl); 
	}
}