Package net.windwards.options.err

Examples of net.windwards.options.err.UnsupportedTypeException


        Class<? extends ValueParser> parserKlazz = annotation.valueParser();
        if (parserKlazz != NullValueParser.class) {
            try {
                this.valueParser = parserKlazz.newInstance();
            } catch (Exception e) {
                throw new UnsupportedTypeException("Failed to instantiate " +
                        "value parser " + parserKlazz.getName() +
                        " for option --" + this.longOptionName);
            }
        } else if (type.isEnum()) {
            this.valueParser = new EnumValueParser();
            Object[] constants = type.getEnumConstants();
            this.alternatives = new HashSet<String>();
            for (Object enumValue : constants) {
                this.alternatives.add(enumValue.toString());
            }
        } else {
            this.valueParser = parsers.get(type);
            if(this.valueParser == null)
                throw new UnsupportedTypeException("Internal error: Option --" +
                        this.longOptionName + " has unsupported type " + type.getName());
        }
    }
View Full Code Here


/**
* Created by quest on 2013-06-06.
*/
public class NullValueParser implements ValueParser {
    public Object parse(OptionDescription desc, Class<?> type, String value) throws InvalidOptionValue {
        throw new UnsupportedTypeException("Internal error: Option --" +
                desc.longOptionName + " has unsupported type " + type.getName());
    }
View Full Code Here

TOP

Related Classes of net.windwards.options.err.UnsupportedTypeException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.