Class NacosXmlPropertySourceLoader

java.lang.Object
com.alibaba.cloud.nacos.parser.AbstractPropertySourceLoader
com.alibaba.cloud.nacos.parser.NacosXmlPropertySourceLoader
All Implemented Interfaces:
org.springframework.boot.env.PropertySourceLoader, org.springframework.core.Ordered

public class NacosXmlPropertySourceLoader extends AbstractPropertySourceLoader implements org.springframework.core.Ordered
Parsing for XML requires overwriting the default PropertiesPropertySourceLoader, because it internally rigorously validates (DOCTYPE) THE XML in a way that makes it difficult to customize the configuration; at finally, make sure it's in the first place.
Author:
zkz
  • Constructor Details

    • NacosXmlPropertySourceLoader

      public NacosXmlPropertySourceLoader()
  • Method Details

    • getOrder

      public int getOrder()
      Get the order value of this object.

      Higher values are interpreted as lower priority. As a consequence, the object with the lowest value has the highest priority (somewhat analogous to Servlet load-on-startup values).

      Same order values will result in arbitrary sort positions for the affected objects.

      Specified by:
      getOrder in interface org.springframework.core.Ordered
      Returns:
      the order value
      See Also:
      • Ordered.HIGHEST_PRECEDENCE
      • Ordered.LOWEST_PRECEDENCE
    • getFileExtensions

      public String[] getFileExtensions()
      Returns the file extensions that the loader supports (excluding the '.').
      Specified by:
      getFileExtensions in interface org.springframework.boot.env.PropertySourceLoader
      Returns:
      the file extensions
    • doLoad

      protected List<org.springframework.core.env.PropertySource<?>> doLoad(String name, org.springframework.core.io.Resource resource) throws IOException
      Load the resource into one or more property sources. Implementations may either return a list containing a single source, or in the case of a multi-document format such as yaml a source for each document in the resource.
      Specified by:
      doLoad in class AbstractPropertySourceLoader
      Parameters:
      name - the root name of the property source. If multiple documents are loaded an additional suffix should be added to the name for each source loaded.
      resource - the resource to load
      Returns:
      a list property sources
      Throws:
      IOException - if the source cannot be loaded