Class Source
- java.lang.Object
-
- com.yahoo.component.provider.FreezableClass
-
- com.yahoo.search.pagetemplates.model.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
-
-
Constructor Summary
Constructors Constructor Description Source(java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(PageTemplateVisitor visitor)
Accepts a visitor to this structureboolean
equals(java.lang.Object other)
void
freeze()
java.lang.String
getName()
Returns the name of this source (never null)java.lang.String
getUrl()
Returns the url of this source or null if noneint
hashCode()
java.util.Map<java.lang.String,java.lang.String>
parameters()
Returns the parameters of this source as a live reference (never null).java.util.List<PageElement>
renderers()
Returns the renderers or choices of renderers to apply on individual items of this sourcevoid
setName(java.lang.String name)
void
setUrl(java.lang.String url)
Sets the url of this source.java.lang.String
toString()
-
Methods inherited from class com.yahoo.component.provider.FreezableClass
clone, ensureNotFrozen, isFrozen
-
-
-
-
Field Detail
-
any
public static final Source any
The "any" source - used to mark that any source is acceptable here
-
-
Method Detail
-
getName
public java.lang.String getName()
Returns the name of this source (never null)
-
setName
public final void setName(java.lang.String name)
-
getUrl
public java.lang.String getUrl()
Returns the url of this source or null if none
-
setUrl
public void setUrl(java.lang.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 java.util.List<PageElement> renderers()
Returns the renderers or choices of renderers to apply on individual items of this sourceIf this contains multiple renderers/choices, they are to be used on different types of hits returned by this source.
-
parameters
public java.util.Map<java.lang.String,java.lang.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 interfacecom.yahoo.component.provider.Freezable
- Overrides:
freeze
in classcom.yahoo.component.provider.FreezableClass
-
accept
public void accept(PageTemplateVisitor visitor)
Accepts a visitor to this structure- Specified by:
accept
in interfacePageElement
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-