类 P

java.lang.Object
org.tio.utils.jfinal.P

public class P extends Object
P. P can load properties file from CLASSPATH or File object.
  • 方法详细资料

    • use

      public static Prop use(String fileName)
      Using the properties file. It will loading the properties file if not loading.
      另请参阅:
    • use

      public static Prop use(String fileName, String encoding)
      Using the properties file. It will loading the properties file if not loading.

      Example:
      P.use("config.txt", "UTF-8");
      P.use("other_config.txt", "UTF-8");

      String userName = P.get("userName");
      String password = P.get("password");

      userName = P.use("other_config.txt").get("userName");
      password = P.use("other_config.txt").get("password");

      P.use("com/jfinal/config_in_sub_directory_of_classpath.txt");

      参数:
      fileName - the properties file's name in classpath or the sub directory of classpath
      encoding - the encoding
    • use

      public static Prop use(File file)
      Using the properties file bye File object. It will loading the properties file if not loading.
      另请参阅:
    • use

      public static Prop use(File file, String encoding)
      Using the properties file bye File object. It will loading the properties file if not loading.

      Example:
      P.use(new File("/var/config/my_config.txt"), "UTF-8");
      Strig userName = P.use("my_config.txt").get("userName");

      参数:
      file - the properties File object
      encoding - the encoding
    • useless

      public static Prop useless(String fileName)
    • clear

      public static void clear()
    • append

      public static Prop append(Prop prop)
    • append

      public static Prop append(String fileName, String encoding)
    • append

      public static Prop append(String fileName)
    • appendIfExists

      public static Prop appendIfExists(String fileName, String encoding)
    • appendIfExists

      public static Prop appendIfExists(String fileName)
    • append

      public static Prop append(File file, String encoding)
    • append

      public static Prop append(File file)
    • appendIfExists

      public static Prop appendIfExists(File file, String encoding)
    • appendIfExists

      public static Prop appendIfExists(File file)
    • getProp

      public static Prop getProp()
    • getProp

      public static Prop getProp(String fileName)
    • get

      public static String get(String key)
    • get

      public static String get(String key, String defaultValue)
    • getInt

      public static Integer getInt(String key)
    • getInt

      public static Integer getInt(String key, Integer defaultValue)
    • getLong

      public static Long getLong(String key)
    • getLong

      public static Long getLong(String key, Long defaultValue)
    • getBoolean

      public static Boolean getBoolean(String key)
    • getBoolean

      public static Boolean getBoolean(String key, Boolean defaultValue)
    • containsKey

      public static boolean containsKey(String key)