Class Source

  • All Implemented Interfaces:
    com.yahoo.component.provider.Freezable, PageElement

    public class Source
    extends com.yahoo.component.provider.FreezableClass
    implements PageElement
    A source mentioned in a page template.

    Two sources are equal if they have the same name and parameters.

    Author:
    bratseth
    • Field Detail

      • any

        public static final Source any
        The "any" source - used to mark that any source is acceptable here
    • Constructor Detail

      • Source

        public Source​(String name)
    • Method Detail

      • getName

        public String getName()
        Returns the name of this source (never null)
      • setName

        public final void setName​(String name)
      • getUrl

        public String getUrl()
        Returns the url of this source or null if none
      • setUrl

        public void setUrl​(String url)
        Sets the url of this source. If a source has an url (i.e this returns non-null), the content of the url is not fetched - fetching is left to the frontend by exposing this url in the result.
      • renderers

        public List<PageElement> renderers()
        Returns the renderers or choices of renderers to apply on individual items of this source

        If this contains multiple renderers/choices, they are to be used on different types of hits returned by this source.

      • parameters

        public Map<String,​String> parameters()
        Returns the parameters of this source as a live reference (never null). The parameters will be passed to the provider getting source data.
      • freeze

        public void freeze()
        Specified by:
        freeze in interface com.yahoo.component.provider.Freezable
        Overrides:
        freeze in class com.yahoo.component.provider.FreezableClass
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object