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
the link tag name
|
static String |
META_TAG
The meta tag name
|
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, getProvidedResources
public 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 HeaderItem
HeaderItem
can be identified by. If any of the tokens has
already been rendered, this HeaderItem
will not be rendered.public void render(Response response)
HeaderItem
HeaderItem
to the response.render
in class HeaderItem
public static MetaDataHeaderItem forMetaTag(String name, String content)
name
- the 'name' attribute of the tagcontent
- the 'content' attribute of the tagMetaDataHeaderItem
public 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 modelMetaDataHeaderItem
public static MetaDataHeaderItem forLinkTag(String rel, String href)
rel
- the 'rel' attribute of the taghref
- the 'href' attribute of the tagMetaDataHeaderItem
public 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 modelMetaDataHeaderItem
Copyright © 2006–2022 Apache Software Foundation. All rights reserved.