net.sf.jour.util
Class PropertiesBase

java.lang.Object
  extended bynet.sf.jour.util.PropertiesBase
All Implemented Interfaces:
FileChageListener
Direct Known Subclasses:
RtProperties

public class PropertiesBase
extends java.lang.Object
implements FileChageListener

This is usefull Extencion to java.util.Properties Has int and boolean properties Created on 02.12.2004 Contributing Author(s): Misha Lifschitz (Inital implementation) Vlad Skarzhevskyy (Inital implementation)

Version:
$Revision: 1.8 $ ($Author: vlads $) $Date: 2004/12/14 18:30:17 $
Author:
vlads

Field Summary
(package private)  java.util.List listenerList
           
protected static org.apache.log4j.Logger log
           
 
Constructor Summary
PropertiesBase()
          Creates an empty property list with no default values.
PropertiesBase(java.util.Properties defaults)
          Creates an empty property list with the specified defaults.
 
Method Summary
 void addListener(PropertiesReloadListener listener)
           
 void doOnFileChange(java.lang.String fileName)
           
protected  void doOnPropertiesReload()
           
 boolean getBoolProperty(java.lang.String key)
           
 boolean getBoolProperty(java.lang.String key, boolean defaultValue)
           
 java.io.File getFile(java.lang.String key, boolean mustExists)
           
 java.io.File getFolder(java.lang.String key, boolean create)
           
 int getIntProperty(java.lang.String key)
           
 int getIntProperty(java.lang.String key, int defaultValue)
           
 long getLongProperty(java.lang.String key)
           
 long getLongProperty(java.lang.String key, long defaultValue)
           
 java.lang.String getProperty(java.lang.String key)
           
 boolean getProperty(java.lang.String key, boolean defaultValue)
           
 int getProperty(java.lang.String key, int defaultValue)
           
 long getProperty(java.lang.String key, long defaultValue)
           
 java.lang.String getProperty(java.lang.String key, java.lang.String defaultValue)
           
 int isArgsName(java.lang.String name)
           
 boolean load(java.io.File file)
           
 boolean load(java.lang.String name, java.lang.String defaultName)
           
 boolean load(java.net.URL url)
           
 void loadArgs(java.lang.String[] args)
           
 void setAutoreload(boolean enableAutoreload, long dellay)
           
 void setProperty(java.lang.String name, java.lang.String value)
           
static boolean str2bool(java.lang.String str, boolean defaultValue)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final org.apache.log4j.Logger log

listenerList

java.util.List listenerList
Constructor Detail

PropertiesBase

public PropertiesBase()
Creates an empty property list with no default values.


PropertiesBase

public PropertiesBase(java.util.Properties defaults)
Creates an empty property list with the specified defaults.

Parameters:
defaults - the defaults.
Method Detail

setProperty

public void setProperty(java.lang.String name,
                        java.lang.String value)

getProperty

public java.lang.String getProperty(java.lang.String key)

getProperty

public java.lang.String getProperty(java.lang.String key,
                                    java.lang.String defaultValue)

getIntProperty

public int getIntProperty(java.lang.String key)

getIntProperty

public int getIntProperty(java.lang.String key,
                          int defaultValue)

getProperty

public int getProperty(java.lang.String key,
                       int defaultValue)

getLongProperty

public long getLongProperty(java.lang.String key)

getLongProperty

public long getLongProperty(java.lang.String key,
                            long defaultValue)

getProperty

public long getProperty(java.lang.String key,
                        long defaultValue)

getBoolProperty

public boolean getBoolProperty(java.lang.String key)

getBoolProperty

public boolean getBoolProperty(java.lang.String key,
                               boolean defaultValue)

getProperty

public boolean getProperty(java.lang.String key,
                           boolean defaultValue)

getFolder

public java.io.File getFolder(java.lang.String key,
                              boolean create)

getFile

public java.io.File getFile(java.lang.String key,
                            boolean mustExists)

str2bool

public static boolean str2bool(java.lang.String str,
                               boolean defaultValue)

load

public boolean load(java.io.File file)

load

public boolean load(java.net.URL url)

load

public boolean load(java.lang.String name,
                    java.lang.String defaultName)

isArgsName

public int isArgsName(java.lang.String name)

loadArgs

public void loadArgs(java.lang.String[] args)

addListener

public void addListener(PropertiesReloadListener listener)

doOnPropertiesReload

protected void doOnPropertiesReload()

doOnFileChange

public void doOnFileChange(java.lang.String fileName)
Specified by:
doOnFileChange in interface FileChageListener

setAutoreload

public void setAutoreload(boolean enableAutoreload,
                          long dellay)


Copyright © 2004 sourceforge. All Rights Reserved.