Package org.revapi

Interface ApiAnalyzer<E extends Element<E>>

  • Type Parameters:
    E - the base type of elements analyzed by this analyzer
    All Superinterfaces:
    AutoCloseable, Configurable
    All Known Implementing Classes:

    public interface ApiAnalyzer<E extends Element<E>>
    extends AutoCloseable, Configurable
    An API analyzer is the main interface one has to implement to support checking some kind of API.

    The API analyzer is a kind of "hub" that, once configured, produces archive analyzers to crack open the API archives and generate an element tree from them. Later on during the analysis the API analyzer is asked to create a difference analyzer that will be responsible to check pairs of comparable elements, each coming from the different version of the API.

    The AutoCloseable.close() is not called if there is no prior call to Configurable.initialize(AnalysisContext). Do all your resource acquisition in initialize, not during the construction of the object.

    Lukas Krejci
    • Method Detail

      • getArchiveAnalyzer

        ArchiveAnalyzer<E> getArchiveAnalyzer​(API api)
        This method is called exactly twice during the API difference analysis. The first time it is called to obtain an archive analyzer for the old version of the archives and the second time for the new version of the archives.
        api - the api to analyze
        the analyzer for the supplied archives
      • getDifferenceAnalyzer

        DifferenceAnalyzer<E> getDifferenceAnalyzer​(ArchiveAnalyzer<E> oldArchive,
                                                    ArchiveAnalyzer<E> newArchive)
        This method is called exactly once during the API difference analysis and produces an element analyzer which will be used to compare the corresponding elements in the old and new archives.
        oldArchive - the analyzer used for the old archives
        newArchive - the analyzer used for the new archives
        an element analyzer
      • getCorrespondenceDeducer

        CorrespondenceComparatorDeducer<E> getCorrespondenceDeducer()
        The correspondence sorter to use when finalizing the comparison order of the elements in the element forest.
        the correspondence sorter, never null