public void prepare()

in src/main/java/org/apache/tomee/website/LearningLinks.java [80:107]


    public void prepare(final Source source) {
        final Map<String, JavadocSource> sources = getJavadocSources(source.stream());

        final List<Example> examples = sort(this.examples.getExamples());

        for (final Example example : examples) {
            final List<String> apisUsed = getImports(example).stream()
                    .filter(sources::containsKey)
                    .collect(Collectors.toList());

            // If the example does not use any of the APIs from
            // this Source instance (e.g Jakarta EE, MicroProfile, etc)
            // then there is nothing to do.
            if (apisUsed.size() == 0) continue;

            // Add @see link to Javadoc
            for (final String api : apisUsed) {
                addSeeLink(sources.get(api), example);
            }

            // Don't add any links if the source format is markdown
            if (!example.getSrcReadme().getName().endsWith(".adoc")) continue;

            // Add APIs Used links to Example
            addApisUsed(example, apisUsed, sources, source);

        }
    }