public URI getUrl()

in maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/converter/JavaClassConverterContext.java [156:184]


    public URI getUrl(FullyQualifiedJavadocReference reference) {
        try {
            if (isReferencedBy(reference)
                    && MemberType.FIELD == reference.getMemberType().orElse(null)) {
                // link to current goal's parameters
                return new URI(null, null, reference.getMember().orElse(null)); // just an anchor if same context
            }
            Optional<String> fqClassName = reference.getFullyQualifiedClassName();
            if (fqClassName.isPresent()) {
                MojoAnnotatedClass mojoAnnotatedClass = mojoAnnotatedClasses.get(fqClassName.get());
                if (mojoAnnotatedClass != null
                        && mojoAnnotatedClass.getMojo() != null
                        && (!reference.getLabel().isPresent()
                                || MemberType.FIELD == reference.getMemberType().orElse(null))) {
                    // link to other mojo (only for fields = parameters or without member)
                    return new URI(
                            null,
                            "./" + mojoAnnotatedClass.getMojo().name() + "-mojo.html",
                            reference.getMember().orElse(null));
                }
            }
        } catch (URISyntaxException e) {
            throw new IllegalStateException("Error constructing a valid URL", e); // should not happen
        }
        if (linkGenerator == null) {
            throw new IllegalStateException("No Javadoc Sites given to create URLs to");
        }
        return linkGenerator.createLink(reference);
    }