Package io.microsphere.metadata
Class DefaultConfigurationPropertyReader
- java.lang.Object
-
- io.microsphere.metadata.DefaultConfigurationPropertyReader
-
- All Implemented Interfaces:
Prioritized,ConfigurationPropertyReader,java.lang.Comparable<Prioritized>
public class DefaultConfigurationPropertyReader extends java.lang.Object implements ConfigurationPropertyReader
ConfigurationPropertyReaderbased on JSON content.- Since:
- 1.0.0
- Author:
- Mercy
- See Also:
ConfigurationPropertyReader
-
-
Field Summary
-
Fields inherited from interface io.microsphere.lang.Prioritized
COMPARATOR, MAX_PRIORITY, MIN_PRIORITY, NORMAL_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description DefaultConfigurationPropertyReader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetPriority()Get the priorityjava.util.List<ConfigurationProperty>read(java.lang.String content)Reads a list ofConfigurationPropertyobjects from the provided content string.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.microsphere.metadata.ConfigurationPropertyReader
read, read
-
Methods inherited from interface io.microsphere.lang.Prioritized
compareTo
-
-
-
-
Method Detail
-
read
public java.util.List<ConfigurationProperty> read(java.lang.String content) throws java.lang.Throwable
Description copied from interface:ConfigurationPropertyReaderReads a list ofConfigurationPropertyobjects from the provided content string.This method parses and loads configuration properties from the given string content. The format of the content is determined by the specific implementation of this interface.
Example Usage
ConfigurationPropertiesReader reader = ...; // Obtain an instance String content = "property1=value1\nproperty2=value2"; List<ConfigurationProperty> properties = reader.load(content); // Process the loaded properties- Specified by:
readin interfaceConfigurationPropertyReader- Parameters:
content- the string content to parse and load from; must not benull- Returns:
- a list of
ConfigurationPropertyobjects loaded from the content - Throws:
java.lang.Throwable- if any error occurs during loading- See Also:
ConfigurationProperty
-
getPriority
public int getPriority()
Description copied from interface:PrioritizedGet the priority- Specified by:
getPriorityin interfacePrioritized- Returns:
- the default is
minimum one
-
-