Class CollectionFactory
java.lang.Object
de.uplanet.lucy.server.auxiliaries.collections.CollectionFactory
Used to create collections.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionCreate aLinkedList
.List
<?> createList
(String p_strClassName) Create aList
of the given type.Create aHashMap
.Map
<?, ?> Create aMap
of the given type.Create aHashSet
.Set
<?> Create aSet
of the given type.getPrincipalNames
(Subject p_subject) Create a collection of principal names for the given subject.Collection
<?> getProperties
(Collection<?> p_collection, String p_strMethodName) Deprecated.Use the getPropertiesAsXxx methods instead.List
<?> getPropertiesAsList
(Collection<?> p_collection, String p_strMethodName) Create a list of object properties from a collection of objects.Set
<?> getPropertiesAsSet
(Collection<?> p_collection, String p_strMethodName) Create a set of object properties from a collection of objects.SortedSet
<?> getPropertiesAsSortedSet
(Collection<?> p_collection, String p_strMethodName) Create a sorted set of object properties from a collection of objects.loadProperties
(String p_strPath) Load the given properties file.loadPropertiesSafely
(String p_strPath) Same asloadProperties(String)
but instead of throwing an exception an empty properties collection is returned if an error occurs.
-
Constructor Details
-
CollectionFactory
public CollectionFactory()
-
-
Method Details
-
createMap
Create aHashMap
. -
createMap
Create aMap
of the given type.Note that the class must provide a public default constructor.
- Parameters:
p_strClassName
- The name of the map class.- Returns:
- The newly created map, or
null
if the map could not be created. In the latter case see the log file for details.
-
createSet
Create aHashSet
. -
createSet
Create aSet
of the given type.Note that the class must provide a public default constructor.
- Parameters:
p_strClassName
- The name of the set class.- Returns:
- The newly created set, or
null
if the set could not be created. In the latter case see the log file for details.
-
createList
Create aLinkedList
. -
createList
Create aList
of the given type.Note that the class must provide a public default constructor.
- Parameters:
p_strClassName
- The name of the list class.- Returns:
- The newly created list, or
null
if the list could not be created. In the latter case see the log file for details.
-
loadProperties
Load the given properties file.The file may contain UTF-8 encoded characters.
- Parameters:
p_strPath
- The path of the properties file.- Returns:
- The loaded properties.
- Throws:
IOException
- If an I/O error occurs.
-
loadPropertiesSafely
Same asloadProperties(String)
but instead of throwing an exception an empty properties collection is returned if an error occurs.- Parameters:
p_strPath
- The path of the properties file.- Returns:
- The loaded properties.
-
getProperties
@Deprecated public Collection<?> getProperties(Collection<?> p_collection, String p_strMethodName) throws Exception Deprecated.Use the getPropertiesAsXxx methods instead.Create a collection of object properties from a collection of objects.- Parameters:
p_collection
- The object collection.p_strMethodName
- The method that returns the properties that will be in the resultant collection.- Returns:
- The collection of properties.
- Throws:
Exception
- - If an error occurred.
-
getPropertiesAsList
public List<?> getPropertiesAsList(Collection<?> p_collection, String p_strMethodName) throws Exception Create a list of object properties from a collection of objects.- Parameters:
p_collection
- The object collection.p_strMethodName
- The method that returns the properties that will be in the resultant collection.- Returns:
- The list of properties.
- Throws:
Exception
- - If an error occurred.- Since:
- Intrexx 7.0.
-
getPropertiesAsSet
public Set<?> getPropertiesAsSet(Collection<?> p_collection, String p_strMethodName) throws Exception Create a set of object properties from a collection of objects.- Parameters:
p_collection
- The object collection.p_strMethodName
- The method that returns the properties that will be in the resultant collection.- Returns:
- The set of properties.
- Throws:
Exception
- - If an error occurred.- Since:
- Intrexx 7.0.
-
getPropertiesAsSortedSet
public SortedSet<?> getPropertiesAsSortedSet(Collection<?> p_collection, String p_strMethodName) throws Exception Create a sorted set of object properties from a collection of objects.- Parameters:
p_collection
- The object collection.p_strMethodName
- The method that returns the properties that will be in the resultant collection.- Returns:
- The sorted set of properties.
- Throws:
Exception
- - If an error occurred.- Since:
- Intrexx 7.0.
-
getPrincipalNames
Create a collection of principal names for the given subject.- Parameters:
p_subject
- The subject.- Returns:
- The principal names.
- Since:
- Intrexx 7.0.
-