All Known Implementing Classes:
JavaClassConverterContext

public interface ConverterContext
Context which is passed to JavadocBlockTagsToXhtmlConverter, JavadocInlineTagsToXhtmlConverter, JavadocBlockTagToHtmlConverter and JavadocBlockTagToHtmlConverter. It contains metadata about the container class and allows to resolve class or member names which are not fully qualified as well as creating (deep-) links to javadoc pages.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    <T> T
    getAttribute(String name, Class<T> clazz, T defaultValue)
    Retrieves some attribute value from the current context.
    Returns the base url to use for internal javadoc links
     
     
     
    getStaticFieldValue(org.apache.maven.tools.plugin.javadoc.FullyQualifiedJavadocReference reference)
    Returns the value of a referenced static field.
    getUrl(org.apache.maven.tools.plugin.javadoc.FullyQualifiedJavadocReference reference)
    Returns a (deep-)link to the javadoc page for the given reference
    boolean
    isReferencedBy(org.apache.maven.tools.plugin.javadoc.FullyQualifiedJavadocReference reference)
     
    org.apache.maven.tools.plugin.javadoc.FullyQualifiedJavadocReference
    resolveReference(org.apache.maven.tools.plugin.javadoc.JavadocReference reference)
    Resolves a given javadoc reference, according to the rules of Javadoc's search order.
    <T> T
    setAttribute(String name, T value)
    Stores some attribute in the current context
  • Method Details

    • getModuleName

      Optional<String> getModuleName()
      Returns:
      the module name of the container class
    • getPackageName

      String getPackageName()
      Returns:
      the package name of the container class
    • isReferencedBy

      boolean isReferencedBy(org.apache.maven.tools.plugin.javadoc.FullyQualifiedJavadocReference reference)
      Parameters:
      reference -
      Returns:
      true in case either the current container class or any of its super classes are referenced
    • getLocation

      String getLocation()
      Returns:
      a location text (human readable) indicating where in the container class the conversion is triggered (should be as specific as possible to ease debugging)
    • resolveReference

      org.apache.maven.tools.plugin.javadoc.FullyQualifiedJavadocReference resolveReference(org.apache.maven.tools.plugin.javadoc.JavadocReference reference)
      Resolves a given javadoc reference, according to the rules of Javadoc's search order.
      Parameters:
      reference - the reference to resolve
      Returns:
      the resolved fully qualified reference
      Throws:
      IllegalArgumentException - in case the reference cannot be resolved
    • canGetUrl

      boolean canGetUrl()
      Returns:
      true if links to javadoc pages could potentially be generated with getUrl(FullyQualifiedJavadocReference).
    • getUrl

      URI getUrl(org.apache.maven.tools.plugin.javadoc.FullyQualifiedJavadocReference reference)
      Returns a (deep-)link to the javadoc page for the given reference
      Parameters:
      reference - the reference for which to get the url
      Returns:
      the link
      Throws:
      IllegalArgumentException - in case no javadoc link could be generated for the given reference
      IllegalStateException - in case no javadoc source sites have been configured (i.e. canGetUrl() returns false)
    • getStaticFieldValue

      String getStaticFieldValue(org.apache.maven.tools.plugin.javadoc.FullyQualifiedJavadocReference reference)
      Returns the value of a referenced static field.
      Parameters:
      reference - the code reference towards a static field
      Returns:
      the value of the static field given by the reference
      Throws:
      IllegalArgumentException - in case the reference does not point to a valid static field
    • getInternalJavadocSiteBaseUrl

      URI getInternalJavadocSiteBaseUrl()
      Returns the base url to use for internal javadoc links
      Returns:
      the base url for internal javadoc links (may be null).
    • setAttribute

      <T> T setAttribute(String name, T value)
      Stores some attribute in the current context
      Type Parameters:
      T -
      Parameters:
      name -
      value -
      Returns:
      the old attribute value or null.
    • getAttribute

      <T> T getAttribute(String name, Class<T> clazz, T defaultValue)
      Retrieves some attribute value from the current context.
      Type Parameters:
      T -
      Parameters:
      name -
      clazz -
      defaultValue -
      Returns:
      the value of the attribute with the given name or null if it does not exist