public DynaProperty getDynaProperty()

in src/main/java/org/apache/commons/configuration2/beanutils/ConfigurationDynaClass.java [81:116]


    public DynaProperty getDynaProperty(final String name) {
        if (LOG.isTraceEnabled()) {
            LOG.trace("getDynaProperty(" + name + ")");
        }

        if (name == null) {
            throw new IllegalArgumentException("Property name must not be null!");
        }

        final Object value = configuration.getProperty(name);
        if (value == null) {
            return null;
        }
        Class<?> type = value.getClass();

        if (type == Byte.class) {
            type = Byte.TYPE;
        }
        if (type == Character.class) {
            type = Character.TYPE;
        } else if (type == Boolean.class) {
            type = Boolean.TYPE;
        } else if (type == Double.class) {
            type = Double.TYPE;
        } else if (type == Float.class) {
            type = Float.TYPE;
        } else if (type == Integer.class) {
            type = Integer.TYPE;
        } else if (type == Long.class) {
            type = Long.TYPE;
        } else if (type == Short.class) {
            type = Short.TYPE;
        }

        return new DynaProperty(name, type);
    }