EcoreUtil.java 文件源码

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

项目:eclipse-avro 作者:
/**
 * Sets or removes the annotation on the given operation to prevent generation of a method declaration in its interface.
 * @param eOperation the operation.
 * @param suppress whether the visibility should be suppressed
 * @since 2.4
 */
public static void setSuppressedVisibility(EOperation eOperation, boolean suppress)
{
  EAnnotation eAnnotation = eOperation.getEAnnotation(GEN_MODEL_PACKAGE_NS_URI);
  if (!suppress)
  {
    if (eAnnotation != null)
    {
      eAnnotation.getDetails().removeKey(OPERATION_VISIBILITY_KEY);
    }
  }
  else
  {
    if (eAnnotation == null)
    {
      eAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
      eAnnotation.setSource(GEN_MODEL_PACKAGE_NS_URI);
      eOperation.getEAnnotations().add(eAnnotation);
    }
    eAnnotation.getDetails().put(OPERATION_VISIBILITY_KEY, TRUE);
  }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号