Class WebXmlMerger

    • Constructor Detail

      • WebXmlMerger

        public WebXmlMerger()
        Constructor.
      • WebXmlMerger

        public WebXmlMerger​(Descriptor base)
        Constructor.
        Parameters:
        base - Descriptor to use
    • Method Detail

      • init

        public void init​(Descriptor base)
        Initialise the merger with the base (first) item to be merged.
        Specified by:
        init in interface DescriptorMerger
        Overrides:
        init in class XmlMerger
        Parameters:
        base - Descriptor to use
      • setMergeStrategy

        public void setMergeStrategy​(String tag,
                                     MergeStrategy strategy)
        Set the merging strategy for a particular tag.
        Parameters:
        tag - Tag to set
        strategy - Strategy to use
      • getResult

        public WebXml getResult()
        Retrieves merged descriptor.
        Returns:
        WebXml object
      • getVendorWebAppDescriptor

        protected VendorWebAppDescriptor getVendorWebAppDescriptor​(WebXml theWebXml,
                                                                   Class clazz)
        Get the vendor web app descriptor out of the web xml.
        Parameters:
        theWebXml - in the web xml
        clazz - the class of vendor descriptor
        Returns:
        the VendorWebAppDescriptor, or null if it does not exist in theWebXml
      • checkServletVersions

        protected final void checkServletVersions​(WebXml theWebXml)
        Checks the versions of the servlet API in each descriptor, and logs a warning if a mismatch might result in the loss of definitions.
        Parameters:
        theWebXml - The descriptor that will be merged with the original
      • mergeFilters

        protected final void mergeFilters​(WebXml theWebXml)
        Merges the servlet definitions from the specified descriptor into the original descriptor.
        Parameters:
        theWebXml - The descriptor that contains the filter definitions that are to be merged into the original descriptor
      • mergeServlets

        protected final void mergeServlets​(WebXml theWebXml)
                                    throws CargoException
        Merges the servlet definitions from the specified descriptor into the original descriptor.
        Parameters:
        theWebXml - The descriptor that contains the servlet definitions that are to be merged into the original descriptor
        Throws:
        CargoException - if there is any merge problem
      • mergeSecurityRoles

        protected final void mergeSecurityRoles​(WebXml theWebXml)
        Merges the security roles from the provided descriptor into the original descriptor.
        Parameters:
        theWebXml - The descriptor that contains the security roles that are to be merged into the original descriptor
      • mergeMimeMappings

        protected final void mergeMimeMappings​(WebXml theWebXml)
        Merges the servlet definitions from the specified descriptor into the original descriptor.
        Parameters:
        theWebXml - The descriptor that contains the filter definitions that are to be merged into the original descriptor