Resolve or eliminate Environment-related TODOs
Issue: SPR-8031, SPR-7508
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user