Subversion Repositories bacoAlunos

Rev

Blame | Compare with Previous | Last modification | View Log | RSS feed

package pt.estgp.estgweb.utils;

import java.util.List;

/**
 * @author Jorge Machado
 * @date 29/Dez/2007
 * @time 1:47:22
 */

public class ConfigProperties extends jomm.utils.ConfigProperties
{

    private static ConfigProperties instance;


    public 1.5.0/docs/api/java/lang/String.html">String getPath()
    {
        return "/pt/estgp/estgweb/app.properties";
    }

    public static ConfigProperties getInstance()
    {
        if(instance == null)
            instance = new ConfigProperties();
        return instance;
    }

    /**
     * Get property and convert it to float
     *
     * @param property to get and convert
     * @return float value
     */

    public static float getFloatProperty(1.5.0/docs/api/java/lang/String.html">String property)
    {
        return getInstance().getFloat(property);
    }

    /**
     * Get property and convert it to short
     *
     * @param property to get and convert
     * @return float value
     */

    public static short getShortProperty(1.5.0/docs/api/java/lang/String.html">String property)
    {
        return getInstance().getShort(property);
    }

    /**
     * Get property and convert it to int
     *
     * @param property to get and convert
     * @return float value
     */

    public static int getIntProperty(1.5.0/docs/api/java/lang/String.html">String property)
    {
        return getInstance().getInt(property);
    }


    /**
     *
     * @param property to load
     * @return property value
     */

    public static 1.5.0/docs/api/java/lang/String.html">String getProperty(1.5.0/docs/api/java/lang/String.html">String property)
    {
        return getInstance().getProp(property);
    }

    /**
     * @param propertyPrefix to load
     * @return a list of all property names hat starts with the given
     * prefix
     */

    public static List<String> getListProperties(1.5.0/docs/api/java/lang/String.html">String propertyPrefix)
    {
        return getInstance().getListProps(propertyPrefix);
    }

    /**
     * @param propertyPrefix to load
     * @return a list of all values hat starts with the given
     * prefix
     */

    public static List<String> getListValues(1.5.0/docs/api/java/lang/String.html">String propertyPrefix)
    {
        return getInstance().getListVals(propertyPrefix);
    }
}