本文整理汇总了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;
}
}
示例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;
}
}
示例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;
}
}