Class LinkDecorator

  • All Implemented Interfaces:
    IExtendedResource, IResource

    @OslcNamespace("http://www.sodius.com/ns/process#")
    @OslcResourceShape(title="Link Decorator Resource Shape",
                       describes="http://www.sodius.com/ns/process#LinkDecorator")
    public class LinkDecorator
    extends AbstractResource
    A link attribute decorator. A decorator is used to decorate a particular value of the corresponding attribute. This value identifies the decorator.

    An icon or a tag can be used as the decoration source (where the display or styling comes from). The Dcterms.PROPERTY_SOURCE is used (as an extended property) to dynamically save either the icon URI or the tag name.

    A label can be used to override the value to display, in a tag decorator (whose by default displays the attribute value), or to describe the image in an icon decorator.

    Since:
    3.3.0
    • Constructor Detail

      • LinkDecorator

        public LinkDecorator()
    • Method Detail

      • tag

        public static LinkDecorator tag​(String identifier,
                                        String source,
                                        String label)
        Convenient method to create a tag decorator.
        Parameters:
        identifier - the link's attribute value to decorate.
        source - the name/class of the tag to decorate the link.
        label - decorator label.
        Returns:
        the created decorator.
      • icon

        public static LinkDecorator icon​(String identifier,
                                         URI source,
                                         String label)
        Convenient method to create a icon decorator.
        Parameters:
        identifier - the link's attribute value to decorate.
        source - the icon URI to decorate the link.
        label - decorator label.
        Returns:
        the created decorator.
      • setIdentifier

        public void setIdentifier​(String identifier)
        Sets the value that the corresponding attribute must have to apply this decorator.
        Parameters:
        identifier - this decorator's identifier.
      • setLabel

        public void setLabel​(String label)
        Sets this decorator's alias.
        Parameters:
        label - this decorator's alias.
      • copy

        public LinkDecorator copy()
        Convenient method to create a copy of this instance.
        Returns:
        a copy of this instance.