Class WadlGeneratorLoader
- java.lang.Object
-
- org.glassfish.jersey.server.wadl.config.WadlGeneratorLoader
-
class WadlGeneratorLoader extends java.lang.ObjectLoadsWadlGenerators from a provided list ofWadlGeneratorDescriptions.
The properties of theWadlGeneratorDescriptions can refer toWadlGeneratorproperties of these types:- exact match: if the WadlGenerator property is of type
org.example.Fooand the property value provided by theWadlGeneratorDescriptionis of typeorg.example.Foo - java.io.InputStream: The
InputStreamcan 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() )
- exact match: if the WadlGenerator property is of type
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static interfaceWadlGeneratorLoader.Callbackprivate static classWadlGeneratorLoader.CallbackListprivate static classWadlGeneratorLoader.WadlGeneratorControl
-
Field Summary
Fields Modifier and Type Field Description private static java.util.logging.LoggerLOGGER
-
Constructor Summary
Constructors Constructor Description WadlGeneratorLoader()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static java.lang.reflect.MethodgetMethodByName(java.lang.String methodName, java.lang.Class<?> clazz)private static WadlGeneratorLoader.WadlGeneratorControlloadWadlGenerator(InjectionManager injectionManager, WadlGeneratorDescription wadlGeneratorDescription, WadlGenerator wadlGeneratorDelegate)(package private) static WadlGeneratorloadWadlGeneratorDescriptions(InjectionManager injectionManager, java.util.List<WadlGeneratorDescription> wadlGeneratorDescriptions)(package private) static WadlGeneratorloadWadlGeneratorDescriptions(InjectionManager injectionManager, WadlGeneratorDescription... wadlGeneratorDescriptions)(package private) static WadlGeneratorloadWadlGenerators(java.util.List<WadlGenerator> wadlGenerators)private static WadlGeneratorLoader.CallbacksetProperty(java.lang.Object generator, java.lang.String propertyName, java.lang.Object propertyValue, java.lang.Class<?> osgiConfigClass)Set the object (generator) property with the given name to the specified value.
-
-
-
Method Detail
-
loadWadlGenerators
static WadlGenerator loadWadlGenerators(java.util.List<WadlGenerator> wadlGenerators) throws java.lang.Exception
- Throws:
java.lang.Exception
-
loadWadlGeneratorDescriptions
static WadlGenerator loadWadlGeneratorDescriptions(InjectionManager injectionManager, WadlGeneratorDescription... wadlGeneratorDescriptions) throws java.lang.Exception
- Throws:
java.lang.Exception
-
loadWadlGeneratorDescriptions
static WadlGenerator loadWadlGeneratorDescriptions(InjectionManager injectionManager, java.util.List<WadlGeneratorDescription> wadlGeneratorDescriptions) throws java.lang.Exception
- Throws:
java.lang.Exception
-
loadWadlGenerator
private static WadlGeneratorLoader.WadlGeneratorControl loadWadlGenerator(InjectionManager injectionManager, WadlGeneratorDescription wadlGeneratorDescription, WadlGenerator wadlGeneratorDelegate) throws java.lang.Exception
- Throws:
java.lang.Exception
-
setProperty
private static WadlGeneratorLoader.Callback setProperty(java.lang.Object generator, java.lang.String propertyName, java.lang.Object propertyValue, java.lang.Class<?> osgiConfigClass) throws java.lang.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.Callbackobject that must be called later, or null if no callback is required. - Throws:
java.lang.Exception- if s.th. goes wrong
-
getMethodByName
private static java.lang.reflect.Method getMethodByName(java.lang.String methodName, java.lang.Class<?> clazz)
-
-