info.magnolia.init
Class AbstractMagnoliaConfigurationProperties

java.lang.Object
  extended by info.magnolia.init.AbstractMagnoliaConfigurationProperties
All Implemented Interfaces:
MagnoliaConfigurationProperties, PropertySource
Direct Known Subclasses:
DefaultMagnoliaConfigurationProperties

public abstract class AbstractMagnoliaConfigurationProperties
extends Object
implements MagnoliaConfigurationProperties

Abstract implementation, providing the basic behavior expected from a MagnoliaConfigurationProperties implementation. TODO: cache results.

Version:
$Revision: $ ($Author: $)
Author:
gjoseph

Field Summary
protected static org.slf4j.Logger log
           
protected static String PLACEHOLDER_PREFIX
           
protected static String PLACEHOLDER_SUFFIX
           
protected  List<PropertySource> sources
           
 
Constructor Summary
protected AbstractMagnoliaConfigurationProperties(List<PropertySource> propertySources)
           
 
Method Summary
 String describe()
          Provides a description of this source, typically the location of the file that was used to load the properties this source holds.
 boolean getBooleanProperty(String property)
           
 Set<String> getKeys()
           
 String getProperty(String key)
          Returns a value corresponding to the given key, or null if not known.
 PropertySource getPropertySource(String key)
           
 boolean hasProperty(String key)
           
 void init()
           
protected  String parseStringValue(String strVal, Set<String> visitedPlaceholders)
          Parse the given String value recursively, to be able to resolve nested placeholders.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

protected static final org.slf4j.Logger log

sources

protected List<PropertySource> sources

PLACEHOLDER_PREFIX

protected static final String PLACEHOLDER_PREFIX
See Also:
Constant Field Values

PLACEHOLDER_SUFFIX

protected static final String PLACEHOLDER_SUFFIX
See Also:
Constant Field Values
Constructor Detail

AbstractMagnoliaConfigurationProperties

protected AbstractMagnoliaConfigurationProperties(List<PropertySource> propertySources)
Method Detail

init

public void init()
          throws Exception
Specified by:
init in interface MagnoliaConfigurationProperties
Throws:
Exception

getKeys

public Set<String> getKeys()
Specified by:
getKeys in interface PropertySource

getPropertySource

public PropertySource getPropertySource(String key)
Specified by:
getPropertySource in interface MagnoliaConfigurationProperties

getProperty

public String getProperty(String key)
Description copied from interface: PropertySource
Returns a value corresponding to the given key, or null if not known.

Specified by:
getProperty in interface PropertySource

getBooleanProperty

public boolean getBooleanProperty(String property)
Specified by:
getBooleanProperty in interface PropertySource

hasProperty

public boolean hasProperty(String key)
Specified by:
hasProperty in interface PropertySource

describe

public String describe()
Description copied from interface: PropertySource
Provides a description of this source, typically the location of the file that was used to load the properties this source holds. Useful for debugging / logging.

Specified by:
describe in interface PropertySource

toString

public String toString()
Overrides:
toString in class Object

parseStringValue

protected String parseStringValue(String strVal,
                                  Set<String> visitedPlaceholders)
Parse the given String value recursively, to be able to resolve nested placeholders. Partly borrowed from org.springframework.beans.factory.config.PropertyPlaceholderConfigurer (original author: Juergen Hoeller)



Copyright © 2003–2014 Magnolia International Ltd.. All rights reserved.