public class Library extends Object
System, the scope of Library depends how
ZK libraries are installed.
If they are installed in WEB-INF/lib of a ZK application,
the scope is the application. In other words, the library properties
(setProperty(java.lang.String, java.lang.String)) are shared by the application only.
On the other hand, if ZK libraries are installed in a folder shared by all applications, the library properties are shared by all applications.
| Modifier and Type | Method and Description |
|---|---|
static List<String> |
addProperties(String key,
List<String> values)
Add library properties indicated by the specified key.
|
static List<String> |
addProperty(String key,
String value)
Add a library property indicated by the specified key.
|
static int |
getIntProperty(String key,
int defVal)
Parses the property value to an integer.
|
static List<String> |
getProperties(String key)
Returns the library properties indicated by the specified key.
|
static String |
getProperty(String key)
Returns the library property indicated by the specified key.
|
static String |
getProperty(String key,
String def)
Returns the library property indicated by the specified key.
|
static List<String> |
setProperties(String key,
List<String> values)
Sets the library properties indicated by the specified key.
|
static String |
setProperty(String key,
String value)
Sets the library property indicated by the specified key.
|
public static String getProperty(String key)
System.getProperty(java.lang.String) to look for a system property.
The library property is shared by Java codes that access the same set of ZK libraries, since it is actually a static member of this class. Thus, if ZK libraries (including this class) are installed in WEB-INF/lib of an application, the library properties are accessible only in the application.
Note: unlike System.getProperty(java.lang.String), this method won't
throw SecurityException.
setProperty(java.lang.String, java.lang.String)public static String getProperty(String key, String def)
System.getProperty(java.lang.String) to look for a system property.
Note: unlike System.getProperty(java.lang.String), this method won't
throw SecurityException.
key - the name of the library propertydef - a default value.NullPointerException - if key is nullIllegalArgumentException - if key is emptypublic static String setProperty(String key, String value)
NullPointerException - if key is nullIllegalArgumentException - if key is emptygetProperty(java.lang.String)public static int getIntProperty(String key, int defVal)
defVal - the default valuepublic static List<String> addProperty(String key, String value)
NullPointerException - if key is nullIllegalArgumentException - if key is emptygetProperties(java.lang.String)public static List<String> addProperties(String key, List<String> values)
NullPointerException - if key is nullIllegalArgumentException - if key is emptygetProperties(java.lang.String)public static List<String> setProperties(String key, List<String> values)
NullPointerException - if key is nullIllegalArgumentException - if key is emptygetProperties(java.lang.String)public static List<String> getProperties(String key)
The library properties is shared by Java codes that access the same set of ZK libraries, since it is actually a static member of this class. Thus, if ZK libraries (including this class) are installed in WEB-INF/lib of an application, the library properties are accessible only in the application.
setProperties(java.lang.String, java.util.List<java.lang.String>)Copyright © 2018. All rights reserved.