public static void checkNoFeatureMap(EStructuralFeature feature) { if (FeatureMapUtil.isFeatureMap(feature)) { throw new UnsupportedOperationException("Single-valued feature maps not yet handled"); } }
protected boolean isMany(EStructuralFeature feature) { return FeatureMapUtil.isMany(owner, feature); }
public void add(int index, EStructuralFeature feature, Object value) { add(index, isFeatureMap(feature) ? value : createEntry(feature, value)); }
public BasicFeatureEIterator(EStructuralFeature eStructuralFeature, FeatureMap.Internal featureMap) { this.eStructuralFeature = eStructuralFeature; this.featureMap = featureMap; expectedModCount = featureMap.getModCount(); isFeatureMap = isFeatureMap(eStructuralFeature); validator = getValidator(featureMap.getEObject().eClass(), eStructuralFeature); }
if (FeatureMapUtil.isFeatureMap(feature) && value instanceof String) { FeatureMap featureMap = (FeatureMap) target.eGet(feature); FeatureMapUtil.addText(featureMap, (String) value); } else { if (feature instanceof EAttribute) {
protected FeatureMap.Entry createEntry(EStructuralFeature eStructuralFeature, Object value) { return FeatureMapUtil.createEntry(eStructuralFeature, value); }
if (FeatureMapUtil.isFeatureMapEntry(dataType)) { throw new UnsupportedOperationException("FeatureMaps are not supported yet: Use standard EMF to import your model");
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated NOT */ public static void addText(StrucDocText strucDocText, String text) { if (text == null) { throw new IllegalArgumentException("text is null"); } FeatureMapUtil.addText(strucDocText.getMixed(), text); }
protected Object getConfigurationData ( final HiveConfigurationType configuration ) { for ( FeatureMap.Entry entry : configuration.getAny () ) { if ( entry.getValue () instanceof EObject ) { return entry.getValue (); } else if ( FeatureMapUtil.isText ( entry ) ) { return entry.getValue (); } else if ( FeatureMapUtil.isCDATA ( entry ) ) { return entry.getValue (); } } return null; }
private static String getText(FeatureMap featureMap) { StringBuffer buffer = new StringBuffer(""); for (FeatureMap.Entry entry : featureMap) { if (FeatureMapUtil.isText(entry)) { buffer.append(entry.getValue().toString()); } } return buffer.toString(); } } // StrucDocTextOperations
public BasicFeatureEIterator(EStructuralFeature eStructuralFeature, FeatureMap.Internal featureMap) { this.eStructuralFeature = eStructuralFeature; this.featureMap = featureMap; expectedModCount = featureMap.getModCount(); isFeatureMap = isFeatureMap(eStructuralFeature); validator = getValidator(featureMap.getEObject().eClass(), eStructuralFeature); }
protected FeatureMap.Entry createEntry(EStructuralFeature eStructuralFeature, Object value) { return FeatureMapUtil.createEntry(eStructuralFeature, value); }
/** * {@inheritDoc} * <p> * Converts an instance of the {@code attribute} to a string literal representation. * * @param value the value of the attribute * @param attribute the attribute to instantiate * * @return the string literal representation of the value, or {@code null} if the {@code value} is {@code null} * * @see #revert(Object, EAttribute) * @see EcoreUtil#convertToString(EDataType, Object) */ @Override public Object convert(@Nullable String value, EAttribute attribute) { if (isNull(value)) { return null; } final EDataType dataType = attribute.getEAttributeType(); if (!(dataType instanceof EEnum) && Primitives.isPrimitiveOrString(dataType.getInstanceClass())) { return EcoreUtil.createFromString(dataType, value); } if (FeatureMapUtil.isFeatureMapEntry(dataType)) { throw new UnsupportedOperationException("FeatureMaps are not supported yet: Use standard EMF to import your model"); } return value; }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated NOT */ public static ED addText(ED ed, String text) { if (text == null) { throw new IllegalArgumentException("text is null"); } FeatureMapUtil.addText(ed.getMixed(), text); return ed; }
protected Object getConfigurationData ( final HiveConfigurationType configuration ) { for ( FeatureMap.Entry entry : configuration.getAny () ) { if ( entry.getValue () instanceof EObject ) { return entry.getValue (); } else if ( FeatureMapUtil.isText ( entry ) ) { return entry.getValue (); } else if ( FeatureMapUtil.isCDATA ( entry ) ) { return entry.getValue (); } } return null; }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated NOT */ public static String getText(EN en) { StringBuffer text = new StringBuffer(""); for (FeatureMap.Entry entry : en.getMixed()) { if (FeatureMapUtil.isText(entry)) { text.append(entry.getValue().toString()); } } return text.toString(); }
/** * Ensures that the {@code eFeature} is not a {@link org.eclipse.emf.ecore.util.FeatureMap}. They are not supported * yet. * * @param eFeature the EMF feature to test * * @throws UnsupportedOperationException if the feature is a feature map */ private void checkFeatureMap(EStructuralFeature eFeature) { if (FeatureMapUtil.isFeatureMap(eFeature)) { throw new UnsupportedOperationException("FeatureMaps are not supported yet: Use standard EMF to export your model"); } } }
public void add(int index, EStructuralFeature feature, Object value) { add(index, isFeatureMap(feature) ? value : createEntry(feature, value)); }
public boolean retainAll(EStructuralFeature feature, Collection<?> collection) { boolean isFeatureMap = FeatureMapUtil.isFeatureMap(feature); FeatureMapUtil.Validator validator = FeatureMapUtil.getValidator(owner.eClass(), feature); List<Entry> entryCollection = new BasicEList<Entry>(collection.size()); Entry [] entries = (Entry[])data; for (int i = size; --i >= 0; ) { Entry entry = entries[i]; if (validator.isValid(entry.getEStructuralFeature())) { if (!collection.contains(isFeatureMap ? entry : entry.getValue())) { entryCollection.add(entry); } } } return removeAll(entryCollection); }
protected boolean isMany(EStructuralFeature feature) { return FeatureMapUtil.isMany(owner, feature); }