Class WadlGeneratorDescription
- java.lang.Object
-
- org.glassfish.jersey.server.wadl.config.WadlGeneratorDescription
-
public class WadlGeneratorDescription extends java.lang.Object
This is the model for the definition of wadl generators via configuration properties.
The properties refer to the properties of theWadlGenerator
implementation with the specifiedgetGeneratorClass()
. TheWadlGenerator
properties are populated with the provided properties like this:- The types match exactly:
if the WadlGenerator property is of typeorg.example.Foo
and the provided property value is of typeorg.example.Foo
- Types that provide a constructor for the provided type (mostly java.lang.String)
- The WadlGenerator property is of type
InputStream
: The stream is loaded from the property value (provided by theWadlGeneratorDescription
) viaClassLoader.getResourceAsStream(String)
. It will be closed afterWadlGenerator.init()
was called. - Deprecated, will be removed in future versions:
The WadlGenerator property is of typeFile
and the provided property value is aString
:
the provided 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 theFile
is created via
Notice that the filename is loaded from the classpath in this case, e.g. classpath:test.xml refers to a file in the package of the class (new File( generator.getClass().getResource( strippedFilename ).toURI() )
getGeneratorClass()
). The file reference classpath:/test.xml refers to a file that is in the root of the classpath.
- The types match exactly:
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Class<?>
configuratorClass
private java.lang.Class<? extends WadlGenerator>
generatorClass
private java.util.Properties
properties
-
Constructor Summary
Constructors Constructor Description WadlGeneratorDescription()
WadlGeneratorDescription(java.lang.Class<? extends WadlGenerator> generatorClass, java.util.Properties properties)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Class<?>
getConfiguratorClass()
ReturnWadlGeneratorConfig
that was used to produce current description instance.java.lang.Class<? extends WadlGenerator>
getGeneratorClass()
java.util.Properties
getProperties()
(package private) void
setConfiguratorClass(java.lang.Class<?> configuratorClass)
SetWadlGeneratorConfig
class to be associated with current instance.void
setGeneratorClass(java.lang.Class<? extends WadlGenerator> generatorClass)
void
setProperties(java.util.Properties properties)
-
-
-
Field Detail
-
generatorClass
private java.lang.Class<? extends WadlGenerator> generatorClass
-
properties
private java.util.Properties properties
-
configuratorClass
private java.lang.Class<?> configuratorClass
-
-
Constructor Detail
-
WadlGeneratorDescription
public WadlGeneratorDescription()
-
WadlGeneratorDescription
public WadlGeneratorDescription(java.lang.Class<? extends WadlGenerator> generatorClass, java.util.Properties properties)
-
-
Method Detail
-
getGeneratorClass
public java.lang.Class<? extends WadlGenerator> getGeneratorClass()
- Returns:
- the generatorClass
-
setGeneratorClass
public void setGeneratorClass(java.lang.Class<? extends WadlGenerator> generatorClass)
- Parameters:
generatorClass
- the generatorClass to set
-
getProperties
public java.util.Properties getProperties()
- Returns:
- the properties
-
setProperties
public void setProperties(java.util.Properties properties)
- Parameters:
properties
- the properties to set
-
getConfiguratorClass
public java.lang.Class<?> getConfiguratorClass()
ReturnWadlGeneratorConfig
that was used to produce current description instance. The result could be null if the config was not set on this instance.- Returns:
- config
-
setConfiguratorClass
void setConfiguratorClass(java.lang.Class<?> configuratorClass)
SetWadlGeneratorConfig
class to be associated with current instance.- Parameters:
configuratorClass
-
-
-