Interface IClassReferenceOwner

All Known Subinterfaces:
IEUIPanel, IJavaClassLinkEnabler, IUIClassReferenceOwner, IVSClassReferenceOwner
All Known Implementing Classes:
EditorVirtualSpace, EMLGroup, EMUISimpleDialog, EUIContextMenu, EUIDialog, EUIPanel, EUIPanelPart, EUIPanelPartCnr, MLGroup, MUISimpleDialog, UIContextMenu, UIDialog, UIPanel, UIPanelBase, UIPanelPart, UIPanelPartCnr, VirtualSpace

public interface IClassReferenceOwner
Interface implemented by a property container that holds a ClassReference instance, used to resolve references for MethodReferences, e.g. the VirtualSpace or Panels.
Author:
Christopher Mindus
  • Field Details

    • RETRIEVE_CLASS_REFERENCE_INSTANCE

      static final Object RETRIEVE_CLASS_REFERENCE_INSTANCE
      Objects used to determine if the class reference instance is retrieved or not. The if the class reference instance is equal to this value, then the cached value has not yet been retrieved.
  • Method Details

    • getProp

      <GP extends IGProp<?>> GP getProp(Atom atom, Class<GP> clazz)
      Gets the property with the atom name and checking the class instance of the property. An error message is logged if the class is not matching.
      Type Parameters:
      GP - The property class requested.
      Parameters:
      atom - the atom of the property to locate in this property container.
      clazz - the class the property must be or extend, null for no checking.
      Returns:
      GProp the property or null for uninitialized container or the property with specified name is not found, or the class type is not an instance of the specified class.
    • getClassReference

      default ClassReference getClassReference()
      Gets the ClassReference in the property container from the ClassReference instance.
      Returns:
      The resolved class reference instance, null if not resolved or found.
    • getClassReferenceRuntimeInstance

      default Object getClassReferenceRuntimeInstance()
      Gets the ClassReference runtime instance object.
      Returns:
      The class runtime instance if there is a ClassReference present, defaults to calling ClassReference.getRuntimeInstance().
    • getClassReferenceAtom

      Atom getClassReferenceAtom(String id)
      Gets the ClassReference atom name.
      Parameters:
      id - ID for the class reference if several exist, null for default.
      Returns:
      The class reference atom name for the ID.
    • getClassReference

      ClassReference getClassReference(String id, boolean doCreateIfNotPresent)
      Gets or creates the ClassReference in the property container.
      Parameters:
      id - ID for the class reference if several exist, null for default.
      doCreateIfNotPresent - Flag to create the property (this flag can only be true in Designer)!
      Returns:
      The resolved class reference instance, null if the ClassReference doesn't exist if the create flag is false. If flag is true, an orphan unresolved EditorClassReference instance (ONLY for the Designer).
    • isClassReferenceAnnotationBackReferenceRequired

      boolean isClassReferenceAnnotationBackReferenceRequired(String id)
      Checks if the ClassReference require an annotation back-reference.
      Parameters:
      id - ID for the class reference if several exist, null for default.
      Returns:
      true if the annotation is required to have a back-reference on the "ref" member value pair to the ClassReference owner.
    • getClassReferenceImplementsInterface

      String getClassReferenceImplementsInterface(String id)
      Returns the required Interface.
      Parameters:
      id - ID for the class reference if several exist, null for default.
      Returns:
      The fully qualified name of the interface for the class, or null for none.
    • getClassReferenceRequiredAnnotation

      String getClassReferenceRequiredAnnotation(String id)
      Returns the required annotation, or null for none.
      Parameters:
      id - ID for the class reference if several exist, null for default.
      Returns:
      The fully qualified name of the interface for the class, or null for none.
    • getRuntimeClassInstance

      default <T> T getRuntimeClassInstance(Class<T> clazz)
      Gets the class runtime instance that is connected to the object using the default class reference ID (if many exist). This is typically used from a panel to access the class that is connected to a VirtualSpace.
      Parameters:
      clazz - The requested class type.
      Returns:
      The class instance, or null if none is set.
      Throws:
      ClassCastException - If the object is not null and is not assignable to the type T.
    • getRuntimeClassInstance

      default <T> T getRuntimeClassInstance(String id, Class<T> clazz)
      Gets the class runtime instance that is connected to the object using the default class reference ID (if many exist). This is typically used from a panel to access the class that is connected to a VirtualSpace.
      Parameters:
      id - ID for the class reference if several exist, null for default.
      clazz - The requested class type.
      Returns:
      The class instance, or null if none is set.
      Throws:
      ClassCastException - If the object is not null and is not assignable to the type T.