Class CXMLClientModule
- java.lang.Object
-
- com.webcohesion.enunciate.module.BasicEnunicateModule
-
- com.webcohesion.enunciate.module.BasicGeneratingModule
-
- com.webcohesion.enunciate.modules.c_client.CXMLClientModule
-
- All Implemented Interfaces:
ApiFeatureProviderModule,DependingModuleAwareModule,EnunciateModule
public class CXMLClientModule 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 CXMLClientModule()
-
Method Summary
All Methods Static 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.List<DependencySpec>getDependencySpecifications()StringgetEnumConstantNamePattern()The pattern for converting an enum constant to a unique C-style type name.Set<String>getFacetExcludes()Set<String>getFacetIncludes()StringgetName()StringgetSlug()The slug for the C API.protected FilegetSourceDir()protected StringgetSourceFileName(String label)protected URLgetTemplateURL(String template)Get a template URL for the template of the given name.StringgetTypeDefinitionNamePattern()The pattern for converting a type definition to a unique C-style type name.booleanisSeparateCommonCode()Whether to separate the common code from the project-specific code.StringprocessTemplate(URL templateURL, Object model)Processes the specified template with the given model.protected StringreadResource(String resource, Map<String,Object> model, NameForTypeDefinitionMethod nameForTypeDefinition)Reads a resource into string form.static StringscrubIdentifier(String identifier)Scrub a C identifier (removing any illegal characters, etc.).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:
- "c-xml-client"
-
getDependencySpecifications
public List<DependencySpec> getDependencySpecifications()
- Specified by:
getDependencySpecificationsin interfaceEnunciateModule- Overrides:
getDependencySpecificationsin classBasicEnunicateModule
-
scrubIdentifier
public static String scrubIdentifier(String identifier)
Scrub a C identifier (removing any illegal characters, etc.).- Parameters:
identifier- The identifier.- Returns:
- The identifier.
-
call
public void call(EnunciateContext context)
- Specified by:
callin interfaceEnunciateModule
-
usesUnmappableElements
protected boolean usesUnmappableElements()
-
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
-
readResource
protected String readResource(String resource, Map<String,Object> model, NameForTypeDefinitionMethod nameForTypeDefinition)
Reads a resource into string form.- Parameters:
resource- The resource to read.- Returns:
- The string form of the resource.
-
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
-
getSourceDir
protected File getSourceDir()
-
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.
-
getSlug
public String getSlug()
The slug for the C API.- Returns:
- The slug for the C API.
-
getTypeDefinitionNamePattern
public String getTypeDefinitionNamePattern()
The pattern for converting a type definition to a unique C-style type name.- Returns:
- The pattern for converting a type definition to a unique C-style type name.
-
getEnumConstantNamePattern
public String getEnumConstantNamePattern()
The pattern for converting an enum constant to a unique C-style type name.- Returns:
- The pattern for converting an enum constant to a unique C-style type name.
-
isSeparateCommonCode
public boolean isSeparateCommonCode()
Whether to separate the common code from the project-specific code.- Returns:
- Whether to separate the common code from the project-specific code.
-
-