类 AbstractPropertySourceLoader

java.lang.Object
com.alibaba.cloud.nacos.parser.AbstractPropertySourceLoader
所有已实现的接口:
org.springframework.boot.env.PropertySourceLoader
直接已知子类:
NacosJsonPropertySourceLoader, NacosXmlPropertySourceLoader

public abstract class AbstractPropertySourceLoader extends Object implements org.springframework.boot.env.PropertySourceLoader
Nacos-specific loader, If need to support other methods of parsing,you need to do the following steps:

1.inherit AbstractPropertySourceLoader;
2. define the filespring.factories and append org.springframework.boot.env.PropertySourceLoader=..;
3.the last step validate.

Notice the use of NacosByteArrayResource .
作者:
zkz
  • 构造器概要

    构造器
    构造器
    说明
     
  • 方法概要

    修饰符和类型
    方法
    说明
    protected boolean
    canLoad(String name, org.springframework.core.io.Resource resource)
    Prevent interference with other loaders.Nacos-specific loader, unless the reload changes it.
    protected abstract List<org.springframework.core.env.PropertySource<?>>
    doLoad(String name, org.springframework.core.io.Resource resource)
    Load the resource into one or more property sources.
    protected void
    flattenedMap(Map<String,Object> result, Map<String,Object> dataMap, String parentKey)
     
    List<org.springframework.core.env.PropertySource<?>>
    load(String name, org.springframework.core.io.Resource resource)
    Load the resource into one or more property sources.

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    从接口继承的方法 org.springframework.boot.env.PropertySourceLoader

    getFileExtensions
  • 构造器详细资料

    • AbstractPropertySourceLoader

      public AbstractPropertySourceLoader()
  • 方法详细资料

    • canLoad

      protected boolean canLoad(String name, org.springframework.core.io.Resource resource)
      Prevent interference with other loaders.Nacos-specific loader, unless the reload changes it.
      参数:
      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
      返回:
      if the resource can be loaded
    • load

      public List<org.springframework.core.env.PropertySource<?>> load(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.
      指定者:
      load 在接口中 org.springframework.boot.env.PropertySourceLoader
      参数:
      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
      返回:
      a list property sources
      抛出:
      IOException - if the source cannot be loaded
    • doLoad

      protected abstract 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.
      参数:
      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
      返回:
      a list property sources
      抛出:
      IOException - if the source cannot be loaded
    • flattenedMap

      protected void flattenedMap(Map<String,Object> result, Map<String,Object> dataMap, String parentKey)