Package com.bungleton.yarrgs

Examples of com.bungleton.yarrgs.Positional


        Field unmatchedField = null;
        for (Field f : argumentHolder.getFields()) {
            if (Modifier.isStatic(f.getModifiers())) {
                continue;
            }
            Positional pos = f.getAnnotation(Positional.class);
            if (f.getAnnotation(Unmatched.class) != null) {
                YarrgConfigurationException.unless(f.getType().equals(List.class),
                    "'" + f + "' is @Unmatched but not a List");
                YarrgConfigurationException.unless(unmatchedField == null,
                    "'" + f + "' and '" + unmatchedField + "' both have @Unmatched");
                unmatchedField = f;
            } else if (f.getType().equals(Boolean.TYPE)) {
                addOption(new FlagOptionArgument(f));
                continue;
            }
            YarrgConfigurationException.unless(factory.handles(f), "Unhandled type: " + f);
            if (pos != null) {
                Map<Integer, PositionalArgument> positionals =
                        pos.value() < 0 ? negaPositionals : posiPositionals;
                PositionalArgument existent =
                    positionals.put(pos.value(), new PositionalArgument(f));
                if (existent != null) {
                    throw new YarrgConfigurationException("Attempted to assign '" + f
                        + "' to the same position as '" + existent.field + "'");
                }
            } else {
View Full Code Here

TOP

Related Classes of com.bungleton.yarrgs.Positional

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.