类 EnumerablePropertySource<T>
java.lang.Object
cn.taketoday.core.env.PropertySource<T>
cn.taketoday.core.env.EnumerablePropertySource<T>
- 类型参数:
T- the source type
A
PropertySource implementation capable of interrogating its
underlying source object to enumerate all possible property name/value
pairs. Exposes the 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
containsProperty(String), in that it can call getPropertyNames()
and iterate through the returned array rather than attempting a call to
PropertySource.getProperty(String) which may be more expensive. Implementations may
consider caching the result of getPropertyNames() to fully exploit this
performance opportunity.
Most framework-provided PropertySource implementations are enumerable;
a counter-example would be 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 PropertySource.getProperty(String)) in order to evaluate whether it is present
or not.
- 从以下版本开始:
- 4.0
- 作者:
- Chris Beams, Juergen Hoeller
-
嵌套类概要
从类继承的嵌套类/接口 cn.taketoday.core.env.PropertySource
PropertySource.StubPropertySource -
字段概要
从类继承的字段 cn.taketoday.core.env.PropertySource
name, source -
构造器概要
构造器限定符构造器说明protectedCreate a newEnumerablePropertySourcewith the given name and with a newObjectinstance as the underlying source.EnumerablePropertySource(String name, T source) Create a newEnumerablePropertySourcewith the given name and source object. -
方法概要
修饰符和类型方法说明booleancontainsProperty(String name) Return whether thisPropertySourcecontains a property with the given name.abstract String[]Return the names of all properties contained by the source object (nevernull).从类继承的方法 cn.taketoday.core.env.PropertySource
equals, getName, getProperty, getSource, hashCode, named, toString
-
构造器详细资料
-
EnumerablePropertySource
Create a newEnumerablePropertySourcewith the given name and source object.- 参数:
name- the associated namesource- the source object
-
EnumerablePropertySource
Create a newEnumerablePropertySourcewith the given name and with a newObjectinstance as the underlying source.- 参数:
name- the associated name
-
-
方法详细资料
-
containsProperty
Return whether thisPropertySourcecontains a property with the given name.This implementation checks for the presence of the given name within the
getPropertyNames()array.- 覆盖:
containsProperty在类中PropertySource<T>- 参数:
name- the name of the property to find
-
getPropertyNames
Return the names of all properties contained by the source object (nevernull).
-