use of org.openxmlformats.schemas.drawingml.x2006.main.CTTableCellProperties in project poi by apache.
the class XSLFPropertiesDelegate method getDelegate.
@SuppressWarnings("unchecked")
private static <T> T getDelegate(Class<T> clazz, XmlObject props) {
Object obj = null;
if (props == null) {
return null;
} else if (props instanceof CTShapeProperties) {
obj = new ShapeDelegate((CTShapeProperties) props);
} else if (props instanceof CTBackgroundProperties) {
obj = new BackgroundDelegate((CTBackgroundProperties) props);
} else if (props instanceof CTStyleMatrixReference) {
obj = new StyleMatrixDelegate((CTStyleMatrixReference) props);
} else if (props instanceof CTTableCellProperties) {
obj = new TableCellDelegate((CTTableCellProperties) props);
} else if (props instanceof CTNoFillProperties || props instanceof CTSolidColorFillProperties || props instanceof CTGradientFillProperties || props instanceof CTBlipFillProperties || props instanceof CTPatternFillProperties || props instanceof CTGroupFillProperties) {
obj = new FillPartDelegate(props);
} else if (props instanceof CTFillProperties) {
obj = new FillDelegate((CTFillProperties) props);
} else if (props instanceof CTLineProperties) {
obj = new LineStyleDelegate((CTLineProperties) props);
} else if (props instanceof CTTextCharacterProperties) {
obj = new TextCharDelegate((CTTextCharacterProperties) props);
} else {
LOG.log(POILogger.ERROR, props.getClass() + " is an unknown properties type");
return null;
}
if (clazz.isInstance(obj)) {
return (T) obj;
}
LOG.log(POILogger.WARN, obj.getClass() + " doesn't implement " + clazz);
return null;
}
Aggregations