/*
 * $Id: ScopeConverter.java,v 1.1 2006/04/11 16:14:32 sugimotokenichi Exp $
 * Copyright (C) 2006 SUGIMOTO Ken-ichi
 * 作成日: 2006/03/22
 */
package feat2.config.type;

import org.apache.commons.beanutils.ConversionException;
import org.apache.commons.beanutils.Converter;

/**
 * Scopeへのコンバータ。
 * @author SUGIMOTO Ken-ichi
 */
public class ScopeConverter implements Converter {

    public Object convert(Class type, Object value) {

        if ( value == null )
            throw new ConversionException("null");

        try {

            return new Scope(value.toString());

        }

        catch (IllegalArgumentException ex) {
            throw new ConversionException(ex);
        }

    }

}
