Class WadlGeneratorLoader
java.lang.Object
org.glassfish.jersey.server.wadl.config.WadlGeneratorLoader
Loads
The properties of the
WadlGenerator
s from a provided list of WadlGeneratorDescription
s.The properties of the
WadlGeneratorDescription
s can refer to WadlGenerator
properties
of these types:
- exact match: if the WadlGenerator property is of type
org.example.Foo
and the property value provided by theWadlGeneratorDescription
is of typeorg.example.Foo
- java.io.InputStream: The
InputStream
can e.g. represent a file. The stream is loaded from the property value (provided by theWadlGeneratorDescription
) viaClassLoader.getResourceAsStream(String)
or via OSGi API means if OSGi runtime is detected. The stream will be closed afterWadlGenerator.init()
was called. - Types that provide a constructor for the provided type (mostly java.lang.String)
- Deprecated, will be removed in future versions from the
WadlGeneratorLoader
:
java.lang.File: The property value can contain the prefix classpath: to denote, that the path to the file is relative to the classpath. In this case, the property value is stripped by the prefix classpath: and the java.lang.File is created vianew File( generator.getClass().getResource( strippedFilename ).toURI() )
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static interface
private static class
private static class
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static Method
getMethodByName
(String methodName, Class<?> clazz) private static WadlGeneratorLoader.WadlGeneratorControl
loadWadlGenerator
(InjectionManager injectionManager, WadlGeneratorDescription wadlGeneratorDescription, WadlGenerator wadlGeneratorDelegate) (package private) static WadlGenerator
loadWadlGeneratorDescriptions
(InjectionManager injectionManager, List<WadlGeneratorDescription> wadlGeneratorDescriptions) (package private) static WadlGenerator
loadWadlGeneratorDescriptions
(InjectionManager injectionManager, WadlGeneratorDescription... wadlGeneratorDescriptions) (package private) static WadlGenerator
loadWadlGenerators
(List<WadlGenerator> wadlGenerators) private static WadlGeneratorLoader.Callback
setProperty
(Object generator, String propertyName, Object propertyValue, Class<?> osgiConfigClass) Set the object (generator) property with the given name to the specified value.
-
Field Details
-
LOGGER
-
-
Constructor Details
-
WadlGeneratorLoader
WadlGeneratorLoader()
-
-
Method Details
-
loadWadlGenerators
- Throws:
Exception
-
loadWadlGeneratorDescriptions
static WadlGenerator loadWadlGeneratorDescriptions(InjectionManager injectionManager, WadlGeneratorDescription... wadlGeneratorDescriptions) throws Exception - Throws:
Exception
-
loadWadlGeneratorDescriptions
static WadlGenerator loadWadlGeneratorDescriptions(InjectionManager injectionManager, List<WadlGeneratorDescription> wadlGeneratorDescriptions) throws Exception - Throws:
Exception
-
loadWadlGenerator
private static WadlGeneratorLoader.WadlGeneratorControl loadWadlGenerator(InjectionManager injectionManager, WadlGeneratorDescription wadlGeneratorDescription, WadlGenerator wadlGeneratorDelegate) throws Exception - Throws:
Exception
-
setProperty
private static WadlGeneratorLoader.Callback setProperty(Object generator, String propertyName, Object propertyValue, Class<?> osgiConfigClass) throws Exception Set the object (generator) property with the given name to the specified value.- Parameters:
generator
- the object, on which the property shall be setpropertyName
- the name of the property, that shall be setpropertyValue
- the value to populate the property with- Returns:
- a
WadlGeneratorLoader.Callback
object that must be called later, or null if no callback is required. - Throws:
Exception
- if s.th. goes wrong
-
getMethodByName
-