Class CXMLClientModule

    • Constructor Detail

      • CXMLClientModule

        public CXMLClientModule()
    • Method Detail

      • scrubIdentifier

        public static String scrubIdentifier​(String identifier)
        Scrub a C identifier (removing any illegal characters, etc.).
        Parameters:
        identifier - The identifier.
        Returns:
        The identifier.
      • 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:
        IOException
        freemarker.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:
        1. The first method annotated with DocumentationExample.
        2. The first method with BOTH an output payload with a known XML element and an input payload with a known XML element.
        3. The first method with an output payload with a known XML element.
        Returns:
        An example resource method, or if no good examples were found.
      • getSourceFileName

        protected String getSourceFileName​(String label)
      • 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.
      • getFacetIncludes

        public Set<String> getFacetIncludes()
      • getFacetExcludes

        public Set<String> getFacetExcludes()