com.corticon.rulesemf.common.util

## Class CommonUtil

- java.lang.Object
- - com.corticon.rulesemf.common.util.CommonUtil

-     public class CommonUtil
      extends java.lang.Object

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CommonUtil()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static org.eclipse.emf.ecore.EObject` | `resolveDefensively(org.eclipse.emf.ecore.InternalEObject aInternalEObjectProxy, org.eclipse.emf.ecore.EObject aEObjectContext, java.lang.Class<?> aClassExpected)` Cross-document URIs referring to EMF ecore (Vocabulary) assets contain the names of the Vocabulary elements.

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

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

- - ### Constructor Detail

    - #### CommonUtil

          public CommonUtil()

  - ### Method Detail

    - #### resolveDefensively

          public static org.eclipse.emf.ecore.EObject resolveDefensively(org.eclipse.emf.ecore.InternalEObject aInternalEObjectProxy,
                                                         org.eclipse.emf.ecore.EObject aEObjectContext,
                                                         java.lang.Class<?> aClassExpected)

      Cross-document URIs referring to EMF ecore (Vocabulary) assets contain the names of the Vocabulary elements. For example a cross-document URI to com.corticon.Customer.order would be as follows: Untitled.ecore#//com/corticon/Customer/order Certain Vocabulary elements share name space with one another: Domains and entities Attributes and associations If the user changes a Vocabulary element from one type to another (effectively reusing the same name) errors will occur unless this is detected. For example, if a user changes a Vocabulary attribute into an association with the same name, cross-document URIs that point to the defunct attribute will resolve to the wrong type resulting in ClassCastException. To handle this type of problem, EMF getters for Vocabulary cross references have been modified to use this method. Client logic supplies a potentially unresolved proxy, a context (owning) object and the expected type. If the actual type does not, match the expected type, this method simply return the unresolved proxy. This causes the system to behave as if the Vocabulary element were missing, avoiding ClassCastException.
      Parameters:
        `aInternalEObjectProxy` - Proxy object to be resolved.
        `aEObjectContext` - Context (container) object.
        `aClassExpected` - Expected type (e.g., EAttribute, EReference).
      Returns:
        Resolved EObject or unresolved proxy if resolved object is not of the expected type.

Copyright © 2005-2013 Progress Software Corporation and/or its subsidiaries and affiliates. All rights reserved.