Interface ConverterContext
-
- All Known Implementing Classes:
JavaClassConverterContext
public interface ConverterContext
Context which is passed toJavadocBlockTagsToXhtmlConverter
,JavadocInlineTagsToXhtmlConverter
,JavadocBlockTagToHtmlConverter
andJavadocBlockTagToHtmlConverter
. 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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
canGetUrl()
<T> T
getAttribute(java.lang.String name, java.lang.Class<T> clazz, T defaultValue)
Retrieves some attribute value from the current context.java.net.URI
getInternalJavadocSiteBaseUrl()
Returns the base url to use for internal javadoc linksjava.lang.String
getLocation()
java.util.Optional<java.lang.String>
getModuleName()
java.lang.String
getPackageName()
java.lang.String
getStaticFieldValue(org.apache.maven.tools.plugin.javadoc.FullyQualifiedJavadocReference reference)
Returns the value of a referenced static field.java.net.URI
getUrl(org.apache.maven.tools.plugin.javadoc.FullyQualifiedJavadocReference reference)
Returns a (deep-)link to the javadoc page for the given referenceboolean
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(java.lang.String name, T value)
Stores some attribute in the current context
-
-
-
Method Detail
-
getModuleName
java.util.Optional<java.lang.String> getModuleName()
- Returns:
- the module name of the container class
-
getPackageName
java.lang.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
java.lang.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:
java.lang.IllegalArgumentException
- in case the reference cannot be resolved
-
canGetUrl
boolean canGetUrl()
- Returns:
true
if links to javadoc pages could potentially be generated withgetUrl(FullyQualifiedJavadocReference)
.
-
getUrl
java.net.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:
java.lang.IllegalArgumentException
- in case no javadoc link could be generated for the given referencejava.lang.IllegalStateException
- in case no javadoc source sites have been configured (i.e.canGetUrl()
returnsfalse
)
-
getStaticFieldValue
java.lang.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:
java.lang.IllegalArgumentException
- in case the reference does not point to a valid static field
-
getInternalJavadocSiteBaseUrl
java.net.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(java.lang.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(java.lang.String name, java.lang.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
-
-