public class JavadocLinkGenerator extends Object
Modifier and Type | Class and Description |
---|---|
static class |
JavadocLinkGenerator.JavadocToolVersionRange
Javadoc tool version ranges whose generated sites expose different link formats.
|
Constructor and Description |
---|
JavadocLinkGenerator(List<URI> externalJavadocSiteUrls,
org.apache.maven.settings.Settings settings)
Constructor for online external sites only.
|
JavadocLinkGenerator(URI internalJavadocSiteUrl,
String internalJavadocVersion)
Constructor for an offline internal site only.
|
JavadocLinkGenerator(URI internalJavadocSiteUrl,
String internalJavadocVersion,
List<URI> externalJavadocSiteUrls,
org.apache.maven.settings.Settings settings)
Constructor for both an internal (offline) and external (online) sites.
|
Modifier and Type | Method and Description |
---|---|
URI |
createLink(FullyQualifiedJavadocReference javadocReference)
Generates a (deep-)link to a HTML page in any of the sites given to the constructor.
|
URI |
createLink(String binaryName)
Generates a (deep-)link to a HTML page in any of the sites given to the constructor.
|
URI |
getInternalJavadocSiteBaseUrl() |
static boolean |
isLinkValid(URI url,
Path baseDirectory)
Checks if a given link is valid.
|
public JavadocLinkGenerator(URI internalJavadocSiteUrl, String internalJavadocVersion)
internalJavadocSiteUrl
- the url of the javadoc generated websiteinternalJavadocVersion
- the version of javadoc with which the internal site from
internalJavadocSiteUrl
has been generatedpublic JavadocLinkGenerator(List<URI> externalJavadocSiteUrls, org.apache.maven.settings.Settings settings)
externalJavadocSiteUrls
- settings
- public JavadocLinkGenerator(URI internalJavadocSiteUrl, String internalJavadocVersion, List<URI> externalJavadocSiteUrls, org.apache.maven.settings.Settings settings)
internalJavadocSiteUrl
- internalJavadocVersion
- externalJavadocSiteUrls
- settings
- public URI createLink(FullyQualifiedJavadocReference javadocReference)
false
for
FullyQualifiedJavadocReference.isExternal()
.javadocReference
- IllegalArgumentException
- in case no javadoc link could be generated for the given referenceIllegalStateException
- in case no javadoc source sites have been configuredpublic URI createLink(String binaryName)
binaryName
- a binary name according to
JLS 13.1IllegalArgumentException
- in case no javadoc link could be generated for the given namepublic URI getInternalJavadocSiteBaseUrl()
public static boolean isLinkValid(URI url, Path baseDirectory)
HttpURLConnection
,
otherwise checks for existence of the file on the filesystem.url
- the url to checkbaseDirectory
- the base directory to which relative file URLs refertrue
in case the given link is valid otherwise false
Copyright © 2004–2024 The Apache Software Foundation. All rights reserved.