Class DubboAnnotationUtils

java.lang.Object
org.apache.dubbo.config.spring.util.DubboAnnotationUtils

public class DubboAnnotationUtils extends Object
Dubbo Annotation Utilities Class
Since:
2.5.11
See Also:
  • AnnotationUtils
  • 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 @Service
      defaultInterfaceClass - 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

      public static Map<String,String> convertParameters(String[] parameters)
      Resolve the parameters of DubboService and DubboReference from 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: