Examples of ConfigOrigin


Examples of com.crashnote.external.config.ConfigOrigin

        if (consolidated.isEmpty()) {
            return null;
        } else if (consolidated.size() == 1) {
            return consolidated.get(0);
        } else {
            final ConfigOrigin mergedOrigin = SimpleConfigOrigin.mergeOrigins(consolidated);
            return new ConfigConcatenation(mergedOrigin, consolidated);
        }
    }
View Full Code Here

Examples of com.crashnote.external.config.ConfigOrigin

            final Collection<? extends AbstractConfigValue> stack) {
        if (stack.isEmpty())
            throw new ConfigException.BugOrBroken(
                    "can't merge origins on empty list");
        final List<ConfigOrigin> origins = new ArrayList<ConfigOrigin>();
        ConfigOrigin firstOrigin = null;
        int numMerged = 0;
        for (final AbstractConfigValue v : stack) {
            if (firstOrigin == null)
                firstOrigin = v.origin();
View Full Code Here

Examples of com.crashnote.external.config.ConfigOrigin

        final NameSource source = new FileNameSource();
        return SimpleIncluder.fromBasename(source, basename.getPath(), baseOptions);
    }

    static AbstractConfigObject emptyObject(final String originDescription) {
        final ConfigOrigin origin = originDescription != null ? SimpleConfigOrigin
                .newSimple(originDescription) : null;
        return emptyObject(origin);
    }
View Full Code Here

Examples of com.crashnote.external.config.ConfigOrigin

            return SimpleConfigOrigin.newSimple(originDescription);
    }

    /** For use ONLY by library internals, DO NOT TOUCH not guaranteed ABI */
    public static ConfigValue fromAnyRef(final Object object, final String originDescription) {
        final ConfigOrigin origin = valueOrigin(originDescription);
        return fromAnyRef(object, origin, FromMapMode.KEYS_ARE_KEYS);
    }
View Full Code Here

Examples of com.crashnote.external.config.ConfigOrigin

    }

    /** For use ONLY by library internals, DO NOT TOUCH not guaranteed ABI */
    public static ConfigObject fromPathMap(
            final Map<String, ? extends Object> pathMap, final String originDescription) {
        final ConfigOrigin origin = valueOrigin(originDescription);
        return (ConfigObject) fromAnyRef(pathMap, origin,
                FromMapMode.KEYS_ARE_PATHS);
    }
View Full Code Here

Examples of com.crashnote.external.config.ConfigOrigin

    protected SimpleConfigList newCopy(final ConfigOrigin newOrigin) {
        return new SimpleConfigList(newOrigin, value);
    }

    final SimpleConfigList concatenate(final SimpleConfigList other) {
        final ConfigOrigin combinedOrigin = SimpleConfigOrigin.mergeOrigins(origin(), other.origin());
        final List<AbstractConfigValue> combined = new ArrayList<AbstractConfigValue>(value.size()
                + other.value.size());
        combined.addAll(value);
        combined.addAll(other.value);
        return new SimpleConfigList(combinedOrigin, combined);
View Full Code Here

Examples of com.crashnote.external.config.ConfigOrigin

        // callers can get our original options and then parse with different
        // ones if they want.
        final ConfigParseOptions options = fixupOptions(baseOptions);

        // passed-in options can override origin
        final ConfigOrigin origin;
        if (options.getOriginDescription() != null)
            origin = SimpleConfigOrigin.newSimple(options.getOriginDescription());
        else
            origin = initialOrigin;
        return parseValue(origin, options);
View Full Code Here

Examples of com.crashnote.external.config.ConfigOrigin

                if (ConfigImpl.traceLoadsEnabled())
                    trace("Loading config from URL " + url.toExternalForm() + " from class loader "
                            + loader);

                final ConfigOrigin elementOrigin = ((SimpleConfigOrigin) origin).addURL(url);

                AbstractConfigValue v;

                // it's tempting to use ParseableURL here but it would be wrong
                // because the wrong relativeTo() would be used for includes.
View Full Code Here

Examples of com.crashnote.external.config.ConfigOrigin

            withComments = popToken();
            final Token t = withComments.token;

            if (Tokens.isProblem(t)) {
                final ConfigOrigin origin = t.origin();
                String message = Tokens.getProblemMessage(t);
                final Throwable cause = Tokens.getProblemCause(t);
                final boolean suggestQuotes = Tokens.getProblemSuggestQuotes(t);
                if (suggestQuotes) {
                    message = addQuoteSuggestion(t.toString(), message);
View Full Code Here

Examples of com.crashnote.external.config.ConfigOrigin

        }

        private AbstractConfigObject parseObject(final boolean hadOpenCurly) {
            // invoked just after the OPEN_CURLY (or START, if !hadOpenCurly)
            final Map<String, AbstractConfigValue> values = new HashMap<String, AbstractConfigValue>();
            final ConfigOrigin objectOrigin = lineOrigin();
            boolean afterComma = false;
            Path lastPath = null;
            boolean lastInsideEquals = false;

            while (true) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.