JSR362ConfigurationProcessor.java 文件源码

java
阅读 20 收藏 0 点赞 0 评论 0

项目:portals-pluto 作者:
/**
 * Processes PortletPreferencesValidator annotated classes. The preferences validators are temorarily stored while
 * the portlet configuration annotations are being processed.
 * 
 * @param cls
 *           The annotated class
 */
@Override
public void processValidatorAnnotation(Class<?> cls) {

   PortletPreferencesValidator vali = cls.getAnnotation(PortletPreferencesValidator.class);
   if (vali != null) {

      if (!PreferencesValidator.class.isAssignableFrom(cls)) {
         StringBuilder txt = new StringBuilder(128);
         txt.append("@PortletPreferencesValidator annotated class must implement PreferencesValidator interface. ");
         txt.append(", class: ").append(cls.getCanonicalName());
         LOG.warn(txt.toString());
         throw new IllegalArgumentException(txt.toString());
      }

      String clsName = cls.getCanonicalName();
      prefValidators.put(vali, clsName);
   }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号