Commit bbd704caa21e07fa711514de91765dafaea78da6
1 parent
1f211e0a
Exists in
master
Remoção dos métodos comentados pelo pull request.
Showing
1 changed file
with
0 additions
and
49 deletions
Show diff stats
impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/configuration/ConfigurationLoader.java
| ... | ... | @@ -108,7 +108,6 @@ public class ConfigurationLoader { |
| 108 | 108 | org.apache.commons.configuration.Configuration config = getConfiguration(resource, type); |
| 109 | 109 | |
| 110 | 110 | String key = getKey(field, clazz, config); |
| 111 | - //Object value = getValue(key, field.getType(), config); | |
| 112 | 111 | Object value = getValue(key, field, config); |
| 113 | 112 | |
| 114 | 113 | validate(field, key, value, resource); |
| ... | ... | @@ -235,31 +234,6 @@ public class ConfigurationLoader { |
| 235 | 234 | return config; |
| 236 | 235 | } |
| 237 | 236 | |
| 238 | - /** | |
| 239 | - * Returns the value associated with the given configuration class and field type. | |
| 240 | - * | |
| 241 | - * @param name | |
| 242 | - * @param config | |
| 243 | - * @param fieldClass | |
| 244 | - * @return the value | |
| 245 | - */ | |
| 246 | - /*@SuppressWarnings("unchecked") | |
| 247 | - private <T> T getValue(String key, Class<T> fieldClass, org.apache.commons.configuration.Configuration config) { | |
| 248 | - Object value; | |
| 249 | - | |
| 250 | - if (fieldClass.isArray() && fieldClass.getComponentType().equals(String.class)) { | |
| 251 | - value = config.getStringArray(key); | |
| 252 | - | |
| 253 | - } else if (fieldClass.equals(Properties.class)) { | |
| 254 | - value = getProperty(key, config); | |
| 255 | - | |
| 256 | - } else { | |
| 257 | - value = getBasic(key, fieldClass, config); | |
| 258 | - } | |
| 259 | - | |
| 260 | - return (T) value; | |
| 261 | - }*/ | |
| 262 | - | |
| 263 | 237 | @SuppressWarnings("unchecked") |
| 264 | 238 | private <T> T getValue(String key, Field field, org.apache.commons.configuration.Configuration config) { |
| 265 | 239 | Object value; |
| ... | ... | @@ -278,29 +252,6 @@ public class ConfigurationLoader { |
| 278 | 252 | return (T) value; |
| 279 | 253 | } |
| 280 | 254 | |
| 281 | - /*private <T> Object getBasic(String key, Class<T> fieldClass, org.apache.commons.configuration.Configuration config) { | |
| 282 | - Object value = null; | |
| 283 | - | |
| 284 | - try { | |
| 285 | - Method method; | |
| 286 | - String methodName = "get" + Strings.firstToUpper(fieldClass.getSimpleName()); | |
| 287 | - | |
| 288 | - if (!fieldClass.isPrimitive()) { | |
| 289 | - method = config.getClass().getMethod(methodName, String.class, fieldClass); | |
| 290 | - value = method.invoke(config, key, null); | |
| 291 | - | |
| 292 | - } else if (config.containsKey(key)) { | |
| 293 | - method = config.getClass().getMethod(methodName, String.class); | |
| 294 | - value = method.invoke(config, key); | |
| 295 | - } | |
| 296 | - | |
| 297 | - } catch (Throwable cause) { | |
| 298 | - throw new ConfigurationException(bundle.getString("error-converting-to-type", fieldClass.getName()), cause); | |
| 299 | - } | |
| 300 | - | |
| 301 | - return value; | |
| 302 | - }*/ | |
| 303 | - | |
| 304 | 255 | private <T> Object getArray(String key, Field field, org.apache.commons.configuration.Configuration config) { |
| 305 | 256 | Object value = null; |
| 306 | 257 | ... | ... |