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

org.jxls.util.UtilWrapper Maven / Gradle / Ivy

There is a newer version: 3.0.0
Show newest version
package org.jxls.util;

import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.InvocationTargetException;
import java.util.Collection;
import java.util.List;
import java.util.Map;

import org.jxls.common.CellRef;
import org.jxls.common.Context;
import org.jxls.common.GroupData;
import org.jxls.expression.ExpressionEvaluator;

/**
 * A wrapper around {@link Util} class to prevent static methods spreading
 */
public class UtilWrapper {

    public List getFormulaCellRefs(String formula) {
        return Util.getFormulaCellRefs(formula);
    }

    public List getJointedCellRefs(String formula) {
        return Util.getJointedCellRefs(formula);
    }

    public List getCellRefsFromJointedCellRef(String jointedCellRef) {
        return Util.getCellRefsFromJointedCellRef(jointedCellRef);
    }

    public boolean formulaContainsJointedCellRef(String formula) {
        return Util.formulaContainsJointedCellRef(formula);
    }

    public String createTargetCellRef(List targetCellDataList) {
        return Util.createTargetCellRef(targetCellDataList);
    }

    public String joinStrings(List strings, String separator) {
        return Util.joinStrings(strings, separator);
    }

    public List> groupByRanges(List cellRefList, int targetRangeCount) {
        return Util.groupByRanges(cellRefList, targetRangeCount);
    }

    public List> groupByColRange(List cellRefList) {
        return Util.groupByColRange(cellRefList);
    }

    public List> groupByRowRange(List cellRefList) {
        return groupByRowRange(cellRefList);
    }

    public Boolean isConditionTrue(ExpressionEvaluator evaluator, String condition, Context context) {
        return Util.isConditionTrue(evaluator, condition, context);
    }

    public Boolean isConditionTrue(ExpressionEvaluator evaluator, Context context) {
        return Util.isConditionTrue(evaluator, context);
    }

    public void setObjectProperty(Object obj, String propertyName, String propertyValue, boolean ignoreNonExisting) {
        Util.setObjectProperty(obj, propertyName, propertyValue, ignoreNonExisting);
    }

    public void setObjectProperty(Object obj, String propertyName, String propertyValue) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
        Util.setObjectProperty(obj, propertyName, propertyValue);
    }

    public Object getObjectProperty(Object obj, String propertyName, boolean failSilently) {
        return Util.getObjectProperty(obj, propertyName, failSilently);
    }

    public Object getObjectProperty(Object obj, String propertyName) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
        return Util.getObjectProperty(obj, propertyName);
    }

    public Collection groupCollection(Collection collection, String groupProperty, String groupOrder) {
        return Util.groupCollection(collection, groupProperty, groupOrder);
    }

    public Collection groupIterable(Iterable iterable, String groupProperty, String groupOrder) {
        return Util.groupIterable(iterable, groupProperty, groupOrder);
    }

    public byte[] toByteArray(InputStream stream) throws IOException {
        return Util.toByteArray(stream);
    }

    public Collection transformToCollectionObject(ExpressionEvaluator expressionEvaluator, String collectionName, Context context) {
        return Util.transformToCollectionObject(expressionEvaluator, collectionName, context);
    }

    public Iterable transformToIterableObject(ExpressionEvaluator expressionEvaluator, String collectionName,
            Context context) {
        return (Iterable) Util.transformToIterableObject(expressionEvaluator, collectionName, context);
    }

    public String sheetNameRegex(Map.Entry> cellRefEntry) {
        return Util.sheetNameRegex(cellRefEntry);
    }

    public List createTargetCellRefListByColumn(CellRef targetFormulaCellRef, List targetCells, List cellRefsToExclude) {
        return Util.createTargetCellRefListByColumn(targetFormulaCellRef, targetCells, cellRefsToExclude);
    }
}