Package com.swiftmq.tools.prop
Class StructuredProperties
java.lang.Object
com.swiftmq.tools.prop.StructuredProperties
Access class for structured properties. The structure is builded by sections.
A section is recognized if their property name ends with "
Example:
(Section prefix in this case is "
.names
".
The part before the ".names" is called the "section prefix".Example:
ima.comm.partner.names=partner1,partner2,partner3
(Section prefix in this case is "
ima.comm.partner
")
As value of the sectipn property a list of section elements could defined.
The values are separated by comma.
For every section element further properties could be defined. The names of that
properties are a concatenation of the prefix followed by the name of the section
element and the property name.
Example:
ima.comm.partner.partner1.host=www.iit.de
ima.comm.partner.partner1.port=5000
.
- Version:
- 1.0
- Author:
- Andreas Mueller, IIT GmbH
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionStructuredProperties
(Properties baseProperties) Wraps StructuredProperties around Properties. -
Method Summary
Modifier and TypeMethodDescriptionReturns the base propertiesString[]
getSectionElements
(String sectionPrefix) Returns all section elements for the given sectionString[]
Returns an array with all defined sectionsReturns a property value
Example:
Is the property nameima.telegram.fiapas.content
, we get the value with
getValue("ima.telegram","fiapas","content");
boolean
hasSection
(String sectionPrefix) Checks if a section with that prefix is defined
-
Field Details
-
SECTION_QUALIFIER
- See Also:
-
-
Constructor Details
-
StructuredProperties
Wraps StructuredProperties around Properties.- Parameters:
baseProperties
- Basis-Properties
-
-
Method Details
-
getBaseProperties
Returns the base properties- Returns:
- base properties
-
getSections
Returns an array with all defined sections- Returns:
- defined sections
-
hasSection
Checks if a section with that prefix is defined- Parameters:
sectionPrefix
- SectionPrefix
-
getSectionElements
Returns all section elements for the given section- Parameters:
sectionPrefix
- SectionPrefix- Returns:
- section elements
-
getValue
Returns a property value
Example:
Is the property nameima.telegram.fiapas.content
, we get the value with
getValue("ima.telegram","fiapas","content");
- Parameters:
sectionPrefix
- SectionPrefixsectionElement
- Name of the SectionElementpropertyName
- Name of the Property
-