Package com.typesafe.config

Examples of com.typesafe.config.ConfigValueType


        }
        Class vc = field.getCollectionClass();
        boolean ar = field.isCollectionArray();
        if (!ar) {
            // check for autocollection wrapping
            ConfigValueType configValueType = config.root().get(field.getName()).valueType();
            if ((configValueType != ConfigValueType.LIST) && field.autoArrayEnabled()) {
                Object singleObject = hydrateField(vc, field.getName(), config);
                col.add(singleObject);
            } else {
                // safe to cast to Object[] since cannot have collections of primitives
View Full Code Here


        }
        Class vc = field.getCollectionClass();
        boolean ar = field.isCollectionArray();
        if (!ar) {
            // check for autocollection wrapping
            ConfigValueType configValueType = config.root().get(field.getName()).valueType();
            if ((configValueType != ConfigValueType.LIST) && field.autoArrayEnabled()) {
                Object singleObject = hydrateFieldComponent(vc, field.getName(), config);
                col.add(singleObject);
            } else {
                // safe to cast to Object[] since cannot have collections of primitives
View Full Code Here

        }
        Class vc = field.getCollectionClass();
        boolean ar = field.isCollectionArray();
        if (!ar) {
            // check for autocollection wrapping
            ConfigValueType configValueType = config.root().get(field.getName()).valueType();
            if ((configValueType != ConfigValueType.LIST) && field.autoArrayEnabled()) {
                Object singleObject = hydrateField(vc, field.getName(), config);
                col.add(singleObject);
            } else {
                // safe to cast to Object[] since cannot have collections of primitives
View Full Code Here

        }
        Class vc = field.getCollectionClass();
        boolean ar = field.isCollectionArray();
        if (!ar) {
            // check for autocollection wrapping
            ConfigValueType configValueType = config.root().get(field.getName()).valueType();
            if ((configValueType != ConfigValueType.LIST) && field.autoArrayEnabled()) {
                Object singleObject = hydrateFieldComponent(vc, field.getName(), config);
                col.add(singleObject);
            } else {
                // safe to cast to Object[] since cannot have collections of primitives
View Full Code Here

        }
        Class vc = field.getCollectionClass();
        boolean ar = field.isCollectionArray();
        if (!ar) {
            // check for autocollection wrapping
            ConfigValueType configValueType = config.root().get(field.getName()).valueType();
            if ((configValueType != ConfigValueType.LIST) && field.autoArrayEnabled()) {
                Object singleObject = hydrateFieldComponent(vc, field.getName(), config);
                col.add(singleObject);
            } else {
                // safe to cast to Object[] since cannot have collections of primitives
View Full Code Here

        }
        Class vc = field.getCollectionClass();
        boolean ar = field.isCollectionArray();
        if (!ar) {
            // check for autocollection wrapping
            ConfigValueType configValueType = config.root().get(field.getName()).valueType();
            if ((configValueType != ConfigValueType.LIST) && field.autoArrayEnabled()) {
                Object singleObject = hydrateFieldComponent(vc, field.getName(), config);
                col.add(singleObject);
            } else {
                // safe to cast to Object[] since cannot have collections of primitives
View Full Code Here

        }
        throw new IllegalStateException("Current node of type " + n.getClass().getName());
    }

    static JsonToken forConfigValue(ConfigValue configValue) {
        ConfigValueType valueType = configValue.valueType();
        switch (valueType) {
            case NUMBER:
                if (configValue.unwrapped() instanceof Double) {
                    return JsonToken.VALUE_NUMBER_FLOAT;
                } else {
                    return JsonToken.VALUE_NUMBER_INT;
                }
            case BOOLEAN:
                if (configValue.unwrapped().equals(Boolean.TRUE)) {
                    return JsonToken.VALUE_TRUE;
                } else {
                    return JsonToken.VALUE_FALSE;
                }
            case NULL:
                return JsonToken.VALUE_NULL;
            case STRING:
                return JsonToken.VALUE_STRING;
            case OBJECT:
                return JsonToken.START_OBJECT;
            case LIST:
                return JsonToken.START_ARRAY;
            default:
                // not possible unless the set of enums changes on us later
                throw new IllegalArgumentException(valueType.name() + " is not a supported ConfigValueType");
        }
    }
View Full Code Here

        }
        Class vc = field.getCollectionClass();
        boolean ar = field.isCollectionArray();
        if (!ar) {
            // check for autocollection wrapping
            ConfigValueType configValueType = config.root().get(field.getName()).valueType();
            if ((configValueType != ConfigValueType.LIST) && field.autoArrayEnabled()) {
                Object singleObject = hydrateFieldComponent(vc, field.getName(), config);
                col.add(singleObject);
            } else {
                // safe to cast to Object[] since cannot have collections of primitives
View Full Code Here

        }
        throw new IllegalStateException("Current node of type " + n.getClass().getName());
    }

    static JsonToken forConfigValue(ConfigValue configValue) {
        ConfigValueType valueType = configValue.valueType();
        switch (valueType) {
            case NUMBER:
                if (configValue.unwrapped() instanceof Double) {
                    return JsonToken.VALUE_NUMBER_FLOAT;
                } else {
                    return JsonToken.VALUE_NUMBER_INT;
                }
            case BOOLEAN:
                if (configValue.unwrapped().equals(Boolean.TRUE)) {
                    return JsonToken.VALUE_TRUE;
                } else {
                    return JsonToken.VALUE_FALSE;
                }
            case NULL:
                return JsonToken.VALUE_NULL;
            case STRING:
                return JsonToken.VALUE_STRING;
            case OBJECT:
                return JsonToken.START_OBJECT;
            case LIST:
                return JsonToken.START_ARRAY;
            default:
                // not possible unless the set of enums changes on us later
                throw new IllegalArgumentException(valueType.name() + " is not a supported ConfigValueType");
        }
    }
View Full Code Here

        }
        Class vc = field.getCollectionClass();
        boolean ar = field.isCollectionArray();
        if (!ar) {
            // check for autocollection wrapping
            ConfigValueType configValueType = config.root().get(field.getName()).valueType();
            if ((configValueType != ConfigValueType.LIST) && field.autoArrayEnabled()) {
                Object singleObject = hydrateField(vc, field.getName(), config);
                col.add(singleObject);
            } else {
                // safe to cast to Object[] since cannot have collections of primitives
View Full Code Here

TOP

Related Classes of com.typesafe.config.ConfigValueType

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.