congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
EStructuralFeature.getDefaultValue
Code IndexAdd Tabnine to your IDE (free)

How to use
getDefaultValue
method
in
org.eclipse.emf.ecore.EStructuralFeature

Best Java code snippets using org.eclipse.emf.ecore.EStructuralFeature.getDefaultValue (Showing top 20 results out of 315)

origin: opensourceBIM/BIMserver

private boolean useUnsetBit(EStructuralFeature feature) {
  // TODO non-unsettable boolean values can also be stored in these bits
  if (feature.isUnsettable()) {
    return true;
  } else {
    if (feature.isMany()) {
      return true;
    }
    if (feature.getDefaultValue() == null || (feature.getDefaultValue() != null && feature.getDefaultValue() == null)) {
      return true;
    }
  }
  return false;
}
 
origin: opensourceBIM/BIMserver

private boolean useUnsetBit(EStructuralFeature feature) {
  // TODO non-unsettable boolean values can also be stored in these bits
  Object value = eGet(feature);
  if (feature.isUnsettable()) {
    if (!eIsSet(feature)) {
      return true;
    }
  } else {
    if (feature.isMany() && (value == null || ((List<?>)value).isEmpty())) {
      return true;
    }
    if (feature.getDefaultValue() == value || (feature.getDefaultValue() != null && feature.getDefaultValue().equals(value))) {
      return true;
    }
  }
  return false;
}
origin: opensourceBIM/BIMserver

private boolean useUnsetBit(EStructuralFeature feature, IdEObject object) {
  // TODO non-unsettable boolean values can also be stored in these bits
  Object value = object.eGet(feature);
  if (feature.isUnsettable()) {
    if (!object.eIsSet(feature)) {
      return true;
    }
    if (feature.isMany() && ((List<?>)value).isEmpty()) {
      return true;
    }
  } else {
    if (feature.isMany() && ((List<?>)value).isEmpty()) {
      return true;
    }
    if (feature.getDefaultValue() == value || (feature.getDefaultValue() != null && feature.getDefaultValue().equals(value))) {
      return true;
    }
  }
  return false;
}

origin: org.eclipse.emf.cdo.server/db

protected Object getDefaultValue()
{
 return feature.getDefaultValue();
}
origin: opensourceBIM/BIMserver

} else if (feature.isMany()) {
} else if (feature.getDefaultValue() != null) {
  idEObject.setAttribute(feature, feature.getDefaultValue());
origin: opensourceBIM/BIMserver

} else if (feature.isMany()) {
} else if (feature.getDefaultValue() != null) {
  idEObject.eSet(feature, feature.getDefaultValue());
origin: org.eclipse.emf/org.eclipse.emf.ecore

@Override
protected Object getFeatureDefaultValue()
{
 Object feature = getFeature();
 if (feature instanceof EStructuralFeature)
 {
  return ((EStructuralFeature)feature).getDefaultValue();
 }
 return null;
}
origin: at.bestsolution.efxclipse.eclipse/org.eclipse.emf.ecore

@Override
protected Object getFeatureDefaultValue()
{
 Object feature = getFeature();
 if (feature instanceof EStructuralFeature)
 {
  return ((EStructuralFeature)feature).getDefaultValue();
 }
 return null;
}
origin: org.eclipse.emf.cdo.server/mongodb

public Object getMongoDefaultValue(EStructuralFeature feature)
{
 Object defaultValue = feature.getDefaultValue();
 return toMongo(defaultValue);
}
origin: org.eclipse.emf/org.eclipse.emf.ecore

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;
 }
}
origin: at.bestsolution.efxclipse.eclipse/org.eclipse.emf.ecore

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;
 }
}
origin: org.eclipse/xtext

protected boolean defaultValueIsSerializeable(EStructuralFeature feature) {
  if (feature instanceof EAttribute) {
    if (feature.getEType() == EcorePackage.eINSTANCE.getEString() && feature.getDefaultValue() == null)
      return false;
    return true;
  }
  return false;
}
origin: org.eclipse.emf.cdo.server/mongodb

 @Override
 public Object getMongoDefaultValue(EStructuralFeature feature)
 {
  Object defaultValue = feature.getDefaultValue();
  EClassifier eType = feature.getEType();
  EFactory factory = eType.getEPackage().getEFactoryInstance();
  return factory.convertToString((EDataType)eType, defaultValue);
 }
});
origin: com.b2international.snowowl/org.eclipse.emf.cdo

 public void unset(InternalEObject eObject, EStructuralFeature feature)
 {
  Object[] settings = ((CDOObjectImpl)eObject).cdoBasicSettings();
  if (settings == null)
  {
   // Is already unset
   return;
  }
  int dynamicFeatureID = eDynamicFeatureID(eObject, feature);
  if (feature.isUnsettable())
  {
   settings[dynamicFeatureID] = null;
  }
  else
  {
   settings[dynamicFeatureID] = feature.getDefaultValue();
  }
 }
}
origin: org.eclipse.emf/cdo

public boolean isSet(InternalEObject eObject, EStructuralFeature feature)
{
 if (!feature.isUnsettable())
 {
  if (feature.isMany())
  {
   @SuppressWarnings("unchecked")
   List<Object> list = (InternalEList<Object>)eObject.eGet(feature);
   return list != null && !list.isEmpty();
  }
  return !ObjectUtil.equals(eObject.eGet(feature), feature.getDefaultValue());
 }
 Object[] settings = ((CDOObjectImpl)eObject).eSettings;
 if (settings == null)
 {
  return false;
 }
 int transientIndex = getTransientFeatureIndex(eObject, feature);
 return settings[transientIndex] != null;
}
origin: org.eclipse.emf/org.eclipse.emf.ecore

@Override
public void eDynamicSet(EStructuralFeature eFeature, Object newValue)
{
 if (eFeature instanceof EReference && ((EReference)eFeature).isContainer())
 {
  eSettingDelegate(eFeature).dynamicSet(this, null, -1, newValue);
 }
 else
 {
  if (!eFeature.isUnsettable())
  {
   Object defaultValue = eFeature.getDefaultValue();
   if (defaultValue == null ? newValue == null : defaultValue.equals(newValue))
   {
    featureMap.setting(eFeature).unset();
    return;
   }
  }
  featureMap.setting(eFeature).set(newValue);
 }
}
origin: at.bestsolution.efxclipse.eclipse/org.eclipse.emf.ecore

@Override
public void eDynamicSet(EStructuralFeature eFeature, Object newValue)
{
 if (eFeature instanceof EReference && ((EReference)eFeature).isContainer())
 {
  eSettingDelegate(eFeature).dynamicSet(this, null, -1, newValue);
 }
 else
 {
  if (!eFeature.isUnsettable())
  {
   Object defaultValue = eFeature.getDefaultValue();
   if (defaultValue == null ? newValue == null : defaultValue.equals(newValue))
   {
    featureMap.setting(eFeature).unset();
    return;
   }
  }
  featureMap.setting(eFeature).set(newValue);
 }
}
origin: org.eclipse.emf/org.eclipse.emf.ecore

@Override
public void eDynamicSet(EStructuralFeature eFeature, Object newValue)
{
 if (eFeature instanceof EReference && ((EReference)eFeature).isContainer())
 {
  eSettingDelegate(eFeature).dynamicSet(this, null, -1, newValue);
 }
 else
 {
  if (!eFeature.isUnsettable())
  {
   Object defaultValue = eFeature.getDefaultValue();
   if (defaultValue == null ? newValue == null : defaultValue.equals(newValue))
   {
    featureMap.setting(eFeature).unset();
    return;
   }
  }
  featureMap.setting(eFeature).set(newValue);
 }
}
origin: org.eclipse.emf.cdo.server/db

@Override
protected Object getDefaultValue()
{
 Object defaultValue = getFeature().getDefaultValue();
 if (defaultValue == null)
 {
  return null;
 }
 EFactory factory = getFeature().getEType().getEPackage().getEFactoryInstance();
 return factory.convertToString((EDataType)getFeature().getEType(), defaultValue);
}
origin: com.b2international.snowowl/org.eclipse.emf.cdo

public boolean isSet(InternalEObject eObject, EStructuralFeature feature)
{
 if (!feature.isUnsettable())
 {
  if (feature.isMany())
  {
   @SuppressWarnings("unchecked")
   InternalEList<Object> list = (InternalEList<Object>)eObject.eGet(feature);
   return list != null && !list.isEmpty();
  }
  return !ObjectUtil.equals(eObject.eGet(feature), feature.getDefaultValue());
 }
 Object[] settings = ((CDOObjectImpl)eObject).cdoBasicSettings();
 if (settings == null)
 {
  return false;
 }
 int dynamicFeatureID = eDynamicFeatureID(eObject, feature);
 return settings[dynamicFeatureID] != null;
}
org.eclipse.emf.ecoreEStructuralFeaturegetDefaultValue

Javadoc

Returns the value of the 'Default Value' attribute.

It represents the default value that feature must take on when an explicit value has not been set. Specifically, it may be non-null if the feature has an ETypedElement#getEType. If the #getDefaultValueLiteral is null, it is simply the eType's intrinsic EClassifier#getDefaultValue. Otherwise, if the eType is an EDataType and the defaultValueLiteral is non-null, it is the object created by the factory's EFactory#createFromString method when invoked with those two objects as parameters.

Popular methods of EStructuralFeature

  • getName
  • isMany
  • getEType
  • getEContainingClass
    Returns the value of the 'EContaining Class' container reference. It is bidirectional and its opposi
  • isUnsettable
    Returns the value of the 'Unsettable' attribute. An unsettable feature explicitly models the state o
  • isChangeable
    Returns the value of the 'Changeable' attribute. The default value is "true".
  • isDerived
    Returns the value of the 'Derived' attribute. A derived feature typically computes its value from th
  • isTransient
    Returns the value of the 'Transient' attribute.
  • getUpperBound
  • getDefaultValueLiteral
    Returns the value of the 'Default Value Literal' attribute. It represents the serialized form of the
  • getEGenericType
  • isUnique
  • getEGenericType,
  • isUnique,
  • getFeatureID,
  • getEAnnotation,
  • getLowerBound,
  • isOrdered,
  • setChangeable,
  • eIsProxy,
  • setUpperBound

Popular in Java

  • Reactive rest calls using spring rest template
  • startActivity (Activity)
  • setContentView (Activity)
  • getSupportFragmentManager (FragmentActivity)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now