You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2021/07/29 01:51:45 UTC

[GitHub] [dubbo] xul0038 commented on issue #5122: 关于启动时MapTypeBuilder写死判断参数长度为2的问题

xul0038 commented on issue #5122:
URL: https://github.com/apache/dubbo/issues/5122#issuecomment-888736584


   1.创建自定义TypeBuilder
   ```
   package com.xxx.dubbo.TreeBuilder;
   
   public class TreeBuilder implements TypeBuilder , Prioritized {
   
       @Override
       public boolean accept(Type type, Class<?> clazz) {
           if (clazz == null) {
               return false;
           }
           return Tree.class.isAssignableFrom(clazz);
       }
   
       @Override
       public int getPriority() {
           return -1;
       }
   
       @Override
       public TypeDefinition build(Type type, Class<?> clazz, Map<Class<?>, TypeDefinition> typeCache) {
           // balabala...
       }
   }
   ```
   2. `META-INF`下创建`dubbo/internal/org.apache.dubbo.metadata.definition.builder.TypeBuilder`文件
   ```
   tree=com.xxx.dubbo.TreeBuilder
   ```
   #6306


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org