public abstract class WSContractProvider extends Object
The following example generates class files, source files and WSDL for an endpoint:
WSContractProvider provider = WSContractProvider.newInstance(); provider.setGenerateSource(true); provider.setGenerateWsdl(true); provider.setOutputDirectory(new File("output")); provider.setMessageStream(System.out); provider.provide(TestMe.class);
Thread-Safety:
This class expects to be thread-confined, so it can not be shared between threads.Modifier and Type | Field and Description |
---|---|
static String |
PROVIDER_PROPERTY |
Modifier | Constructor and Description |
---|---|
protected |
WSContractProvider() |
Modifier and Type | Method and Description |
---|---|
static WSContractProvider |
newInstance()
Obtain a new instance of a
WSContractProvider . |
static WSContractProvider |
newInstance(ClassLoader loader)
Obtain a new instance of a
WSContractProvider . |
abstract void |
provide(Class<?> endpointClass)
Generates artifacts using the current settings.
|
abstract void |
provide(String endpointClass)
Generates artifacts using the current settings.
|
abstract void |
setClassLoader(ClassLoader loader)
Sets the ClassLoader used to discover types.
|
abstract void |
setExtension(boolean extension)
Enables/Disables SOAP 1.2 binding extension
|
abstract void |
setGenerateSource(boolean generateSource)
Enables/Disables Java source generation.
|
abstract void |
setGenerateWsdl(boolean generateWsdl)
Enables/Disables WSDL generation.
|
abstract void |
setMessageStream(PrintStream messageStream)
Sets the PrintStream to use for status feedback.
|
abstract void |
setOutputDirectory(File directory)
Sets the main output directory.
|
abstract void |
setPortSoapAddress(String address)
Sets the soap:address to be used for the generated port in the wsdl.
|
abstract void |
setResourceDirectory(File directory)
Sets the resource directory.
|
abstract void |
setSourceDirectory(File directory)
Sets the source directory.
|
public static final String PROVIDER_PROPERTY
public static WSContractProvider newInstance()
WSContractProvider
. This will use the current
thread's context class loader to locate the WSContractProviderFactory
implementation.WSContractProvider
public static WSContractProvider newInstance(ClassLoader loader)
WSContractProvider
. The specified ClassLoader will be used to
locate the WSContractProviderFactory
implementationloader
- the ClassLoader to useWSContractProvider
public abstract void setGenerateWsdl(boolean generateWsdl)
generateWsdl
- whether or not to generate WSDLpublic abstract void setExtension(boolean extension)
extension
- whether or not to enable SOAP 1.2 binding extensionpublic abstract void setGenerateSource(boolean generateSource)
generateSource
- whether or not to generate Java source.public abstract void setOutputDirectory(File directory)
directory
- the root directory for generated filespublic abstract void setResourceDirectory(File directory)
directory
- the root directory for generated resource filespublic abstract void setSourceDirectory(File directory)
directory
- the root directory for generated source codepublic abstract void setPortSoapAddress(String address)
address
- soap addresspublic abstract void setClassLoader(ClassLoader loader)
loader
- the ClassLoader to usepublic abstract void provide(String endpointClass)
endpointClass
- the name of the endpoint implementation beanRuntimeException
- if any error occurs during processing, or the class is not foundpublic abstract void provide(Class<?> endpointClass)
endpointClass
- the endpoint implementation beanRuntimeException
- if any error occurs during processingpublic abstract void setMessageStream(PrintStream messageStream)
Example output:
Generating WSDL: TestMeService.wsdl Writing Source: org/jboss/ws/tools/jaxws/TestMe.java org/jboss/ws/tools/jaxws/TestMeResponse.java Writing Classes: org/jboss/ws/tools/jaxws/TestMe.class org/jboss/ws/tools/jaxws/TestMeResponse.class
messageStream
- the stream to use for status messages:Copyright © 2020 JBoss by Red Hat. All rights reserved.