Class CacheDefaultsPreprocessor

    • Constructor Detail

      • CacheDefaultsPreprocessor

        public CacheDefaultsPreprocessor​(String sDefaultsParentPath)
        Constructs a CacheDefaultsPreprocessor with a specific path to where default element content can be located.

        Example: new DefaultPreprocessor("/defaults");

        Parameters:
        sDefaultsParentPath - the absolute path to the XmlElement that contains (is the parent of) the default elements
    • Method Detail

      • addDefaultDefinition

        public void addDefaultDefinition​(String sRequiredElementParentPath,
                                         String sRequiredElementName)
        Adds a requirement that the specified "default" element must be added to (if not already defined) in the element specified by the defined parent path.

        Paths used by this method are based those defined by the XmlHelper.findElement(XmlElement, String) method, with the exception that ".." is not supported.

        For example 1: The following call specifies that the "serializer" should be cloned from the defined default path if it doesn't exist in the "/caching-schemes/distributed-scheme" element.

        addDefaultDefinition("/caching-schemes/distributed-scheme", "serializer");

        For example 2: The following call specifies that the "serializer" should be cloned from the defined default path if it doesn't exist in any "distributed-scheme" elements

        addDefaultDefinition("distributed-scheme", "serializer");

        Parameters:
        sRequiredElementParentPath - the path of the parent for the required element
        sRequiredElementName - the name of the element that should be cloned (if it doesn't exist in the specified parent path) from the defined default element path