Class JavaClassConverterContext
java.lang.Object
org.apache.maven.tools.plugin.extractor.annotations.converter.JavaClassConverterContext
- All Implemented Interfaces:
ConverterContext
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final com.thoughtworks.qdox.model.JavaClass
(package private) final Optional<com.thoughtworks.qdox.model.JavaModule>
(package private) final com.thoughtworks.qdox.JavaProjectBuilder
(package private) final int
(package private) final JavadocLinkGenerator
(package private) final Map<String,
MojoAnnotatedClass> (package private) final com.thoughtworks.qdox.model.JavaClass
-
Constructor Summary
ConstructorsConstructorDescriptionJavaClassConverterContext
(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
Modifier and TypeMethodDescriptionboolean
<T> T
getAttribute
(String name, Class<T> clazz, T defaultValue) Retrieves some attribute value from the current context.private static int
getDimensions
(String type) Returns the base url to use for internal javadoc linksprivate static String
getMethodName
(String member) private List<com.thoughtworks.qdox.model.JavaType>
getParameterTypes
(String member) private static String
getRawTypeName
(String typeName) Returns the value of a referenced static field.getUrl
(FullyQualifiedJavadocReference reference) Returns a (deep-)link to the javadoc page for the given referenceprivate static boolean
isClassFound
(com.thoughtworks.qdox.model.JavaClass javaClass) private static boolean
isClassReferencedByReference
(com.thoughtworks.qdox.model.JavaClass javaClass, FullyQualifiedJavadocReference reference) private boolean
isExternal
(com.thoughtworks.qdox.model.JavaClass javaClass) private boolean
isExternal
(com.thoughtworks.qdox.model.JavaPackage javaPackage) boolean
isReferencedBy
(FullyQualifiedJavadocReference reference) private Optional<FullyQualifiedJavadocReference>
resolveMember
(com.thoughtworks.qdox.model.JavaClass javaClass, Optional<String> member, Optional<String> label) private Optional<FullyQualifiedJavadocReference>
resolveMember
(String fullyQualifiedPackageNameClassName, String nestedClassName, Optional<String> member, Optional<String> label) private Optional<FullyQualifiedJavadocReference>
resolveMember
(String fullyQualifiedPackageNameClassName, Optional<String> member, Optional<String> label) resolveReference
(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
-
Field Details
-
mojoClass
final com.thoughtworks.qdox.model.JavaClass mojoClass -
declaringClass
final com.thoughtworks.qdox.model.JavaClass declaringClass -
javaProjectBuilder
final com.thoughtworks.qdox.JavaProjectBuilder javaProjectBuilder -
mojoAnnotatedClasses
-
linkGenerator
-
lineNumber
final int lineNumber -
javaModule
-
attributes
-
-
Constructor Details
-
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 Details
-
getModuleName
- Specified by:
getModuleName
in interfaceConverterContext
- Returns:
- the module name of the container class
-
getPackageName
- Specified by:
getPackageName
in interfaceConverterContext
- Returns:
- the package name of the container class
-
getLocation
- Specified by:
getLocation
in 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
- Specified by:
isReferencedBy
in interfaceConverterContext
- Parameters:
reference
-- Returns:
- true in case either the current context class or any of its super classes are referenced
-
isClassReferencedByReference
private static boolean isClassReferencedByReference(com.thoughtworks.qdox.model.JavaClass javaClass, FullyQualifiedJavadocReference reference) -
canGetUrl
public boolean canGetUrl()- Specified by:
canGetUrl
in interfaceConverterContext
- Returns:
true
if links to javadoc pages could potentially be generated withConverterContext.getUrl(FullyQualifiedJavadocReference)
.
-
getUrl
Description copied from interface:ConverterContext
Returns a (deep-)link to the javadoc page for the given reference- Specified by:
getUrl
in interfaceConverterContext
- Parameters:
reference
- the reference for which to get the url- Returns:
- the link
-
resolveReference
Description copied from interface:ConverterContext
Resolves a given javadoc reference, according to the rules of Javadoc's search order.- Specified by:
resolveReference
in interfaceConverterContext
- Parameters:
reference
- the reference to resolve- Returns:
- the resolved fully qualified reference
-
getStaticFieldValue
Description copied from interface:ConverterContext
Returns the value of a referenced static field.- Specified by:
getStaticFieldValue
in interfaceConverterContext
- Parameters:
reference
- the code reference towards a static field- Returns:
- the value of the static field given by the
reference
-
getInternalJavadocSiteBaseUrl
Description copied from interface:ConverterContext
Returns the base url to use for internal javadoc links- Specified by:
getInternalJavadocSiteBaseUrl
in interfaceConverterContext
- Returns:
- the base url for internal javadoc links (may be
null
).
-
resolveMember
-
resolveMember
-
isExternal
private boolean isExternal(com.thoughtworks.qdox.model.JavaClass javaClass) -
isExternal
private boolean isExternal(com.thoughtworks.qdox.model.JavaPackage javaPackage) -
resolveMember
-
isClassFound
private static boolean isClassFound(com.thoughtworks.qdox.model.JavaClass javaClass) -
getParameterTypes
-
getDimensions
-
getRawTypeName
-
getMethodName
-
setAttribute
Description copied from interface:ConverterContext
Stores some attribute in the current context- Specified by:
setAttribute
in interfaceConverterContext
- Returns:
- the old attribute value or null.
-
getAttribute
Description copied from interface:ConverterContext
Retrieves some attribute value from the current context.- Specified by:
getAttribute
in interfaceConverterContext
- Returns:
- the value of the attribute with the given name or
null
if it does not exist
-