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 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

Modifier and Type
Method
Description
`static void`
`checkCrossResourceURIs(EPackage ePackage)`
`static void`
`checkNoFeatureMaps(StringBuilder builder, EPackage ePackage, boolean checkFeatureMapEntries)`
`static void`
`checkNoFeatureMaps(InternalCDOPackageUnit[] packageUnits, boolean checkFeatureMapEntries)`
`static CDOPackageUnit`
`copyPackageUnit(CDOPackageUnit packageUnit)`
`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`
`isBasedInPackage(EClass eClass, String nsURI)`
`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`
`isSystemPackageURI(String nsURI)`
`static boolean`
`isTypesPackage(EPackage ePackage)`
`static EPackage`
`readPackage(org.eclipse.net4j.util.io.ExtendedDataInput in, ResourceSet resourceSet, boolean lookForResource)`
`static void`
`writePackage(org.eclipse.net4j.util.io.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 Details

### 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

### isSystemPackageURI

public static boolean isSystemPackageURI(String nsURI)

Since:
  4.7

### isBasedInPackage

public static boolean isBasedInPackage(EClass eClass, String nsURI)

Since:
  4.21

### 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)`

### 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 EPackage readPackage(org.eclipse.net4j.util.io.ExtendedDataInput in, ResourceSet resourceSet, boolean lookForResource) throws IOException

Throws:
  `IOException`
Since:
  3.0

### writePackage

public static void writePackage(org.eclipse.net4j.util.io.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

### checkNoFeatureMaps

public static void checkNoFeatureMaps(StringBuilder builder, 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 Map<EClass,List<EClass>> getSubTypes(EPackage.Registry packageRegistry)

Since:
  4.0