You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/**
* get IDL content from class.
*
* @param cls target class to parse for IDL message.
* @param cachedTypes if type already in set will not generate IDL. if a new type found will add to set
* @param cachedEnumTypes if enum already in set will not generate IDL. if a new enum found will add to set
* @return protobuf IDL content in string
* @see Protobuf
*/
public static String getIDL(final Class<?> cls, final Set<Class<?>> cachedTypes,
final Set<Class<?>> cachedEnumTypes) {
ProtobufIDLGenerator目前只有getIDL(Class cls)一个public方法,我们还是需要一个这样的方法: getIDL(Class cls,Set<Class> cachedTypes,Set> cachedEnumTypes) 因为有这个方法的话,就可以避免重复生成同一个类的idl;比如A类引用了B类,C类也引用了B类,当生成A的idl后其实已经生成了B的idl,再调用getIDL(Class cls)传入C的时候,又一次生成B, 所以把两个cache作为参数传入还是有意义的。我目前是在我们的项目里修改这个ProtobufIDLGenerator并提供这个getIDL(Class cls,Set<Class> cachedTypes,Set> cachedEnumTypes) 方法的。
The text was updated successfully, but these errors were encountered: