Class CDOFeatureRef

java.lang.Object
org.eclipse.emf.cdo.common.model.CDOFeatureRef
All Implemented Interfaces:
Serializable, CDOModelElementRef<EStructuralFeature>

public final class CDOFeatureRef extends Object implements CDOModelElementRef<EStructuralFeature>
A symbolic reference to an EStructuralFeature, identified by its declaring classifier and feature name.
Since:
4.29
Author:
Eike Stepper
See Also:
  • Constructor Details

    • CDOFeatureRef

      public CDOFeatureRef(EStructuralFeature feature)
      Creates a reference using the feature's declaring class. In particular, inherited features are identified by EStructuralFeature.getEContainingClass().
      Parameters:
      feature - the feature to reference
    • CDOFeatureRef

      public CDOFeatureRef(CDOClassifierRef classifierRef, String featureName)
      Creates a reference from a symbolic declaring classifier and feature name.
      Parameters:
      classifierRef - the symbolic declaring classifier
      featureName - the feature name
    • CDOFeatureRef

      public CDOFeatureRef(CDODataInput in) throws IOException
      Reads a symbolic feature reference without resolving its classifier.
      Parameters:
      in - the data input
      Throws:
      IOException - if the reference cannot be read
  • Method Details

    • write

      public void write(CDODataOutput out) throws IOException
      Writes the classifier reference followed by the feature name.
      Parameters:
      out - the data output
      Throws:
      IOException - if the reference cannot be written
    • getClassifierRef

      public CDOClassifierRef getClassifierRef()
      Returns the symbolic declaring classifier.
      Returns:
      the declaring classifier reference
    • getFeatureName

      public String getFeatureName()
      Returns the symbolic feature name.
      Returns:
      the feature name
    • resolve

      public EStructuralFeature resolve(EPackage.Registry packageRegistry)
      Description copied from interface: CDOModelElementRef
      Resolves this reference against the supplied package registry.
      Specified by:
      resolve in interface CDOModelElementRef<EStructuralFeature>
      Parameters:
      packageRegistry - the registry to use for explicit resolution
      Returns:
      the referenced model element, or null if the symbolic element is not present in the resolved package
    • resolve

      public EStructuralFeature resolve(EClass eClass)
      Resolves this reference against a declaring class. An inherited feature is not accepted when the supplied class is not its declaring class.
      Parameters:
      eClass - the explicitly resolved declaring class
      Returns:
      the declared feature, or null if it is absent
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object