Package com.typesafe.config

Examples of com.typesafe.config.ConfigObject.toConfig()


            T objectShell = type.newInstance();
            if (objectShell instanceof ConfigCodable) {
                ConfigObject newConfig = ((ConfigCodable) objectShell).fromConfigObject(
                        configObject, info.getFieldDefaults().root());
                if (newConfig != null) {
                    populateObjectFields(info, objectShell, newConfig.toConfig());
                }
            } else {
                populateObjectFields(info, objectShell, configObject.toConfig());
            }
            if (objectShell instanceof SuperCodable) {
View Full Code Here


                || Modifier.isAbstract(type.getModifiers()) || Modifier.isInterface(type.getModifiers())) {
                if (configValue.valueType() == ConfigValueType.LIST) {
                    Class<?> arrayType = pluginMap.arraySugar();
                    if (arrayType != null) {
                        ConfigObject aliasDefaults = pluginMap.aliasDefaults("_array");
                        String arrayFieldName = aliasDefaults.toConfig().getString("_primary");
                        String arraySugarName = pluginMap.getLastAlias("_array");
                        return ConfigFactory.empty().root().withValue(
                                classField, ConfigValueFactory.fromAnyRef(
                                        arraySugarName, pluginMap.category() + " array sugar : " +
                                                        pluginMap.config().root().get("_array").origin().description()))
View Full Code Here

            T objectShell = type.newInstance();
            if (objectShell instanceof ConfigCodable) {
                ConfigObject newConfig = ((ConfigCodable) objectShell).fromConfigObject(
                        configObject, info.getFieldDefaults().root());
                if (newConfig != null) {
                    populateObjectFields(info, objectShell, newConfig.toConfig());
                }
            } else {
                populateObjectFields(info, objectShell, configObject.toConfig());
            }
            if (objectShell instanceof SuperCodable) {
View Full Code Here

                || Modifier.isAbstract(type.getModifiers()) || Modifier.isInterface(type.getModifiers())) {
                if (configValue.valueType() == ConfigValueType.LIST) {
                    Class<?> arrayType = pluginMap.arraySugar();
                    if (arrayType != null) {
                        ConfigObject aliasDefaults = pluginMap.aliasDefaults("_array");
                        String arrayFieldName = aliasDefaults.toConfig().getString("_primary");
                        String arraySugarName = pluginMap.getLastAlias("_array");
                        return ConfigFactory.empty().withValue(
                                classField, ConfigValueFactory.fromAnyRef(
                                        arraySugarName, pluginMap.category() + " array sugar : " +
                                                        pluginMap.config().root().get("_array").origin().description()))
View Full Code Here

                || Modifier.isAbstract(type.getModifiers()) || Modifier.isInterface(type.getModifiers())) {
                if (configValue.valueType() == ConfigValueType.LIST) {
                    Class<?> arrayType = pluginMap.arraySugar();
                    if (arrayType != null) {
                        ConfigObject aliasDefaults = pluginMap.aliasDefaults("_array");
                        String arrayFieldName = aliasDefaults.toConfig().getString("_primary");
                        String arraySugarName = pluginMap.getLastAlias("_array");
                        return ConfigFactory.empty().root().withValue(
                                classField, ConfigValueFactory.fromAnyRef(
                                        arraySugarName, pluginMap.category() + " array sugar : " +
                                                        pluginMap.config().root().get("_array").origin().description()))
View Full Code Here

        String classField = pluginMap.classField();
        if (objectOrArray.valueType() == ConfigValueType.LIST) {
            Class<?> arrayType = pluginMap.arraySugar();
            if (arrayType != null) {
                ConfigObject aliasDefaults = pluginMap.aliasDefaults("_array");
                String arrayFieldName = aliasDefaults.toConfig().getString("_primary");
                String arraySugarName = pluginMap.getLastAlias("_array");
                return ConfigFactory.empty().withValue(
                        classField, ConfigValueFactory.fromAnyRef(
                                arraySugarName, pluginMap.category() + " array sugar : " +
                                                pluginMap.config().root().get("_array").origin().description()))
View Full Code Here

            T objectShell = type.newInstance();
            if (objectShell instanceof ConfigCodable) {
                ConfigObject newConfig = ((ConfigCodable) objectShell).fromConfigObject(
                        configObject, info.getFieldDefaults().root());
                if (newConfig != null) {
                    populateObjectFields(info, objectShell, newConfig.toConfig());
                }
            } else {
                populateObjectFields(info, objectShell, configObject.toConfig());
            }
            if (objectShell instanceof SuperCodable) {
View Full Code Here

                || Modifier.isAbstract(type.getModifiers()) || Modifier.isInterface(type.getModifiers())) {
                if (configValue.valueType() == ConfigValueType.LIST) {
                    Class<?> arrayType = pluginMap.arraySugar();
                    if (arrayType != null) {
                        ConfigObject aliasDefaults = pluginMap.aliasDefaults("_array");
                        String arrayFieldName = aliasDefaults.toConfig().getString("_primary");
                        String arraySugarName = pluginMap.getLastAlias("_array");
                        return ConfigFactory.empty().withValue(
                                classField, ConfigValueFactory.fromAnyRef(
                                        arraySugarName, pluginMap.category() + " array sugar : " +
                                                        pluginMap.config().root().get("_array").origin().description()))
View Full Code Here

            String className;
            if (configValue.valueType() == ConfigValueType.STRING) {
                className = (String) configValue.unwrapped();
            } else if (configValue.valueType() == ConfigValueType.OBJECT) {
                ConfigObject configObject = (ConfigObject) configValue;
                className = configObject.toConfig().getString("_class");
                if (configObject.toConfig().hasPath("_inline") &&
                        configObject.toConfig().getBoolean("_inline")) {
                    mutableInlinedAliasSet.add(label);
                }
            } else {
View Full Code Here

            if (configValue.valueType() == ConfigValueType.STRING) {
                className = (String) configValue.unwrapped();
            } else if (configValue.valueType() == ConfigValueType.OBJECT) {
                ConfigObject configObject = (ConfigObject) configValue;
                className = configObject.toConfig().getString("_class");
                if (configObject.toConfig().hasPath("_inline") &&
                        configObject.toConfig().getBoolean("_inline")) {
                    mutableInlinedAliasSet.add(label);
                }
            } else {
                throw new ConfigException.WrongType(configValue.origin(), label,
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.