public class MetaDataHeaderItem extends HeaderItem
HeaderItem for meta information such as <meta> tags or
canonical <link>| Modifier and Type | Field and Description |
|---|---|
static String |
LINK_TAG |
static String |
META_TAG |
| Constructor and Description |
|---|
MetaDataHeaderItem(String tagName)
Build a new
MetaDataHeaderItem having tagName as tag. |
| Modifier and Type | Method and Description |
|---|---|
MetaDataHeaderItem |
addTagAttribute(String attributeName)
Add a minimized tag attribute to the item.
|
MetaDataHeaderItem |
addTagAttribute(String attributeName,
Object attributeValue)
Add a tag attribute to the item.
|
boolean |
equals(Object o) |
static MetaDataHeaderItem |
forLinkTag(IModel<String> rel,
IModel<String> href)
Factory method to create <link> tag.
|
static MetaDataHeaderItem |
forLinkTag(String rel,
String href)
Factory method to create <link> tag.
|
static MetaDataHeaderItem |
forMetaTag(IModel<String> name,
IModel<String> content)
Factory method to create <meta> tag.
|
static MetaDataHeaderItem |
forMetaTag(String name,
String content)
Factory method to create <meta> tag.
|
String |
generateString()
Generate the string representation for the current item.
|
Iterable<?> |
getRenderTokens() |
int |
hashCode() |
void |
render(Response response)
Renders the
HeaderItem to the response. |
getDependencies, getProvidedResourcespublic static final String META_TAG
public static final String LINK_TAG
public MetaDataHeaderItem(String tagName)
MetaDataHeaderItem having tagName as tag.tagName - the name of the tagpublic MetaDataHeaderItem addTagAttribute(String attributeName, Object attributeValue)
IModel,
the object wrapped inside the model is used as actual value.attributeName - the attribute nameattributeValue - the attribute valuepublic MetaDataHeaderItem addTagAttribute(String attributeName)
attributeName - the attribute namepublic String generateString()
public Iterable<?> getRenderTokens()
getRenderTokens in class HeaderItemHeaderItem can be identified by. If any of the tokens has
already been rendered, this HeaderItem will not be rendered.public void render(Response response)
HeaderItemHeaderItem to the response.render in class HeaderItempublic static MetaDataHeaderItem forMetaTag(String name, String content)
name - the 'name' attribute of the tagcontent - the 'content' attribute of the tagMetaDataHeaderItempublic static MetaDataHeaderItem forMetaTag(IModel<String> name, IModel<String> content)
name - the 'name' attribute of the tag as String modelcontent - the 'content' attribute of the tag as String modelMetaDataHeaderItempublic static MetaDataHeaderItem forLinkTag(String rel, String href)
rel - the 'rel' attribute of the taghref - the 'href' attribute of the tagMetaDataHeaderItempublic static MetaDataHeaderItem forLinkTag(IModel<String> rel, IModel<String> href)
rel - the 'rel' attribute of the tag as String modelhref - the 'href' attribute of the tag as String modelMetaDataHeaderItemCopyright © 2006–2021 Apache Software Foundation. All rights reserved.