当前位置: 首页>>代码示例>>Java>>正文


Java ETypedElement.UNSPECIFIED_MULTIPLICITY属性代码示例

本文整理汇总了Java中org.eclipse.emf.ecore.ETypedElement.UNSPECIFIED_MULTIPLICITY属性的典型用法代码示例。如果您正苦于以下问题:Java ETypedElement.UNSPECIFIED_MULTIPLICITY属性的具体用法?Java ETypedElement.UNSPECIFIED_MULTIPLICITY怎么用?Java ETypedElement.UNSPECIFIED_MULTIPLICITY使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.eclipse.emf.ecore.ETypedElement的用法示例。


在下文中一共展示了ETypedElement.UNSPECIFIED_MULTIPLICITY属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: shouldUnset

protected boolean shouldUnset(EStructuralFeature feature, Object value)
{
  // If the feature is unsettable, then regardless of the value, we should not be unsetting the feature.
  //
  if (feature.isUnsettable())
  {
    return false;
  }
  // If it's not an open content element, unset the feature if the value is the same as the default value.
  //
  else if (feature.getUpperBound() != ETypedElement.UNSPECIFIED_MULTIPLICITY)
  {
    Object defaultValue = feature.getDefaultValue();
    return defaultValue == null ? value == null : defaultValue.equals(value);
  }
  // If this is a feature of the document root itself, unset if the value is null.
  // If it was a nillable element, it would have been unsettable.
  //
  else if (feature.getEContainingClass() == owner.eClass())
  {
    return value == null;
  }
  // Otherwise, return false.
  //
  else
  {
    return false;
  }
}
 
开发者ID:LangleyStudios,项目名称:eclipse-avro,代码行数:29,代码来源:BasicFeatureMap.java

示例2: shouldUnset

protected boolean shouldUnset(EStructuralFeature feature, Object value)
{
  if (feature.getUpperBound() != ETypedElement.UNSPECIFIED_MULTIPLICITY && !feature.isUnsettable())
  {
    Object defaultValue = feature.getDefaultValue();
    return defaultValue == null ? value == null : defaultValue.equals(value);
  }
  else
  {
    return false;
  }
}
 
开发者ID:LangleyStudios,项目名称:eclipse-avro,代码行数:12,代码来源:DelegatingFeatureMap.java

示例3: isMany

public static boolean isMany(EObject owner, EStructuralFeature feature)
{
  if (feature.isMany())
  {
    return true;
  }
  else if (feature.getUpperBound() == ETypedElement.UNSPECIFIED_MULTIPLICITY)
  {
    if (feature == XMLTypeFeatures.TEXT ||
          feature == XMLTypeFeatures.CDATA ||
          feature == XMLTypeFeatures.COMMENT ||
          feature == XMLTypeFeatures.PROCESSING_INSTRUCTION)
    {
      return true;
    }
    else
    {
      EClass eClass = owner.eClass();
      if (eClass.getFeatureID(feature) >= 0)
      {
        return false;
      }
      else
      {
        EStructuralFeature affiliation = ExtendedMetaData.INSTANCE.getAffiliation(eClass, feature);
        if (affiliation == null)
        {
          return true;
        }
        else
        {
          int affiliationUpperBound = affiliation.getUpperBound();
          return 
            (affiliationUpperBound > 1 || affiliationUpperBound == ETypedElement.UNBOUNDED_MULTIPLICITY) && 
              ExtendedMetaData.INSTANCE.getFeatureKind(affiliation) != ExtendedMetaData.ATTRIBUTE_WILDCARD_FEATURE;
        }
      }
    }
  }
  else
  {
    return false;
  }
}
 
开发者ID:LangleyStudios,项目名称:eclipse-avro,代码行数:44,代码来源:FeatureMapUtil.java


注:本文中的org.eclipse.emf.ecore.ETypedElement.UNSPECIFIED_MULTIPLICITY属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。