EcoreUtil.java 文件源码

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

项目:eclipse-avro 作者:
public static void setAnnotation(EModelElement eModelElement, String sourceURI, String key, String value)
{
  EAnnotation eAnnotation = eModelElement.getEAnnotation(sourceURI);
  if (value == null)
  {
    if (eAnnotation != null)
    {
      eAnnotation.getDetails().removeKey(key);
    }
  }
  else 
  {
    if (eAnnotation == null)
    {
      eAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
      eAnnotation.setSource(sourceURI);
      eModelElement.getEAnnotations().add(eAnnotation);
    }
    eAnnotation.getDetails().put(key, value);
  }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号