Package org.confng.integration.spring
Class ConfNGPropertySource
- java.lang.Object
-
- org.confng.integration.spring.ConfNGPropertySource
-
public class ConfNGPropertySource extends Object
Spring PropertySource adapter for ConfNG.This class allows ConfNG to be used as a PropertySource in Spring applications, enabling seamless integration with Spring's Environment abstraction.
Example Usage:
{@code- Since:
- 1.1.0
- Author:
- Bharat Kumar Malviya, GitHub: github.com/imBharatMalviya
-
-
Constructor Summary
Constructors Constructor Description ConfNGPropertySource(String name)Creates a ConfNG property source that exposes all registered sources.ConfNGPropertySource(String name, Class<E> keyClass)Creates a ConfNG property source with the given name and key class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsProperty(String name)Checks if this property source contains the given property.StringgetName()Gets the name of this property source.ObjectgetProperty(String name)Gets a property value by name.String[]getPropertyNames()Gets all property names.ObjecttoSpringPropertySource()Creates a Spring Environment-compatible PropertySource.
-
-
-
Constructor Detail
-
ConfNGPropertySource
public ConfNGPropertySource(String name, Class<E> keyClass)
Creates a ConfNG property source with the given name and key class.
-
ConfNGPropertySource
public ConfNGPropertySource(String name)
Creates a ConfNG property source that exposes all registered sources.
-
-
Method Detail
-
getName
public String getName()
Gets the name of this property source.
-
containsProperty
public boolean containsProperty(String name)
Checks if this property source contains the given property.
-
getPropertyNames
public String[] getPropertyNames()
Gets all property names.
-
toSpringPropertySource
public Object toSpringPropertySource()
Creates a Spring Environment-compatible PropertySource.Note: This method returns an Object to avoid compile-time dependency on Spring. Cast to org.springframework.core.env.PropertySource in Spring applications.
-
-