Package com.typesafe.config

Examples of com.typesafe.config.ConfigValue.atPath()


                ConfigObject aliasDefaults = pluginMap.aliasDefaults(singleKeyName);
                ConfigValue configValue = configObject.get(singleKeyName);
                if (configValue.valueType() != ConfigValueType.OBJECT) {
                    if (aliasDefaults.get("_primary") != null) {
                        // if value is not an object, try supporting _primary syntax to derive one
                        configValue = configValue.atPath((String) aliasDefaults.get("_primary").unwrapped()).root();
                    } else if (ValueCodable.class.isAssignableFrom(singleKeyType)) {
                        // see if the resolved type is innately okay with non-objects
                        try {
                            T objectShell = singleKeyType.newInstance();
                            Config fieldDefaults = singleKeyInfo.getFieldDefaults();
View Full Code Here


                    pluginMap.getClass(onlyKey); // make sure key is a valid type
                    ConfigValue onlyKeyValue = root.values().iterator().next();
                    ConfigObject aliasDefaults = pluginMap.aliasDefaults(onlyKey);
                    if (onlyKeyValue.valueType() != ConfigValueType.OBJECT) {
                        if (aliasDefaults.get("_primary") != null) {
                            onlyKeyValue = onlyKeyValue.atPath((String) aliasDefaults.get("_primary").unwrapped()).root();
                        } else {
                            throw new ConfigException.WrongType(onlyKeyValue.origin(), onlyKey,
                                                                "OBJECT", onlyKeyValue.valueType().toString());
                        }
                    }
View Full Code Here

                    ConfigObject aliasDefaults = pluginMap.aliasDefaults(singleKeyName);
                    ConfigValue configValue = configObject.get(singleKeyName);
                    if (configValue.valueType() != ConfigValueType.OBJECT) {
                        if (aliasDefaults.get("_primary") != null) {
                            // if value is not an object, try supporting _primary syntax to derive one
                            configValue = configValue.atPath((String) aliasDefaults.get("_primary").unwrapped()).root();
                        } else if (ValueCodable.class.isAssignableFrom(singleKeyType)) {
                            // see if the resolved type is innately okay with non-objects
                            try {
                                T objectShell = singleKeyType.newInstance();
                                Config fieldDefaults = singleKeyInfo.getFieldDefaults();
View Full Code Here

                    pluginMap.getClass(onlyKey); // make sure key is a valid type
                    ConfigValue onlyKeyValue = root.values().iterator().next();
                    ConfigObject aliasDefaults = pluginMap.aliasDefaults(onlyKey);
                    if (onlyKeyValue.valueType() != ConfigValueType.OBJECT) {
                        if (aliasDefaults.get("_primary") != null) {
                            onlyKeyValue = onlyKeyValue.atPath((String) aliasDefaults.get("_primary").unwrapped()).root();
                        } else {
                            throw new ConfigException.WrongType(onlyKeyValue.origin(), onlyKey,
                                                                "OBJECT", onlyKeyValue.valueType().toString());
                        }
                    }
View Full Code Here

                    pluginMap.getClass(onlyKey); // make sure key is a valid type
                    ConfigValue onlyKeyValue = root.values().iterator().next();
                    ConfigObject aliasDefaults = pluginMap.aliasDefaults(onlyKey);
                    if (onlyKeyValue.valueType() != ConfigValueType.OBJECT) {
                        if (aliasDefaults.get("_primary") != null) {
                            onlyKeyValue = onlyKeyValue.atPath((String) aliasDefaults.get("_primary").unwrapped()).root();
                        } else {
                            throw new ConfigException.WrongType(onlyKeyValue.origin(), onlyKey,
                                                                "OBJECT", onlyKeyValue.valueType().toString());
                        }
                    }
View Full Code Here

                    ConfigObject aliasDefaults = pluginMap.aliasDefaults(sugarType);
                    ConfigValue configValue = configObject.get(sugarType);
                    // if value is not an object, try supporting _primary syntax to derive one
                    if (configValue.valueType() != ConfigValueType.OBJECT) {
                        if (aliasDefaults.get("_primary") != null) {
                            configValue = configValue.atPath((String) aliasDefaults.get("_primary").unwrapped()).root();
                        } else {
                            throw new ConfigException.WrongType(configValue.origin(), sugarType,
                                                                "OBJECT", configValue.valueType().toString());
                        }
                    }
View Full Code Here

                    pluginMap.getClass(onlyKey); // make sure key is a valid type
                    ConfigValue configValue = root.values().iterator().next();
                    ConfigObject aliasDefaults = pluginMap.aliasDefaults(onlyKey);
                    if (configValue.valueType() != ConfigValueType.OBJECT) {
                        if (aliasDefaults.get("_primary") != null) {
                            configValue = configValue.atPath((String) aliasDefaults.get("_primary").unwrapped()).root();
                        } else {
                            throw new ConfigException.WrongType(configValue.origin(), onlyKey,
                                                                "OBJECT", configValue.valueType().toString());
                        }
                    }
View Full Code Here

                    ConfigObject aliasDefaults = pluginMap.aliasDefaults(singleKeyName);
                    ConfigValue configValue = configObject.get(singleKeyName);
                    if (configValue.valueType() != ConfigValueType.OBJECT) {
                        if (aliasDefaults.get("_primary") != null) {
                            // if value is not an object, try supporting _primary syntax to derive one
                            configValue = configValue.atPath((String) aliasDefaults.get("_primary").unwrapped()).root();
                        } else if (ValueCodable.class.isAssignableFrom(singleKeyType)) {
                            // see if the resolved type is innately okay with non-objects
                            try {
                                T objectShell = singleKeyType.newInstance();
                                Config fieldDefaults = singleKeyInfo.getFieldDefaults();
View Full Code Here

                    pluginMap.getClass(onlyKey); // make sure key is a valid type
                    ConfigValue onlyKeyValue = root.values().iterator().next();
                    ConfigObject aliasDefaults = pluginMap.aliasDefaults(onlyKey);
                    if (onlyKeyValue.valueType() != ConfigValueType.OBJECT) {
                        if (aliasDefaults.get("_primary") != null) {
                            onlyKeyValue = onlyKeyValue.atPath((String) aliasDefaults.get("_primary").unwrapped()).root();
                        } else {
                            throw new ConfigException.WrongType(onlyKeyValue.origin(), onlyKey,
                                                                "OBJECT", onlyKeyValue.valueType().toString());
                        }
                    }
View Full Code Here

                    pluginMap.getClass(onlyKey); // make sure key is a valid type
                    ConfigValue onlyKeyValue = root.values().iterator().next();
                    ConfigObject aliasDefaults = pluginMap.aliasDefaults(onlyKey);
                    if (onlyKeyValue.valueType() != ConfigValueType.OBJECT) {
                        if (aliasDefaults.get("_primary") != null) {
                            onlyKeyValue = onlyKeyValue.atPath((String) aliasDefaults.get("_primary").unwrapped()).root();
                        } else {
                            throw new ConfigException.WrongType(onlyKeyValue.origin(), onlyKey,
                                                                "OBJECT", onlyKeyValue.valueType().toString());
                        }
                    }
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.