Class DubboAnnotationUtils
java.lang.Object
org.apache.dubbo.config.spring.util.DubboAnnotationUtils
Dubbo Annotation Utilities Class
- Since:
- 2.5.11
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvertParameters(String[] parameters) Resolve the parameters ofDubboServiceandDubboReferencefrom the specified.static StringresolveInterfaceName(Map<String, Object> attributes, Class<?> defaultInterfaceClass) Resolve the service interface name from @Service annotation attributes.static StringresolveInterfaceName(org.apache.dubbo.config.annotation.Reference reference, Class<?> defaultInterfaceClass) Deprecated.static StringresolveInterfaceName(org.apache.dubbo.config.annotation.Service service, Class<?> defaultInterfaceClass) Deprecated.
-
Constructor Details
-
DubboAnnotationUtils
public DubboAnnotationUtils()
-
-
Method Details
-
resolveInterfaceName
@Deprecated public static String resolveInterfaceName(org.apache.dubbo.config.annotation.Service service, Class<?> defaultInterfaceClass) throws IllegalStateException Deprecated.- Throws:
IllegalStateException
-
resolveInterfaceName
public static String resolveInterfaceName(Map<String, Object> attributes, Class<?> defaultInterfaceClass) Resolve the service interface name from @Service annotation attributes. Note: the service interface class maybe not found locally if is a generic service.- Parameters:
attributes- annotation attributes of@ServicedefaultInterfaceClass- the default class of interface- Returns:
- the interface name if found
- Throws:
IllegalStateException- if interface name was not found
-
resolveInterfaceName
@Deprecated public static String resolveInterfaceName(org.apache.dubbo.config.annotation.Reference reference, Class<?> defaultInterfaceClass) throws IllegalStateException Deprecated.- Throws:
IllegalStateException
-
convertParameters
Resolve the parameters ofDubboServiceandDubboReferencefrom the specified. It iterates elements in order.The former element plays as key or keyinvalid input: '&value' role, it would be spilt if it contains specific string, for instance, ":" and "=". As for later element can't be split in anytime.It will throw IllegalArgumentException If converted array length isn't even number. The convert cases below work in right way,which are best practice.(array->map) ["a","b"] ==> {a=b} [" a "," b "] ==> {a=b} ["a=b"] ==>{a=b} ["a:b"] ==>{a=b} ["a=b","c","d"] ==>{a=b,c=d} ["a","a:b"] ==>{a="a:b"} ["a","a,b"] ==>{a="a,b"}- Parameters:
parameters-- Returns:
-