Package org.springframework.boot.origin
Class PropertySourceOrigin
java.lang.Object
org.springframework.boot.origin.PropertySourceOrigin
- All Implemented Interfaces:
Origin
,OriginProvider
Origin
from a PropertySource
.- Since:
- 2.0.0
- Author:
- Phillip Webb
-
Constructor Summary
ConstructorDescriptionPropertySourceOrigin
(PropertySource<?> propertySource, String propertyName) Create a newPropertySourceOrigin
instance.PropertySourceOrigin
(PropertySource<?> propertySource, String propertyName, Origin origin) Create a newPropertySourceOrigin
instance. -
Method Summary
Modifier and TypeMethodDescriptionstatic Origin
get
(PropertySource<?> propertySource, String name) Return the actual origin for the source if known.Return the parent origin for this instance if there is one.Return the property name that was used when obtaining the original value from theproperty source
.Return the originPropertySource
.toString()
-
Constructor Details
-
PropertySourceOrigin
Create a newPropertySourceOrigin
instance.- Parameters:
propertySource
- the property sourcepropertyName
- the name from the property source
-
PropertySourceOrigin
Create a newPropertySourceOrigin
instance.- Parameters:
propertySource
- the property sourcepropertyName
- the name from the property sourceorigin
- the actual origin for the source if known- Since:
- 3.2.8
-
-
Method Details
-
getPropertySource
Return the originPropertySource
.- Returns:
- the origin property source
-
getPropertyName
Return the property name that was used when obtaining the original value from theproperty source
.- Returns:
- the origin property name
-
getOrigin
Return the actual origin for the source if known.- Specified by:
getOrigin
in interfaceOriginProvider
- Returns:
- the actual source origin
- Since:
- 3.2.8
-
getParent
Description copied from interface:Origin
Return the parent origin for this instance if there is one. The parent origin provides the origin of the item that created this one. -
toString
-
get
Get anOrigin
for the givenPropertySource
andpropertyName
. Will either return anOriginLookup
result or aPropertySourceOrigin
.- Parameters:
propertySource
- the origin property sourcename
- the property name- Returns:
- the property origin
-