Class PHPXMLClientModule

All Implemented Interfaces:
ApiFeatureProviderModule, DependingModuleAwareModule, EnunciateModule

public class PHPXMLClientModule extends BasicGeneratingModule implements ApiFeatureProviderModule
Author:
Ryan Heaton
  • Constructor Details

    • PHPXMLClientModule

      public PHPXMLClientModule()
  • Method Details

    • getName

      public String getName()
      Specified by:
      getName in interface EnunciateModule
      Returns:
      "php-xml-client"
    • getDependencySpecifications

      public List<DependencySpec> getDependencySpecifications()
      Specified by:
      getDependencySpecifications in interface EnunciateModule
      Overrides:
      getDependencySpecifications in class BasicEnunicateModule
    • call

      public void call(EnunciateContext context)
      Specified by:
      call in interface EnunciateModule
    • usesUnmappableElements

      protected boolean usesUnmappableElements()
    • getSourceDir

      protected File getSourceDir()
    • 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:
      IOException
      freemarker.template.TemplateException
    • packageToNamespace

      protected String packageToNamespace(String pckg)
    • getBundleFileName

      protected String getBundleFileName()
      The name of the bundle file.
      Returns:
      The name of the bundle file.
    • readResource

      protected String readResource(String resource, Map<String,Object> model)
      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()
      The name of the generated PHP source file.
      Returns:
      The name of the generated PHP 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.
    • getSlug

      public String getSlug()
      The label for the PHP API.
      Returns:
      The label for the PHP API.
    • getPackageToNamespaceConversions

      public Map<String,String> getPackageToNamespaceConversions()
      The package-to-namespace conversions.
      Returns:
      The package-to-namespace conversions.
    • getFacetIncludes

      public Set<String> getFacetIncludes()
    • getFacetExcludes

      public Set<String> getFacetExcludes()
    • 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.