Examples of valueType()


Examples of com.crashnote.core.config.helper.ConfigValue.valueType()

        try {
            peeked = object.peekPath(path);
        } catch (ConfigException.NotResolved e) {
            throw ConfigImpl.improveNotResolved(path, e);
        }
        return peeked != null && peeked.valueType() != ConfigValueType.NULL;
    }

    @Override
    public boolean isEmpty() {
        return object.isEmpty();
View Full Code Here

Examples of com.crashnote.external.config.ConfigValue.valueType()

        try {
            peeked = object.peekPath(path);
        } catch (ConfigException.NotResolved e) {
            throw ConfigImpl.improveNotResolved(path, e);
        }
        return peeked != null && peeked.valueType() != ConfigValueType.NULL;
    }

    @Override
    public boolean isEmpty() {
        return object.isEmpty();
View Full Code Here

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

      Entry<String, ConfigValue> e = entries.next();
      OptionValue v = new OptionValue();
      v.name = e.getKey();
      ConfigValue cv = e.getValue();
      v.type = OptionType.BOOT;
      switch(cv.valueType()){
      case BOOLEAN:
        v.kind = Kind.BOOLEAN;
        v.bool_val = (Boolean) cv.unwrapped();
        break;
      case LIST:
View Full Code Here

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

        try {
            peeked = object.peekPath(path);
        } catch (ConfigException.NotResolved e) {
            throw ConfigImpl.improveNotResolved(path, e);
        }
        return peeked != null && peeked.valueType() != ConfigValueType.NULL;
    }

    @Override
    public boolean isEmpty() {
        return object.isEmpty();
View Full Code Here

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

        String fieldName = field.getName();
        if ((config == null) || !config.hasPath(fieldName)) {
            return null;
        } else if (field.isArray()) { // check CodableFieldInfo instead of expectedType
            ConfigValue configValue = config.root().get(fieldName);
            if ((configValue.valueType() != ConfigValueType.LIST) &&
                field.autoArrayEnabled()) {
                Object singleArrayValue = hydrateField(expectedType, fieldName, config);
                Object wrappingArray    = Array.newInstance(expectedType, 1);
                Array.set(wrappingArray, 0, singleArrayValue);
                return wrappingArray;
View Full Code Here

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

                                @Nullable Class<T> type,
                                ConfigObject configObject) {
        String classField = pluginMap.classField();
        ConfigValue typeValue = configObject.get(classField);
        String stype = null;
        if ((typeValue != null) && (typeValue.valueType() == ConfigValueType.STRING)) {
            stype = (String) typeValue.unwrapped();
        }
        // if otherwise doomed to fail, try supporting "type-value : {...}"  syntax
        if ((stype == null) && (configObject.size() == 1) &&
            ((type == null) || Modifier.isAbstract(type.getModifiers()) ||
View Full Code Here

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

       Map<String, String> keys = new HashMap<>();
       Map<String, ExtractConfiguration> sub = new HashMap<>();
      
       private static List<String> getStringList(Config c, String key) {
         ConfigValue v = c.getValue(key);
         if (v.valueType() == ConfigValueType.LIST) {
           List<String> l = c.getStringList(key);
           if (l.isEmpty()) {
             throw new RuntimeException("Cannot be empty: " + key);
           }
           return l;
View Full Code Here

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

            return config.root().get(fieldName);
        } else if (!config.hasPath(fieldName)) {
            return null;
        } else if (field.isArray()) { // check CodableFieldInfo instead of expectedType
            ConfigValue configValue = config.root().get(fieldName);
            if ((configValue.valueType() != ConfigValueType.LIST) &&
                field.autoArrayEnabled()) {
                Object singleArrayValue = hydrateFieldComponent(expectedType, fieldName, config);
                Object wrappingArray    = Array.newInstance(expectedType, 1);
                Array.set(wrappingArray, 0, singleArrayValue);
                return wrappingArray;
View Full Code Here

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

            try {
                Class<T> singleKeyType = (Class<T>) pluginMap.getClass(singleKeyName);
                CodableClassInfo singleKeyInfo = getOrCreateClassInfo(singleKeyType);
                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
View Full Code Here

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

                            throw new ConfigException.BadValue(configValue.origin(), singleKeyType.getName(),
                                                               "exception during instantiation of a ValueCodable", ex);
                        }
                    } else {
                        throw new ConfigException.WrongType(configValue.origin(), singleKeyName,
                                                            "OBJECT", configValue.valueType().toString());
                    }
                }
                ConfigObject fieldValues = ((ConfigObject) configValue).withFallback(aliasDefaults);
                return createAndPopulate(singleKeyInfo, singleKeyType, fieldValues);
            } catch (ClassNotFoundException ignored) {
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.