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 Object
      implements CDOModelConstants

  Various static helper methods for dealing with CDO meta models.
  Since:
    2.0
  Author:
    Eike Stepper
  Apiviz
    `CDOType` - - provides

- - ### 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 and Description
    --- | ---
    `static void` | `checkCrossResourceURIs(EPackage ePackage)`
    `static CDOPackageInfo` | `createPackageInfo()`
    `static CDOPackageUnit` | `createPackageUnit()`
    `static EStructuralFeature[]` | `getAllPersistentFeatures(EClass eClass)` Deprecated. As of 4.2 use `CDOModelUtil.getClassInfo(eClass).getAllPersistentFeatures()`.
    `static CDOClassInfo` | `getClassInfo(EClass eClass)` Returns additional CDO infos for an `EClass`.
    `static CDOType` | `getCoreType(EClassifier eDataType)` Core types includes also complex data like EAnnotation, and EEnum
    `static CDOPackageInfo` | `getPackageInfo(Object value, CDOPackageRegistry packageRegistry)`
    `static CDOType` | `getPrimitiveType(Class<? extends Object> primitiveType)`
    `static Map<EClass,List<EClass>>` | `getSubTypes(EPackage.Registry packageRegistry)`
    `static CDOType` | `getType(byte typeID)`
    `static CDOType` | `getType(EClassifier classifier)`
    `static CDOType` | `getType(EStructuralFeature feature)`
    `static CDOType` | `getTypeOfObject(Object object)`
    `static boolean` | `isCorePackage(EPackage ePackage)`
    `static boolean` | `isLob(EClassifier eClassifier)`
    `static boolean` | `isResource(EClass eClass)`
    `static boolean` | `isResourceFolder(EClass eClass)`
    `static boolean` | `isResourceNode(EClass eClass)`
    `static boolean` | `isResourcePackage(EPackage ePackage)`
    `static boolean` | `isResourcePathFeature(EStructuralFeature eStructuralFeature)`
    `static boolean` | `isRoot(EClass eClass)`
    `static boolean` | `isSystemPackage(EPackage ePackage)`
    `static boolean` | `isTypesPackage(EPackage ePackage)`
    `static EPackage` | `readPackage(ExtendedDataInput in, ResourceSet resourceSet, boolean lookForResource)`
    `static void` | `writePackage(ExtendedDataOutput out, EPackage ePackage, boolean zipped, 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(EPackage ePackage)

      Since:
        2.0

    - #### isRoot

          public static boolean isRoot(EClass eClass)

      Since:
        2.0

    - #### isResourcePackage

          public static boolean isResourcePackage(EPackage ePackage)

      Since:
        2.0

    - #### isResource

          public static boolean isResource(EClass eClass)

      Since:
        2.0

    - #### isResourceFolder

          public static boolean isResourceFolder(EClass eClass)

      Since:
        2.0

    - #### isResourceNode

          public static boolean isResourceNode(EClass eClass)

      Since:
        2.0

    - #### isResourcePathFeature

          public static boolean isResourcePathFeature(EStructuralFeature eStructuralFeature)

      Since:
        4.3

    - #### isTypesPackage

          public static boolean isTypesPackage(EPackage ePackage)

      Since:
        4.0

    - #### isSystemPackage

          public static boolean isSystemPackage(EPackage ePackage)

      Since:
        2.0

    - #### isLob

          public static boolean isLob(EClassifier eClassifier)

      Since:
        4.0

    - #### getType

          public static CDOType getType(EStructuralFeature feature)

      Since:
        2.0

    - #### getType

          public static CDOType getType(byte typeID)

      Since:
        4.0

    - #### getType

          public static CDOType getType(EClassifier classifier)

      Since:
        2.0

    - #### getCoreType

          public static CDOType getCoreType(EClassifier eDataType)

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

    - #### getPrimitiveType

          public static CDOType getPrimitiveType(Class<? extends Object> primitiveType)

      Since:
        2.0

    - #### getTypeOfObject

          public static CDOType getTypeOfObject(Object object)

      Since:
        4.0

    - #### getPackageInfo

          public static CDOPackageInfo getPackageInfo(Object value,
                                                      CDOPackageRegistry packageRegistry)

      Since:
        2.0

    - #### getClassInfo

          public static CDOClassInfo getClassInfo(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 EStructuralFeature[] getAllPersistentFeatures(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)`

    - #### createPackageUnit

          public static CDOPackageUnit createPackageUnit()

      Since:
        2.0

    - #### createPackageInfo

          public static CDOPackageInfo createPackageInfo()

      Since:
        2.0

    - #### readPackage

          public static EPackage readPackage(ExtendedDataInput in,
                                             ResourceSet resourceSet,
                                             boolean lookForResource)
                                      throws IOException

      Throws:
        `IOException`
      Since:
        3.0

    - #### writePackage

          public static void writePackage(ExtendedDataOutput out,
                                          EPackage ePackage,
                                          boolean zipped,
                                          EPackage.Registry packageRegistry)
                                   throws IOException

      Throws:
        `IOException`
      Since:
        2.0

    - #### checkCrossResourceURIs

          public static void checkCrossResourceURIs(EPackage ePackage)

      Since:
        3.0

    - #### getSubTypes

          public static Map<EClass,List<EClass>> getSubTypes(EPackage.Registry packageRegistry)

      Since:
        4.0

Copyright (c) 2014 Eike Stepper (Berlin, Germany) and others.
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html