Show
Ignore:
Timestamp:
2008-06-23 00:00:48 (7 months ago)
Author:
mosipov
Message:

NEW - #1968: Javadoc issues

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • FCKeditor.Java/trunk/java-core/src/main/java/net/fckeditor/handlers/PropertiesLoader.java

    r1685 r2101  
    2626import java.util.Properties; 
    2727 
    28 import net.fckeditor.tool.Utils; 
    29  
    3028import org.slf4j.Logger; 
    3129import org.slf4j.LoggerFactory; 
    3230 
    3331/** 
    34  * Handler to hold the basic properties.<br> 
    35  * The main default file is 'default.properties' in the deepth of the classpath and should be 
    36  * untouched. If there is a file named 'fckeditor.properties' in the root of the classpath, it will 
    37  * be loaded. Values which are loaded before, will be overwritten.<br> 
    38  * If you won't use an extra properties file to adjust the defaults, you can use 
    39  * {@link #setProperty(String, String)} instead. 
     32 * This handler gives you access to properties stored in 
     33 * <code>/net/fckeditor/handlers/default.properties</code> and 
     34 * <code>/fckeditor.properties</code>.<br /> 
     35 * This class loads the properties files as follows: 
     36 * <ol> 
     37 * <li>Load <code>default.properties</code></li> 
     38 * <li>Load <code>fckeditor.properties</code> if present.</li> 
     39 * </ol> 
     40 * <em>Attention</em>: Properties specified in 
     41 * <code>fckeditor.properties</code> will override properties loaded from 
     42 * <code>default.properties</code>. (intended behavior)<br /> 
     43 * <em>Hint</em>: You may set properties programmatically with 
     44 * {@link #setProperty(String, String)} instead or additionally. 
    4045 *  
    4146 * @version $Id$ 
     
    4752        static { 
    4853                try { 
    49                         // 1. load system defaults 
     54                        // 1. load library defaults 
    5055                        properties.load(new BufferedInputStream(PropertiesLoader.class 
    5156                                .getResourceAsStream("default.properties"))); 
     
    5459                        InputStream in = PropertiesLoader.class.getResourceAsStream("/fckeditor.properties"); 
    5560                        if (in == null) 
    56                                 logger.warn("Can't find user properties!"); 
     61                                logger.warn("Can't find fckeditor.properties!"); 
    5762                        else { 
    5863                                try { 
    5964                                        properties.load(new BufferedInputStream(in)); 
    60                                         logger.info("User's properties loaded successfully!"); 
     65                                        logger.info("fckeditor.properties loaded successfully!"); 
    6166                                } catch (IOException e) { 
    62                                         logger.error("Error while loading user properties!", e); 
    63                                         throw new RuntimeException("Can't load user properties!", e); 
     67                                        logger.error("Error while loading fckeditor.properties!", e); 
     68                                        throw new RuntimeException("Can't load fckeditor.properties!", e); 
    6469                                } 
    6570                        } 
    6671                } catch (IOException e) { 
    67                         logger.error("Error while loading default properties!", e); 
    68                         throw new RuntimeException("Can't load default properties!", e); 
     72                        logger.error("Error while loading default.properties!", e); 
     73                        throw new RuntimeException("Can't load default.properties!", e); 
    6974                } 
    7075        } 
    7176 
    7277        /** 
    73          * Getter for a property of 'key'. 
     78         * Getter for a property. 
    7479         *  
    7580         * @param key 
    76          *            the propery key 
    77          * @return the value in this property list with the specified key value. 
     81         *            The property key. 
     82         * @return The value for the specified key. 
    7883         * @see Properties#getProperty(String) 
    7984         */ 
     
    8388 
    8489        /** 
    85          * Setter for a property. If the property already exists, the value will be overwritten.<br> 
    86          * Hint: This method is intended for an alternative way to set user defaults programmatically 
    87          * instead of using the 'fckeditor.properties'. It should never used inside FCKeditor.Java !!! 
     90         * Setter for a property. If the property already exists, the value will be 
     91         * overridden.<br /> 
     92         * <em>Hint</em>: This method is intended as an alternative way to set 
     93         * properties programmatically instead of using the 
     94         * <code>fckeditor.properties</code>. It should never used inside 
     95         * FCKeditor.Java!!! 
    8896         *  
    8997         * @param key 
    90          *            key the propery key 
     98         *            The property key. 
    9199         * @param value 
    92          * @throws IllegalArgumentException 
    93          *             if 'key' is empty. 
     100         *            The property value. 
    94101         * @see Properties#setProperty(String, String) 
    95102         */ 
    96103        public static void setProperty(final String key, final String value) { 
    97                 if (Utils.isEmpty(key)) 
    98                         new IllegalArgumentException("The 'key' of a property schouldn't be null!"); 
    99104                properties.setProperty(key, value); 
    100105        }