com.github.croesch.micro_debug.properties
Class APropertiesProvider

java.lang.Object
  extended by com.github.croesch.micro_debug.properties.APropertiesProvider
Direct Known Subclasses:
PropertiesProvider, XMLPropertiesProvider

public abstract class APropertiesProvider
extends java.lang.Object

Provides properties for different files.

Since:
Date: Feb 23, 2012
Author:
croesch

Constructor Summary
APropertiesProvider(char separator)
          Constructs a new properties provider that can manage different files.
 
Method Summary
protected abstract  java.util.Properties createNewProperties(java.lang.String file)
          Create the properties for the given file.
 java.lang.String get(java.lang.String file, java.lang.String key)
          Returns the value for the given key in the given file.
static java.lang.String replacePlaceholdersInString(java.lang.String str, java.lang.Object... args)
          Replaces all placeholders in the given string, with the given arguments.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

APropertiesProvider

public APropertiesProvider(char separator)
Constructs a new properties provider that can manage different files.

Parameters:
separator - the character to separate different parts in the key.
Since:
Date: Apr 14, 2012
Method Detail

replacePlaceholdersInString

@NotNull
public static java.lang.String replacePlaceholdersInString(java.lang.String str,
                                                                   java.lang.Object... args)
Replaces all placeholders in the given string, with the given arguments.

Parameters:
str - the string to replace the placeholders in
args - the arguments
Returns:
the string filled with arguments
Since:
Date: Feb 22, 2012

get

@Nullable
public final java.lang.String get(java.lang.String file,
                                           java.lang.String key)
Returns the value for the given key in the given file.

Parameters:
file - the path of the file, without file extension!
key - the key to fetch the value for
Returns:
the value read from the xml properties,
or null if the given file path or key is null.
Since:
Date: Feb 22, 2012

createNewProperties

@NotNull
protected abstract java.util.Properties createNewProperties(java.lang.String file)
Create the properties for the given file.

Parameters:
file - the path of the file, without file extension!
Returns:
Properties that contain the content of the given file
Since:
Date: Feb 23, 2012


Copyright © 2012. All Rights Reserved.