package leigh.mecha.olap.xmla;

import leigh.mecha.log.MechaLogger;
import leigh.mecha.log.MechaLoggerFactory;
import leigh.mecha.util.StringUtil;
import leigh.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);
    }
}
