| 限定符和类型 | 字段和说明 |
|---|---|
static boolean |
DEFAULT_BOOLEAN_ATTRIBUTE_VALUE
Default value of boolean attribute for
Annotation |
static String |
DEFAULT_CONFIG_TYPE_VALUE
Default value of
String attribute for Annotation |
static String |
DEFAULT_STRING_ATTRIBUTE_VALUE
Default value of
String attribute for Annotation |
static long |
DEFAULT_TIMEOUT
Default timeout for getting Nacos configuration
|
static String |
SEPARATOR
The separator
|
| 构造器和说明 |
|---|
NacosUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
buildDefaultPropertySourceName(String dataId,
String groupId,
Map<?,?> properties)
Build The default name of
@NacosPropertySource |
static Object |
evaluate(String value,
org.springframework.beans.factory.config.ConfigurableBeanFactory beanFactory) |
static String |
evaluate(String value,
org.springframework.core.env.Environment environment) |
static String |
getContent(com.alibaba.nacos.api.config.ConfigService configService,
String dataId,
String groupId)
Get content from
ConfigService via dataId and groupId |
static String |
identify(Map<?,?> properties)
Generate Id of
Nacos Properties |
static String |
identify(com.alibaba.nacos.api.annotation.NacosProperties nacosProperties)
Generate Id of
Nacos Properties annotation |
static boolean |
isDefault(com.alibaba.nacos.api.annotation.NacosProperties nacosProperties)
Is
@NacosProperties with default attribute values. |
protected static void |
merge(Properties targetProperties,
Properties sourceProperties)
Merge Nacos Properties If any property from target properties is absent
|
static String |
readFileExtension(String dataId) |
static Object |
readFromBeanFactory(String label,
org.springframework.beans.factory.config.ConfigurableBeanFactory beanFactory) |
static String |
readFromEnvironment(String label,
org.springframework.core.env.Environment environment) |
static <T> Class<T> |
resolveGenericType(Class<?> declaredClass) |
static String |
resolvePlaceholders(String label,
org.springframework.core.env.Environment environment) |
static Properties |
resolveProperties(Map<?,?> properties,
org.springframework.core.env.PropertyResolver propertyResolver)
Resolve placeholders of properties via specified
PropertyResolver if
present |
static Properties |
resolveProperties(Map<String,Object> attributes,
org.springframework.core.env.PropertyResolver propertyResolver,
Properties defaultProperties)
|
static Properties |
resolveProperties(com.alibaba.nacos.api.annotation.NacosProperties nacosProperties,
org.springframework.core.env.PropertyResolver propertyResolver) |
static Properties |
resolveProperties(com.alibaba.nacos.api.annotation.NacosProperties nacosProperties,
org.springframework.core.env.PropertyResolver propertyResolver,
Properties defaultProperties) |
static org.springframework.beans.PropertyValues |
resolvePropertyValues(Object bean,
String content,
String type) |
static org.springframework.beans.PropertyValues |
resolvePropertyValues(Object bean,
String prefix,
String dataId,
String groupId,
String content,
String type) |
static Map<String,Object> |
toProperties(String text) |
static Map<String,Object> |
toProperties(String text,
String type) |
static Map<String,Object> |
toProperties(String dataId,
String group,
String text) |
static Map<String,Object> |
toProperties(String dataId,
String group,
String text,
String type)
XML configuration parsing to support different schemas
|
public static final String DEFAULT_STRING_ATTRIBUTE_VALUE
String attribute for Annotationpublic static final String DEFAULT_CONFIG_TYPE_VALUE
String attribute for Annotationpublic static final boolean DEFAULT_BOOLEAN_ATTRIBUTE_VALUE
Annotationpublic static final long DEFAULT_TIMEOUT
public static String buildDefaultPropertySourceName(String dataId, String groupId, Map<?,?> properties)
@NacosPropertySourcedataId - data IdgroupId - group Idproperties - Nacos Propertiespublic static String identify(com.alibaba.nacos.api.annotation.NacosProperties nacosProperties)
Nacos Properties annotationnacosProperties - Nacos Properties annotationpublic static String identify(Map<?,?> properties)
Nacos Propertiesproperties - Nacos Propertiespublic static boolean isDefault(com.alibaba.nacos.api.annotation.NacosProperties nacosProperties)
@NacosProperties with default attribute values.nacosProperties - @NacosPropertiestrue,or falsepublic static String readFromEnvironment(String label, org.springframework.core.env.Environment environment)
public static Object readFromBeanFactory(String label, org.springframework.beans.factory.config.ConfigurableBeanFactory beanFactory)
public static String resolvePlaceholders(String label, org.springframework.core.env.Environment environment)
public static String evaluate(String value, org.springframework.core.env.Environment environment)
public static Object evaluate(String value, org.springframework.beans.factory.config.ConfigurableBeanFactory beanFactory)
public static org.springframework.beans.PropertyValues resolvePropertyValues(Object bean, String content, String type)
public static org.springframework.beans.PropertyValues resolvePropertyValues(Object bean, String prefix, String dataId, String groupId, String content, String type)
public static Properties resolveProperties(com.alibaba.nacos.api.annotation.NacosProperties nacosProperties, org.springframework.core.env.PropertyResolver propertyResolver)
public static Properties resolveProperties(com.alibaba.nacos.api.annotation.NacosProperties nacosProperties, org.springframework.core.env.PropertyResolver propertyResolver, Properties defaultProperties)
public static Properties resolveProperties(Map<String,Object> attributes, org.springframework.core.env.PropertyResolver propertyResolver, Properties defaultProperties)
Resolve placeholders of
@NacosProperties's attributes via specified
PropertyResolver if present, or try to
merge from default propertiesattributes - @NacosProperties's attributespropertyResolver - the resolver of properties' placeholderdefaultProperties - default propertiesProperties propertiesresolveProperties(Map, PropertyResolver)public static Properties resolveProperties(Map<?,?> properties, org.springframework.core.env.PropertyResolver propertyResolver)
PropertyResolver if
presentproperties - The propertiespropertyResolver - PropertyResolver instance, for instance,
EnvironmentProperties after resolving.protected static void merge(Properties targetProperties, Properties sourceProperties)
targetProperties - target PropertiessourceProperties - source Propertiespublic static String getContent(com.alibaba.nacos.api.config.ConfigService configService, String dataId, String groupId)
ConfigService via dataId and groupIdconfigService - ConfigServicedataId - dataIdgroupId - groupIdnullpublic static Map<String,Object> toProperties(String dataId, String group, String text)
Copyright © 2021. All rights reserved.