Package org.nuxeo.ecm.webengine.jaxrs
Class Utils
java.lang.Object
org.nuxeo.ecm.webengine.jaxrs.Utils
Some helper methods for parsing configuration and loading contributed servlets or filters.
- Author:
- Bogdan Stefanescu
- 
Nested Class SummaryNested Classes
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic Utils.ClassRefgetClassRef(String classRef) Get a class proxy reference for the given class referencestatic Utils.ClassRefgetClassRef(String classRef, org.osgi.framework.Bundle bundle) static Class<?>Load a class from a class reference string.static Class<?>Load a class given the owner bundle and the class name.static Class<?>[]loadClasses(String classRefs) Load classes from a list of class references given as a comma separated string list.static Class<?>[]loadClasses(String classRefs, char sep) Load classes from a list of class references given as a 'sep' separated string list.static ObjectnewInstance(String classRef) Create a new object of the given a class reference.static ObjectnewInstance(String bundleId, String className) Create a new object of the given class in the given bundle.static <T> T[]newInstances(Class<T> componentType, String classRefs) Get class instances for the given class references stringstatic <T> T[]newInstances(Class<T> componentType, String classRefs, char sep) Get class instances for the given class references string
- 
Constructor Details- 
Utilspublic Utils()
 
- 
- 
Method Details- 
loadClassespublic static Class<?>[] loadClasses(String classRefs) throws ClassNotFoundException, BundleNotFoundException Load classes from a list of class references given as a comma separated string list.- Parameters:
- classRefs- the string containing the list of class references
- Returns:
- an array of the loaded classes
- Throws:
- ClassNotFoundException
- BundleNotFoundException
 
- 
loadClassespublic static Class<?>[] loadClasses(String classRefs, char sep) throws ClassNotFoundException, BundleNotFoundException Load classes from a list of class references given as a 'sep' separated string list.- Parameters:
- classRefs- the string containing the list of class references
- sep- the separator character used to separate class references in the string.
- Returns:
- an array of the loaded classes
- Throws:
- ClassNotFoundException
- BundleNotFoundException
 
- 
newInstancespublic static <T> T[] newInstances(Class<T> componentType, String classRefs) throws ReflectiveOperationException, BundleNotFoundException Get class instances for the given class references string- Parameters:
- componentType- the type of the expected array component
- Throws:
- ReflectiveOperationException
- BundleNotFoundException
- See Also:
 
- 
newInstancespublic static <T> T[] newInstances(Class<T> componentType, String classRefs, char sep) throws ReflectiveOperationException, BundleNotFoundException Get class instances for the given class references string- Throws:
- ReflectiveOperationException
- BundleNotFoundException
- See Also:
 
- 
loadClasspublic static Class<?> loadClass(String classRef) throws ClassNotFoundException, BundleNotFoundException Load a class from a class reference string. The class reference string is in the format:bundleSymbolicName:classNameorclassName. If no bundle symbolic name is given the class will be loaded using the class loader of theUtilsclass.The bundle will be resolved to the last version of the bundle (in case when different bundle versions are found) 
- 
getClassRefpublic static Utils.ClassRef getClassRef(String classRef) throws ClassNotFoundException, BundleNotFoundException Get a class proxy reference for the given class reference
- 
getClassRefpublic static Utils.ClassRef getClassRef(String classRef, org.osgi.framework.Bundle bundle) throws ClassNotFoundException, BundleNotFoundException 
- 
loadClasspublic static Class<?> loadClass(String bundleId, String className) throws ClassNotFoundException, BundleNotFoundException Load a class given the owner bundle and the class name.The bundle will be resolved to the last version of the bundle (in case when different bundle versions are found) 
- 
newInstancepublic static Object newInstance(String bundleId, String className) throws ReflectiveOperationException, BundleNotFoundException Create a new object of the given class in the given bundle. The class should provide a no-args empty constructor.The bundle will be resolved to the last version of the bundle (in case when different bundle versions are found) - Throws:
- ReflectiveOperationException
- BundleNotFoundException
- See Also:
 
- 
newInstancepublic static Object newInstance(String classRef) throws ReflectiveOperationException, BundleNotFoundException Create a new object of the given a class reference.The bundle will be resolved to the last version of the bundle (in case when different bundle versions are found) - Throws:
- ReflectiveOperationException
- BundleNotFoundException
- See Also:
 
 
-