Class CDOPackageRef

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

public final class CDOPackageRef extends Object implements CDOModelElementRef<EPackage>
A symbolic reference to an EPackage, identified by its namespace URI.
Since:
4.29
Author:
Eike Stepper
See Also:
  • Constructor Details

    • CDOPackageRef

      public CDOPackageRef(EPackage ePackage)
      Creates a reference from an EMF package without consulting a registry.
      Parameters:
      ePackage - the package whose namespace URI identifies the reference
    • CDOPackageRef

      public CDOPackageRef(String packageURI)
      Creates a reference from a namespace URI.
      Parameters:
      packageURI - the package namespace URI
    • CDOPackageRef

      public CDOPackageRef(CDODataInput in) throws IOException
      Reads a symbolic package reference. Reading does not resolve the package.
      Parameters:
      in - the data input
      Throws:
      IOException - if the URI cannot be read
  • Method Details

    • write

      public void write(CDODataOutput out) throws IOException
      Writes only the symbolic package URI.
      Parameters:
      out - the data output
      Throws:
      IOException - if the URI cannot be written
    • getPackageURI

      public String getPackageURI()
      Returns the package namespace URI.
      Returns:
      the package namespace URI
    • resolve

      public EPackage resolve(EPackage.Registry packageRegistry)
      Description copied from interface: CDOModelElementRef
      Resolves this reference against the supplied package registry.
      Specified by:
      resolve in interface CDOModelElementRef<EPackage>
      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
    • 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