com.microfocus.awm.meta.modelextension

## Class ModelExtensionReference<T,E>

- java.lang.Object
- - com.microfocus.awm.meta.modelextension.ModelExtensionReference<T,E>

- Type Parameters:
    `T` - referencing object type
    `E` - target reference type
  Direct Known Subclasses:
    FilePropertyModelPropertyReference, KeyPropertyModelPropertyReference, LinkedElementIDDefinintionReference, LinkedPropertyResourceIDPropertyReference, ModelExtensionAttributeReference, TargetAttributeModelObjectReference, ToolTypeParameterModelPropertyReference

      public abstract class ModelExtensionReference<T,E>
      extends java.lang.Object

  Reference between two model extension elements. References can only be resolved after all model extension objects have been parsed.
  Author:
    RalfP

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ModelExtensionReference(java.lang.String pRawTargetID, java.lang.String pPrefixedTargetID, T pReferencingObject)` Constructor with the option to make a reference to a feature of another function package.
    `ModelExtensionReference(java.lang.String pTargetID, T pReferencingObject)` Constructor for references which do not support targeting features of other function packages.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `T` | `getReferencingObject()` Gets the `ModelExtensionObject` which declared the reference.
    `java.lang.String` | `getTargetID()` Gets the target attribute ID.
    `void` | `resolveReference(java.util.Map<java.lang.String,ModelExtensionObject> pParsedExtensionObjects)` Resolves the reference by getting the reference target from the map of parsed extension objects and then calling `setReference(Object, Object)`.

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

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

- - ### Constructor Detail

    - #### ModelExtensionReference

          public ModelExtensionReference(java.lang.String pTargetID,
                                         T pReferencingObject)

      Constructor for references which do not support targeting features of other function packages.
      Parameters:
        `pTargetID` - the full qualified target ID of the reference (starting with the function package ID)
        `pReferencingObject` - the extension object that is referencing the targetID

    - #### ModelExtensionReference

          public ModelExtensionReference(java.lang.String pRawTargetID,
                                         java.lang.String pPrefixedTargetID,
                                         T pReferencingObject)

      Constructor with the option to make a reference to a feature of another function package.
      Parameters:
        `pRawTargetID` - the unchanged target ID of the reference
        `pPrefixedTargetID` - the target ID prefixed with the parent's feature ID (see `ModelExtensionUtilities.getFullQualifiedID(ModelExtensionObject, String)`
        `pReferencingObject` - the extension object that is referencing the targetID

  - ### Method Detail

    - #### getTargetID

          public java.lang.String getTargetID()

      Gets the target attribute ID.
      Returns:
        the target ID

    - #### getReferencingObject

          public T getReferencingObject()

      Gets the `ModelExtensionObject` which declared the reference.
      Returns:
        the referencing object

    - #### resolveReference

          public void resolveReference(java.util.Map<java.lang.String,ModelExtensionObject> pParsedExtensionObjects)
                                throws TaurusMetaModelException

      Resolves the reference by getting the reference target from the map of parsed extension objects and then calling `setReference(Object, Object)`.
      Parameters:
        `pParsedExtensionObjects` - a map will all parsed extension objects of the function package
      Throws:
        `TaurusMetaModelException` - if the reference cannot be resolved

Copyright © 2015 Micro Focus GmbH. All rights reserved.