org.springframework.core.env
Class PropertySource.ComparisonPropertySource

java.lang.Object
  extended by org.springframework.core.env.PropertySource<java.lang.Object>
      extended by org.springframework.core.env.PropertySource.StubPropertySource
          extended by org.springframework.core.env.PropertySource.ComparisonPropertySource
Enclosing class:
PropertySource<T>

static class PropertySource.ComparisonPropertySource
extends PropertySource.StubPropertySource

See Also:
PropertySource.named(String)

Nested Class Summary
 
Nested classes/interfaces inherited from class org.springframework.core.env.PropertySource
PropertySource.ComparisonPropertySource, PropertySource.StubPropertySource
 
Field Summary
private static java.lang.String USAGE_ERROR
           
 
Fields inherited from class org.springframework.core.env.PropertySource
logger, name, source
 
Constructor Summary
PropertySource.ComparisonPropertySource(java.lang.String name)
           
 
Method Summary
 boolean containsProperty(java.lang.String name)
          Return whether this PropertySource contains the given name.
 java.lang.String getProperty(java.lang.String name)
          Always return null.
 java.lang.Object getSource()
          Return the underlying source object for this PropertySource.
 java.lang.String toString()
          Produce concise output (type and name) if the current log level does not include debug.
 
Methods inherited from class org.springframework.core.env.PropertySource
equals, getName, hashCode, named
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

USAGE_ERROR

private static final java.lang.String USAGE_ERROR
See Also:
Constant Field Values
Constructor Detail

PropertySource.ComparisonPropertySource

public PropertySource.ComparisonPropertySource(java.lang.String name)
Method Detail

getSource

public java.lang.Object getSource()
Description copied from class: PropertySource
Return the underlying source object for this PropertySource.

Overrides:
getSource in class PropertySource<java.lang.Object>

containsProperty

public boolean containsProperty(java.lang.String name)
Description copied from class: PropertySource
Return whether this PropertySource contains the given name.

This implementation simply checks for a null return value from PropertySource.getProperty(String). Subclasses may wish to implement a more efficient algorithm if possible.

Overrides:
containsProperty in class PropertySource<java.lang.Object>
Parameters:
name - the property name to find

getProperty

public java.lang.String getProperty(java.lang.String name)
Description copied from class: PropertySource.StubPropertySource
Always return null.

Overrides:
getProperty in class PropertySource.StubPropertySource
Parameters:
name - the property to find
See Also:
PropertyResolver.getRequiredProperty(String)

toString

public java.lang.String toString()
Description copied from class: PropertySource
Produce concise output (type and name) if the current log level does not include debug. If debug is enabled, produce verbose output including hashcode of the PropertySource instance and every name/value property pair. This variable verbosity is useful as a property source such as system properties or environment variables may contain an arbitrary number of property pairs, potentially leading to difficult to read exception and log messages.

Overrides:
toString in class PropertySource<java.lang.Object>
See Also:
Log#isDebugEnabled()