Class StructuredProperties

java.lang.Object
com.swiftmq.tools.prop.StructuredProperties

public class StructuredProperties extends Object
Access class for structured properties. The structure is builded by sections. A section is recognized if their property name ends with ".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 Details

  • Constructor Details

    • StructuredProperties

      public StructuredProperties(Properties baseProperties)
      Wraps StructuredProperties around Properties.
      Parameters:
      baseProperties - Basis-Properties
  • Method Details

    • getBaseProperties

      public Properties getBaseProperties()
      Returns the base properties
      Returns:
      base properties
    • getSections

      public String[] getSections()
      Returns an array with all defined sections
      Returns:
      defined sections
    • hasSection

      public boolean hasSection(String sectionPrefix)
      Checks if a section with that prefix is defined
      Parameters:
      sectionPrefix - SectionPrefix
    • getSectionElements

      public String[] getSectionElements(String sectionPrefix)
      Returns all section elements for the given section
      Parameters:
      sectionPrefix - SectionPrefix
      Returns:
      section elements
    • getValue

      public String getValue(String sectionPrefix, String sectionElement, String propertyName)
      Returns a property value

      Example:
      Is the property name ima.telegram.fiapas.content, we get the value with
      getValue("ima.telegram","fiapas","content");
      Parameters:
      sectionPrefix - SectionPrefix
      sectionElement - Name of the SectionElement
      propertyName - Name of the Property