类 DubboAnnotationUtils


  • public class DubboAnnotationUtils
    extends Object
    Dubbo Annotation Utilities Class
    从以下版本开始:
    2.5.11
    另请参阅:
    AnnotationUtils
    • 构造器详细资料

      • DubboAnnotationUtils

        public DubboAnnotationUtils()
    • 方法详细资料

      • resolveInterfaceName

        public static String resolveInterfaceName​(org.springframework.core.annotation.AnnotationAttributes attributes,
                                                  Class<?> defaultInterfaceClass)
        Resolve the interface name from AnnotationAttributes
        参数:
        attributes - AnnotationAttributes instance, may be @Service or @Reference
        defaultInterfaceClass - the default class of interface
        返回:
        the interface name if found
        抛出:
        IllegalStateException - if interface name was not found
      • resolveServiceInterfaceClass

        public static Class<?> resolveServiceInterfaceClass​(org.springframework.core.annotation.AnnotationAttributes attributes,
                                                            Class<?> defaultInterfaceClass)
                                                     throws IllegalArgumentException
        Resolve the class of Dubbo Service interface from the specified annotation attributes and annotated class.
        参数:
        attributes - annotation attributes
        defaultInterfaceClass - the annotated class.
        返回:
        the class of Dubbo Service interface
        抛出:
        IllegalArgumentException - if can't resolved
      • convertParameters

        public static Map<String,​String> convertParameters​(String[] parameters)
        Resolve the parameters of DubboService and DubboReference from the specified. It iterate elements in order.The former element plays as key or key&value role, it would be spilt if it contain 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}

        参数:
        parameters -
        返回: