Class CSharpXMLClientModule
- java.lang.Object
-
- com.webcohesion.enunciate.module.BasicEnunicateModule
-
- com.webcohesion.enunciate.module.BasicGeneratingModule
-
- com.webcohesion.enunciate.modules.csharp_client.CSharpXMLClientModule
-
- All Implemented Interfaces:
ApiFeatureProviderModule,DependingModuleAwareModule,EnunciateModule
public class CSharpXMLClientModule extends BasicGeneratingModule implements ApiFeatureProviderModule
- Author:
- Ryan Heaton
-
-
Field Summary
-
Fields inherited from class com.webcohesion.enunciate.module.BasicEnunicateModule
config, context, dependingModules, enunciate
-
-
Constructor Summary
Constructors Constructor Description CSharpXMLClientModule()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcall(EnunciateContext context)MethodfindExampleResourceMethod()Finds an example resource method, according to the following preference order: The first method annotated withDocumentationExample.WebMethodfindExampleWebMethod()Finds an example resource method, according to the following preference order: The first method annotated withDocumentationExample.protected StringgetBundleFileName()The name of the bundle file.StringgetCompileCommand()The C# compile command.protected FilegetCompileDir()StringgetCompileExecutable()The path to the compile executable.List<DependencySpec>getDependencySpecifications()protected StringgetDLLFileName()The name of the generated C# dll.protected StringgetDocXmlFileName()The name of the generated C# xml documentation.Set<String>getFacetExcludes()Set<String>getFacetIncludes()StringgetName()protected FilegetPackageDir()Map<String,String>getPackageToNamespaceConversions()The package-to-namespace conversions.StringgetSlug()The label for the C# API.protected FilegetSourceDir()protected StringgetSourceFileName()The name of the generated C# source file.protected URLgetTemplateURL(String template)Get a template URL for the template of the given name.booleanisDisableCompile()Whether to disable the compile step.booleanisRequire()Whether to require the C# client code.booleanisSingleFilePerClass()Whether there should be a single file per class.protected StringpackageToNamespace(String pckg)StringprocessTemplate(URL templateURL, Object model)Processes the specified template with the given model.protected StringreadLibraryDescription(Map<String,Object> model)protected booleanusesUnmappableElements()-
Methods inherited from class com.webcohesion.enunciate.module.BasicGeneratingModule
buildFileList, findSourceTimestamp, getManifest, getOldest, getYoungest, isUpToDate, isUpToDateWithSources
-
Methods inherited from class com.webcohesion.enunciate.module.BasicEnunicateModule
acknowledgeDependingModules, debug, descriptionOf, error, info, init, init, isEnabled, isEnabledByDefault, positionOf, resolveFile, warn
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.webcohesion.enunciate.module.EnunciateModule
init, init, isEnabled
-
-
-
-
Method Detail
-
getName
public String getName()
- Specified by:
getNamein interfaceEnunciateModule- Returns:
- "csharp-xml-client"
-
getDependencySpecifications
public List<DependencySpec> getDependencySpecifications()
- Specified by:
getDependencySpecificationsin interfaceEnunciateModule- Overrides:
getDependencySpecificationsin classBasicEnunicateModule
-
call
public void call(EnunciateContext context)
- Specified by:
callin interfaceEnunciateModule
-
usesUnmappableElements
protected boolean usesUnmappableElements()
-
getSourceDir
protected File getSourceDir()
-
getCompileDir
protected File getCompileDir()
-
getPackageDir
protected File getPackageDir()
-
processTemplate
public String processTemplate(URL templateURL, Object model) throws IOException, freemarker.template.TemplateException
Processes the specified template with the given model.- Parameters:
templateURL- The template URL.model- The root model.- Throws:
IOExceptionfreemarker.template.TemplateException
-
findExampleWebMethod
public WebMethod findExampleWebMethod()
Finds an example resource method, according to the following preference order:- The first method annotated with
DocumentationExample. - The first web method that returns a declared type.
- The first web method.
- Returns:
- An example resource method, or if no good examples were found.
- The first method annotated with
-
findExampleResourceMethod
public Method findExampleResourceMethod()
Finds an example resource method, according to the following preference order:- The first method annotated with
DocumentationExample. - The first method with BOTH an output payload with a known XML element and an input payload with a known XML element.
- The first method with an output payload with a known XML element.
- Returns:
- An example resource method, or if no good examples were found.
- The first method annotated with
-
getBundleFileName
protected String getBundleFileName()
The name of the bundle file.- Returns:
- The name of the bundle file.
-
getDLLFileName
protected String getDLLFileName()
The name of the generated C# dll.- Returns:
- The name of the generated C# file.
-
getDocXmlFileName
protected String getDocXmlFileName()
The name of the generated C# xml documentation.- Returns:
- The name of the generated C# xml documentation.
-
getSourceFileName
protected String getSourceFileName()
The name of the generated C# source file.- Returns:
- The name of the generated C# source file.
-
getTemplateURL
protected URL getTemplateURL(String template)
Get a template URL for the template of the given name.- Parameters:
template- The specified template.- Returns:
- The URL to the specified template.
-
isRequire
public boolean isRequire()
Whether to require the C# client code.- Returns:
- Whether to require the C# client code.
-
getSlug
public String getSlug()
The label for the C# API.- Returns:
- The label for the C# API.
-
getCompileExecutable
public String getCompileExecutable()
The path to the compile executable.- Returns:
- The path to the compile executable.
-
getCompileCommand
public String getCompileCommand()
The C# compile command.- Returns:
- The C# compile command.
-
getPackageToNamespaceConversions
public Map<String,String> getPackageToNamespaceConversions()
The package-to-namespace conversions.- Returns:
- The package-to-namespace conversions.
-
isDisableCompile
public boolean isDisableCompile()
Whether to disable the compile step.- Returns:
- Whether to disable the compile step.
-
isSingleFilePerClass
public boolean isSingleFilePerClass()
Whether there should be a single file per class. Default: false (all classes are contained in a single file).- Returns:
- Whether there should be a single file per class.
-
-