| Modifier and Type | Field and Description |
|---|---|
static boolean |
DEFAULT_BOOLEAN_ATTRIBUTE_VALUE
Default value of boolean 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
|
| Constructor and Description |
|---|
NacosUtils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
buildDefaultPropertySourceName(String dataId,
String groupId,
Map<?,?> properties)
Build The default name of
@NacosPropertySource |
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 <T> Class<T> |
resolveGenericType(Class<?> declaredClass) |
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 Properties |
toProperties(String text) |
public static final String DEFAULT_STRING_ATTRIBUTE_VALUE
String attribute for Annotationpublic static final boolean DEFAULT_BOOLEAN_ATTRIBUTE_VALUE
Annotationpublic static final String SEPARATOR
public 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 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 Properties toProperties(String text)
Copyright © 2018. All rights reserved.