Class DocStringExtractor

java.lang.Object
com.linecorp.armeria.server.docs.DocStringExtractor

@UnstableApi public abstract class DocStringExtractor extends Object
A supporting base class for implementing the standard pattern of extracting docstrings from arbitrary files in a particular classpath location.
  • Constructor Details

    • DocStringExtractor

      protected DocStringExtractor(String defaultPath, String pathPropertyName)
  • Method Details

    • getAllDocStrings

      public final Map<String,String> getAllDocStrings(ClassLoader classLoader)
      Extract all docstrings from files at the configured path, delegating to getDocStringsFromFiles(Map) for actual processing.
    • acceptFile

      protected boolean acceptFile(String filename)
      Determine whether the file at filename should be processed by the DocStringExtractor. This will usually look at the file extension, but the default implementation can be used to check all files at a particular path.
    • getDocStringsFromFiles

      protected abstract Map<String,String> getDocStringsFromFiles(Map<String,byte[]> files)
      Extracts a Map of docstrings from the given Map of path to file contents. The result will generally be used within a DocServicePlugin for finding docstrings of items.