public class MicrodataAttributeHelperImpl extends Object implements MicrodataAttributeHelper
| Constructor and Description |
|---|
MicrodataAttributeHelperImpl(org.apache.sling.api.resource.ResourceResolver resolver,
HApiType type)
Get a new microdata html attributes helper for the given HApiType object.
|
| Modifier and Type | Method and Description |
|---|---|
Map<String,Map<String,String>> |
allItemPropMap()
Get a map of maps with the HTMl attributes for each property of the type defined through
a new
MicrodataAttributeHelper |
Map<String,String> |
allPropTypesMap()
Get a map of types for each type property.
|
String |
itemprop(String propName)
Calls
MicrodataAttributeHelper.itemprop(String, boolean) with 'withType' true |
String |
itemprop(String propName,
boolean withType)
Calls
MicrodataAttributeHelper.itempropMap(String, boolean) and normalizes the map into a String of the form 'attr1="val1" attr2="val2"' |
Map<String,String> |
itempropMap(String propName,
boolean withType)
Get a map with the HTMl attributes for the given property of the type defined through
a new
MicrodataAttributeHelper |
String |
itemtype()
Calls
MicrodataAttributeHelper.itemtypeMap() and normalizes the map into a String of the form 'attr1="val1" attr2="val2"' |
Map<String,String> |
itemtypeMap()
Get a map with the HTMl attributes for a new item of the type defined through
a new
MicrodataAttributeHelper object |
public MicrodataAttributeHelperImpl(org.apache.sling.api.resource.ResourceResolver resolver,
HApiType type)
Provides convenience methods to get the html attributes needed for instrumenting the markup with a Hypermedia API
resolver - type - public String itemtype()
MicrodataAttributeHelper.itemtypeMap() and normalizes the map into a String of the form 'attr1="val1" attr2="val2"'itemtype in interface MicrodataAttributeHelperpublic Map<String,String> itemtypeMap()
MicrodataAttributeHelper object
The key is the HTMl attribute name and the value is the HTML attribute value
itemtypeMap in interface MicrodataAttributeHelperpublic String itemprop(String propName)
MicrodataAttributeHelper.itemprop(String, boolean) with 'withType' trueitemprop in interface MicrodataAttributeHelperpublic String itemprop(String propName, boolean withType)
MicrodataAttributeHelper.itempropMap(String, boolean) and normalizes the map into a String of the form 'attr1="val1" attr2="val2"'itemprop in interface MicrodataAttributeHelperpublic Map<String,String> itempropMap(String propName, boolean withType)
MicrodataAttributeHelper
The key is the HTMl attribute name and the value is the HTML attribute value
Will through a HApiException
runtime exception if the property propName does not exist for the type
itempropMap in interface MicrodataAttributeHelperpropName - the name of the propertywithType - whether to include the 'itemtype' attributepublic Map<String,Map<String,String>> allItemPropMap()
MicrodataAttributeHelper
The key is the property name and the value is a map of attributes like the one returned
by MicrodataAttributeHelper.itempropMap(String, boolean)
allItemPropMap in interface MicrodataAttributeHelperpublic Map<String,String> allPropTypesMap()
The key is the property name and the value is the type path identifier of that property
allPropTypesMap in interface MicrodataAttributeHelperCopyright © 2007–2017 The Apache Software Foundation. All rights reserved.