Interface Decorator

    • Method Detail

      • createDecoratorAttributes

        DecoratorAttributes createDecoratorAttributes​(NamedObj target)
                                               throws IllegalActionException
        Create and return the decorated attributes for the target NamedObj. Implementations of this method should create an Attribute that implements DecoratorAttributes. Implementations should populate that attribute with parameters that have appropriate default values.

        This method is called if NamedObj.getDecoratorAttribute(Decorator, String) or NamedObj.getDecoratorAttributes(Decorator) is called, and the specified target object does not already have decorated attributes for this decorator.

        The implementer of this method is responsible for ensuring consistency with the decoratedObjects() method. Specifically, any object returned by decoratedObjects(), when passed as an argument to this method, should not result in a null returned value. And conversely, any object passed to this method that is not in the list returned by decoratedObjects() should result in a null returned value.

        Parameters:
        target - The NamedObj that will be decorated.
        Returns:
        The decorated attributes for the target NamedObj, or null if the specified NamedObj is not decorated by this decorator.
        Throws:
        IllegalActionException - If the target cannot be determined to be decorated or not (e.g., a parameter cannot be evaluated).
      • decoratedObjects

        java.util.List<NamedObj> decoratedObjects()
                                           throws IllegalActionException
        Return a list of the objects that this decorator decorates. This could be, for example, all of the entities contained by the container of this decorator. An implementer of this method is responsible for ensuring that createDecoratorAttributes(NamedObj) will not return null for any object included in the returned list.

        Implementers of this method are required to maintain consistency with createDecoratorAttributes(NamedObj).

        Returns:
        A list of the objects decorated by this decorator.
        Throws:
        IllegalActionException - If some object cannot be determined to be decorated or not (e.g., a parameter cannot be evaluated).
      • isGlobalDecorator

        boolean isGlobalDecorator()
                           throws IllegalActionException
        Return true if this decorator should decorate objects across opaque hierarchy boundaries. That is, return true to make this decorator visible to objects even within opaque composites.
        Returns:
        True if decorator is global.
        Throws:
        IllegalActionException - If it cannot be determined whether this is global or not (e.g., a parameter cannot be evaluated).