Interface IClassReferenceOwner

    • Method Detail

      • getProp

        <GP extends IGProp<?>> GP getProp​(Atom atom,
                                          java.lang.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.
      • getClassReferenceAtom

        Atom getClassReferenceAtom​(java.lang.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​(java.lang.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​(java.lang.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

        java.lang.String getClassReferenceImplementsInterface​(java.lang.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

        java.lang.String getClassReferenceRequiredAnnotation​(java.lang.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​(java.lang.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:
        java.lang.ClassCastException - If the object is not null and is not assignable to the type T.
      • getRuntimeClassInstance

        default <T> T getRuntimeClassInstance​(java.lang.String id,
                                              java.lang.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:
        java.lang.ClassCastException - If the object is not null and is not assignable to the type T.