Package org.eclipse.emf.cdo.common.model

## Class CDOModelUtil

- java.lang.Object
- - org.eclipse.emf.cdo.common.model.CDOModelUtil

- All Implemented Interfaces:
    `CDOModelConstants`

      public final class CDOModelUtil
      extends java.lang.Object
      implements CDOModelConstants

  Various static helper methods for dealing with CDO meta models.
  Since:
    2.0
  Author:
    Eike Stepper

- - ### Field Summary

    - ### Fields inherited from interface org.eclipse.emf.cdo.common.model.CDOModelConstants

      `BLOB_CLASS_NAME, CLOB_CLASS_NAME, CORE_PACKAGE_URI, RESOURCE_BINARY_FILE_CLASS_NAME, RESOURCE_CLASS_NAME, RESOURCE_FILE_CLASS_NAME, RESOURCE_FOLDER_CLASS_NAME, RESOURCE_FOLDER_NODES_REFERENCE, RESOURCE_LEAF_CLASS_NAME, RESOURCE_NODE_CLASS_NAME, RESOURCE_NODE_FOLDER_REFERENCE, RESOURCE_NODE_NAME_ATTRIBUTE, RESOURCE_PACKAGE_URI, RESOURCE_TEXT_FILE_CLASS_NAME, ROOT_CLASS_NAME, TYPES_PACKAGE_URI`

  - ### Method Summary

    All Methods Static Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static void` | `checkCrossResourceURIs​(org.eclipse.emf.ecore.EPackage ePackage)` |
    `static void` | `checkNoFeatureMaps​(java.lang.StringBuilder builder, org.eclipse.emf.ecore.EPackage ePackage, boolean checkFeatureMapEntries)` |
    `static void` | `checkNoFeatureMaps​(InternalCDOPackageUnit[] packageUnits, boolean checkFeatureMapEntries)` |
    `static CDOPackageUnit` | `copyPackageUnit​(CDOPackageUnit packageUnit)` |
    `static CDOPackageInfo` | `createPackageInfo()` |
    `static CDOPackageUnit` | `createPackageUnit()` |
    `static org.eclipse.emf.ecore.EStructuralFeature[]` | `getAllPersistentFeatures​(org.eclipse.emf.ecore.EClass eClass)` | Deprecated. As of 4.2 use `CDOModelUtil.getClassInfo(eClass).getAllPersistentFeatures()`.
    `static CDOClassInfo` | `getClassInfo​(org.eclipse.emf.ecore.EClass eClass)` | Returns additional CDO infos for an `EClass`.
    `static CDOType` | `getCoreType​(org.eclipse.emf.ecore.EClassifier eDataType)` | Core types includes also complex data like EAnnotation, and EEnum
    `static CDOPackageInfo` | `getPackageInfo​(java.lang.Object value, CDOPackageRegistry packageRegistry)` |
    `static CDOType` | `getPrimitiveType​(java.lang.Class<? extends java.lang.Object> primitiveType)` |
    `static java.util.Map<org.eclipse.emf.ecore.EClass,​java.util.List<org.eclipse.emf.ecore.EClass>>` | `getSubTypes​(org.eclipse.emf.ecore.EPackage.Registry packageRegistry)` |
    `static CDOType` | `getType​(byte typeID)` |
    `static CDOType` | `getType​(org.eclipse.emf.ecore.EClassifier classifier)` |
    `static CDOType` | `getType​(org.eclipse.emf.ecore.EStructuralFeature feature)` |
    `static CDOType` | `getTypeOfObject​(java.lang.Object object)` |
    `static boolean` | `isCorePackage​(org.eclipse.emf.ecore.EPackage ePackage)` |
    `static boolean` | `isLob​(org.eclipse.emf.ecore.EClassifier eClassifier)` |
    `static boolean` | `isResource​(org.eclipse.emf.ecore.EClass eClass)` |
    `static boolean` | `isResourceFolder​(org.eclipse.emf.ecore.EClass eClass)` |
    `static boolean` | `isResourceNode​(org.eclipse.emf.ecore.EClass eClass)` |
    `static boolean` | `isResourcePackage​(org.eclipse.emf.ecore.EPackage ePackage)` |
    `static boolean` | `isResourcePathFeature​(org.eclipse.emf.ecore.EStructuralFeature eStructuralFeature)` |
    `static boolean` | `isRoot​(org.eclipse.emf.ecore.EClass eClass)` |
    `static boolean` | `isSystemPackage​(org.eclipse.emf.ecore.EPackage ePackage)` |
    `static boolean` | `isSystemPackageURI​(java.lang.String nsURI)` |
    `static boolean` | `isTypesPackage​(org.eclipse.emf.ecore.EPackage ePackage)` |
    `static org.eclipse.emf.ecore.EPackage` | `readPackage​(org.eclipse.net4j.util.io.ExtendedDataInput in, org.eclipse.emf.ecore.resource.ResourceSet resourceSet, boolean lookForResource)` |
    `static void` | `writePackage​(org.eclipse.net4j.util.io.ExtendedDataOutput out, org.eclipse.emf.ecore.EPackage ePackage, boolean zipped, org.eclipse.emf.ecore.EPackage.Registry packageRegistry)` |

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### isCorePackage

          public static boolean isCorePackage​(org.eclipse.emf.ecore.EPackage ePackage)

      Since:
        2.0

    - #### isRoot

          public static boolean isRoot​(org.eclipse.emf.ecore.EClass eClass)

      Since:
        2.0

    - #### isResourcePackage

          public static boolean isResourcePackage​(org.eclipse.emf.ecore.EPackage ePackage)

      Since:
        2.0

    - #### isResource

          public static boolean isResource​(org.eclipse.emf.ecore.EClass eClass)

      Since:
        2.0

    - #### isResourceFolder

          public static boolean isResourceFolder​(org.eclipse.emf.ecore.EClass eClass)

      Since:
        2.0

    - #### isResourceNode

          public static boolean isResourceNode​(org.eclipse.emf.ecore.EClass eClass)

      Since:
        2.0

    - #### isResourcePathFeature

          public static boolean isResourcePathFeature​(org.eclipse.emf.ecore.EStructuralFeature eStructuralFeature)

      Since:
        4.3

    - #### isTypesPackage

          public static boolean isTypesPackage​(org.eclipse.emf.ecore.EPackage ePackage)

      Since:
        4.0

    - #### isSystemPackage

          public static boolean isSystemPackage​(org.eclipse.emf.ecore.EPackage ePackage)

      Since:
        2.0

    - #### isSystemPackageURI

          public static boolean isSystemPackageURI​(java.lang.String nsURI)

      Since:
        4.7

    - #### isLob

          public static boolean isLob​(org.eclipse.emf.ecore.EClassifier eClassifier)

      Since:
        4.0

    - #### getType

          public static CDOType getType​(org.eclipse.emf.ecore.EStructuralFeature feature)

      Since:
        2.0

    - #### getType

          public static CDOType getType​(byte typeID)

      Since:
        4.0

    - #### getType

          public static CDOType getType​(org.eclipse.emf.ecore.EClassifier classifier)

      Since:
        2.0

    - #### getCoreType

          public static CDOType getCoreType​(org.eclipse.emf.ecore.EClassifier eDataType)

      Core types includes also complex data like EAnnotation, and EEnum
      Since:
        2.0

    - #### getPrimitiveType

          public static CDOType getPrimitiveType​(java.lang.Class<? extends java.lang.Object> primitiveType)

      Since:
        2.0

    - #### getTypeOfObject

          public static CDOType getTypeOfObject​(java.lang.Object object)

      Since:
        4.0

    - #### getPackageInfo

          public static CDOPackageInfo getPackageInfo​(java.lang.Object value,
                                                      CDOPackageRegistry packageRegistry)

      Since:
        2.0

    - #### getClassInfo

          public static CDOClassInfo getClassInfo​(org.eclipse.emf.ecore.EClass eClass)

      Returns additional CDO infos for an `EClass`.

      This operation is somewhat expensive because it synchronizes on the EClass and iterates over all adapters. Whenever possible use `CDORevision.getClassInfo()` or `InternalCDOObject.getClassInfo()`.

      Since:
        2.0

    - #### getAllPersistentFeatures

          @Deprecated
          public static org.eclipse.emf.ecore.EStructuralFeature[] getAllPersistentFeatures​(org.eclipse.emf.ecore.EClass eClass)

      Deprecated.
      As of 4.2 use `CDOModelUtil.getClassInfo(eClass).getAllPersistentFeatures()`.
      Returns all persistent `features` of an `EClass`.

      This operation is somewhat expensive because it synchronizes on the EClass and iterates over all adapters.

      Since:
        2.0
      See Also:
        `getClassInfo(EClass)`

    - #### copyPackageUnit

          public static CDOPackageUnit copyPackageUnit​(CDOPackageUnit packageUnit)

      Since:
        4.13

    - #### createPackageUnit

          public static CDOPackageUnit createPackageUnit()

      Since:
        2.0

    - #### createPackageInfo

          public static CDOPackageInfo createPackageInfo()

      Since:
        2.0

    - #### readPackage

          public static org.eclipse.emf.ecore.EPackage readPackage​(org.eclipse.net4j.util.io.ExtendedDataInput in,
                                                                   org.eclipse.emf.ecore.resource.ResourceSet resourceSet,
                                                                   boolean lookForResource)
                                                            throws java.io.IOException

      Throws:
        `java.io.IOException`
      Since:
        3.0

    - #### writePackage

          public static void writePackage​(org.eclipse.net4j.util.io.ExtendedDataOutput out,
                                          org.eclipse.emf.ecore.EPackage ePackage,
                                          boolean zipped,
                                          org.eclipse.emf.ecore.EPackage.Registry packageRegistry)
                                   throws java.io.IOException

      Throws:
        `java.io.IOException`
      Since:
        2.0

    - #### checkCrossResourceURIs

          public static void checkCrossResourceURIs​(org.eclipse.emf.ecore.EPackage ePackage)

      Since:
        3.0

    - #### checkNoFeatureMaps

          public static void checkNoFeatureMaps​(java.lang.StringBuilder builder,
                                                org.eclipse.emf.ecore.EPackage ePackage,
                                                boolean checkFeatureMapEntries)

      Since:
        4.10

    - #### checkNoFeatureMaps

          public static void checkNoFeatureMaps​(InternalCDOPackageUnit[] packageUnits,
                                                boolean checkFeatureMapEntries)
                                         throws CDOException

      Throws:
        `CDOException`
      Since:
        4.10

    - #### getSubTypes

          public static java.util.Map<org.eclipse.emf.ecore.EClass,​java.util.List<org.eclipse.emf.ecore.EClass>> getSubTypes​(org.eclipse.emf.ecore.EPackage.Registry packageRegistry)

      Since:
        4.0