Class JavaClassConverterContext
- java.lang.Object
-
- org.apache.maven.tools.plugin.extractor.annotations.converter.JavaClassConverterContext
-
- All Implemented Interfaces:
ConverterContext
public class JavaClassConverterContext extends Object implements ConverterContext
-
-
Constructor Summary
Constructors Constructor Description JavaClassConverterContext(com.thoughtworks.qdox.model.JavaClass mojoClass, com.thoughtworks.qdox.JavaProjectBuilder javaProjectBuilder, Map<String,MojoAnnotatedClass> mojoAnnotatedClasses, JavadocLinkGenerator linkGenerator, int lineNumber)JavaClassConverterContext(com.thoughtworks.qdox.model.JavaClass mojoClass, com.thoughtworks.qdox.model.JavaClass declaringClass, com.thoughtworks.qdox.JavaProjectBuilder javaProjectBuilder, Map<String,MojoAnnotatedClass> mojoAnnotatedClasses, JavadocLinkGenerator linkGenerator, int lineNumber)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanGetUrl()<T> TgetAttribute(String name, Class<T> clazz, T defaultValue)Retrieves some attribute value from the current context.URIgetInternalJavadocSiteBaseUrl()Returns the base url to use for internal javadoc linksStringgetLocation()Optional<String>getModuleName()StringgetPackageName()StringgetStaticFieldValue(FullyQualifiedJavadocReference reference)Returns the value of a referenced static field.URIgetUrl(FullyQualifiedJavadocReference reference)Returns a (deep-)link to the javadoc page for the given referencebooleanisReferencedBy(FullyQualifiedJavadocReference reference)FullyQualifiedJavadocReferenceresolveReference(JavadocReference reference)Resolves a given javadoc reference, according to the rules of Javadoc's search order.<T> TsetAttribute(String name, T value)Stores some attribute in the current context
-
-
-
Constructor Detail
-
JavaClassConverterContext
public JavaClassConverterContext(com.thoughtworks.qdox.model.JavaClass mojoClass, com.thoughtworks.qdox.JavaProjectBuilder javaProjectBuilder, Map<String,MojoAnnotatedClass> mojoAnnotatedClasses, JavadocLinkGenerator linkGenerator, int lineNumber)
-
JavaClassConverterContext
public JavaClassConverterContext(com.thoughtworks.qdox.model.JavaClass mojoClass, com.thoughtworks.qdox.model.JavaClass declaringClass, com.thoughtworks.qdox.JavaProjectBuilder javaProjectBuilder, Map<String,MojoAnnotatedClass> mojoAnnotatedClasses, JavadocLinkGenerator linkGenerator, int lineNumber)
-
-
Method Detail
-
getModuleName
public Optional<String> getModuleName()
- Specified by:
getModuleNamein interfaceConverterContext- Returns:
- the module name of the container class
-
getPackageName
public String getPackageName()
- Specified by:
getPackageNamein interfaceConverterContext- Returns:
- the package name of the container class
-
getLocation
public String getLocation()
- Specified by:
getLocationin interfaceConverterContext- 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)
-
isReferencedBy
public boolean isReferencedBy(FullyQualifiedJavadocReference reference)
- Specified by:
isReferencedByin interfaceConverterContext- Parameters:
reference-- Returns:
- true in case either the current context class or any of its super classes are referenced
-
canGetUrl
public boolean canGetUrl()
- Specified by:
canGetUrlin interfaceConverterContext- Returns:
trueif links to javadoc pages could potentially be generated withConverterContext.getUrl(FullyQualifiedJavadocReference).
-
getUrl
public URI getUrl(FullyQualifiedJavadocReference reference)
Description copied from interface:ConverterContextReturns a (deep-)link to the javadoc page for the given reference- Specified by:
getUrlin interfaceConverterContext- Parameters:
reference- the reference for which to get the url- Returns:
- the link
-
resolveReference
public FullyQualifiedJavadocReference resolveReference(JavadocReference reference)
Description copied from interface:ConverterContextResolves a given javadoc reference, according to the rules of Javadoc's search order.- Specified by:
resolveReferencein interfaceConverterContext- Parameters:
reference- the reference to resolve- Returns:
- the resolved fully qualified reference
-
getStaticFieldValue
public String getStaticFieldValue(FullyQualifiedJavadocReference reference)
Description copied from interface:ConverterContextReturns the value of a referenced static field.- Specified by:
getStaticFieldValuein interfaceConverterContext- Parameters:
reference- the code reference towards a static field- Returns:
- the value of the static field given by the
reference
-
getInternalJavadocSiteBaseUrl
public URI getInternalJavadocSiteBaseUrl()
Description copied from interface:ConverterContextReturns the base url to use for internal javadoc links- Specified by:
getInternalJavadocSiteBaseUrlin interfaceConverterContext- Returns:
- the base url for internal javadoc links (may be
null).
-
setAttribute
public <T> T setAttribute(String name, T value)
Description copied from interface:ConverterContextStores some attribute in the current context- Specified by:
setAttributein interfaceConverterContext- Returns:
- the old attribute value or null.
-
getAttribute
public <T> T getAttribute(String name, Class<T> clazz, T defaultValue)
Description copied from interface:ConverterContextRetrieves some attribute value from the current context.- Specified by:
getAttributein interfaceConverterContext- Returns:
- the value of the attribute with the given name or
nullif it does not exist
-
-