Class DiffPluginImpl

  • All Implemented Interfaces:
    Differ

    public class DiffPluginImpl
    extends java.lang.Object
    implements Differ
    This Diff Plugin Implementation will compare JARs for their API (based on the Bundle Class Path and exported packages), the Manifest, and the resources. The differences are represented in a Diff tree.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) static java.util.Set<java.lang.String> IGNORE_HEADERS
      Headers that are considered not major enough to be considered
      (package private) Instructions localIgnore  
      (package private) static java.util.Set<java.lang.String> MAJOR_HEADERS
      Headers that are considered major enough to parse according to spec and compare their constituents
      (package private) static java.util.regex.Pattern META_INF_P
      Create an element representing all resources in the JAR
      (package private) static java.util.Set<java.lang.String> ORDERED_HEADERS
      Headers that have values that should be sorted
    • Constructor Summary

      Constructors 
      Constructor Description
      DiffPluginImpl()  
    • Field Detail

      • MAJOR_HEADERS

        static final java.util.Set<java.lang.String> MAJOR_HEADERS
        Headers that are considered major enough to parse according to spec and compare their constituents
      • IGNORE_HEADERS

        static final java.util.Set<java.lang.String> IGNORE_HEADERS
        Headers that are considered not major enough to be considered
      • ORDERED_HEADERS

        static final java.util.Set<java.lang.String> ORDERED_HEADERS
        Headers that have values that should be sorted
      • META_INF_P

        static java.util.regex.Pattern META_INF_P
        Create an element representing all resources in the JAR
    • Constructor Detail

      • DiffPluginImpl

        public DiffPluginImpl()
    • Method Detail

      • tree

        public Tree tree​(Analyzer newer)
                  throws java.lang.Exception
        Specified by:
        tree in interface Differ
        Throws:
        java.lang.Exception
      • bundleElement

        private Element bundleElement​(Analyzer analyzer)
                               throws java.lang.Exception
        Create an element representing a bundle from the Jar.
        Parameters:
        infos -
        jar - The Jar to be analyzed
        Returns:
        the elements that should be compared
        Throws:
        java.lang.Exception
      • resourcesElement

        private Element resourcesElement​(Analyzer analyzer)
                                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • hasSource

        private boolean hasSource​(Analyzer analyzer,
                                  java.lang.String path)
                           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • manifestElement

        private Element manifestElement​(java.util.jar.Manifest manifest)
        Create an element for each manifest header. There are IGNORE_HEADERS and MAJOR_HEADERS that will be treated differently.
        Parameters:
        manifest -
        Returns:
        the created Element
      • deserialize

        public Tree deserialize​(Tree.Data data)
                         throws java.lang.Exception
        Specified by:
        deserialize in interface Differ
        Throws:
        java.lang.Exception
      • setIgnore

        public void setIgnore​(java.lang.String diffignore)