Resolve or eliminate Environment-related TODOs

Issue: SPR-8031, SPR-7508
This commit is contained in:
Chris Beams
2011-03-15 12:57:12 +00:00
parent d471266d44
commit b50ac7489b
7 changed files with 34 additions and 18 deletions

View File

@@ -19,7 +19,23 @@ package org.springframework.core.env;
import org.springframework.util.Assert;
/**
* TODO SPR-7508: document
* A {@link PropertySource} implementation capable of interrogating its
* underlying source object to enumerate all possible property key/value
* pairs. Exposes the {@link #getPropertyNames()} method to allow callers
* to introspect available properties without having to access the underlying
* source object. This also facilitates a more efficient implementation of
* {@link #containsProperty(String)}, in that it can call {@link #getPropertyNames()}
* and iterate through the returned array rather than attempting a call to
* {@link #getProperty(String)} which may be more expensive. Implementations may
* consider caching the result of {@link #getPropertyNames()} to fully exploit this
* performance opportunity.
*
* Most framework-provided {@code PropertySource} implementations are enumerable;
* a counter-example would be {@code JndiPropertySource} where, due to the
* nature of JNDI it is not possible to determine all possible property names at
* any given time; rather it is only possible to try to access a property
* (via {@link #getProperty(String)}) in order to evaluate whether it is present
* or not.
*
* @author Chris Beams
* @since 3.1

View File

@@ -214,9 +214,11 @@ public abstract class PropertySource<T> {
super(name, new Object());
}
/**
* Always return {@code null}.
*/
@Override
public String getProperty(String key) {
// TODO SPR-7408: logging
return null;
}
}