package lc.mecha.olap.xmla;

import lc.mecha.log.MechaLogger;
import lc.mecha.log.MechaLoggerFactory;
import lc.mecha.util.StringUtil;
import lc.mecha.util.Translator;

/**
 * Implementation of the {@link Translator} interface which strips table prefixes from SSAS keys. For example,
 * <code>$foo[bar]</code> is translated to <code>bar</code>.
 *
 * @author Alex Leigh
 * @since mk12 mod2 (RETROGRADE)
 */
public class SsasKeyTranslator implements Translator<String> {
    private static final MechaLogger logger = MechaLoggerFactory.getLogger(SsasKeyTranslator.class);

    @Override
    public String getTranslation(String originalValue) {
        return StringUtil.findInSquareBrackets(originalValue);
    }
}
