Package com.day.cq.wcm.commons.policy
Class ContentPolicyStyle
- java.lang.Object
-
- com.day.cq.wcm.commons.policy.ContentPolicyStyle
-
public class ContentPolicyStyle extends java.lang.Object implements Style
A compatibility wrapper using a content policy as a style. The goal is to use components using the currentStyle binding with the new content policies, without the need to change the component. This will not be a complete style implementation but rather focuses on the reading of the map values.- Since:
- 6.1
-
-
Constructor Summary
Constructors Constructor Description ContentPolicyStyle(ContentPolicy contentPolicy, Cell cell)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()booleancontainsKey(java.lang.Object o)booleancontainsValue(java.lang.Object o)java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Object>>entrySet()java.lang.Objectget(java.lang.Object o)<T> Tget(java.lang.String name, java.lang.Class<T> type)Return named value converted to type T ornullif not existing.<T> Tget(java.lang.String name, T defaultValue)return named value converted to the type T of the default value or the default value if the named value does not existCellgetCell()Returns the cell of this stylejava.lang.StringgetDefiningPath(java.lang.String name)Returns the cell path that defines the style property with the given name.ResourcegetDefiningResource(java.lang.String name)Returns the resource that defines the style property with the given name.DesigngetDesign()Returns the design this style is defined in.java.lang.StringgetPath()Returns the path to this cell resourceStylegetSubStyle(java.lang.String relPath)Returns a sub style for the give one, by virtually extending the cell stack.booleanisEmpty()java.util.Set<java.lang.String>keySet()java.lang.Objectput(java.lang.String s, java.lang.Object o)voidputAll(java.util.Map<? extends java.lang.String,?> map)java.lang.Objectremove(java.lang.Object o)intsize()java.util.Collection<java.lang.Object>values()
-
-
-
Constructor Detail
-
ContentPolicyStyle
public ContentPolicyStyle(ContentPolicy contentPolicy, Cell cell)
-
-
Method Detail
-
getDesign
public Design getDesign()
Description copied from interface:StyleReturns the design this style is defined in.
-
getPath
public java.lang.String getPath()
Description copied from interface:StyleReturns the path to this cell resource
-
getCell
public Cell getCell()
Description copied from interface:StyleReturns the cell of this style
-
get
public <T> T get(java.lang.String name, java.lang.Class<T> type)Description copied from interface:StyleReturn named value converted to type T ornullif not existing. Please note that this also supports aResourceclass as type in order to retrieve a style resource (e.g. image)
-
get
public <T> T get(java.lang.String name, T defaultValue)Description copied from interface:Stylereturn named value converted to the type T of the default value or the default value if the named value does not exist
-
getDefiningResource
public Resource getDefiningResource(java.lang.String name)
Description copied from interface:StyleReturns the resource that defines the style property with the given name.- Specified by:
getDefiningResourcein interfaceStyle- Parameters:
name- name of the style property- Returns:
- resource or
null
-
getDefiningPath
public java.lang.String getDefiningPath(java.lang.String name)
Description copied from interface:StyleReturns the cell path that defines the style property with the given name.- Specified by:
getDefiningPathin interfaceStyle- Parameters:
name- name of the style property- Returns:
- path or
null
-
getSubStyle
public Style getSubStyle(java.lang.String relPath)
Description copied from interface:StyleReturns a sub style for the give one, by virtually extending the cell stack.- Specified by:
getSubStylein interfaceStyle- Parameters:
relPath- relative path of the sub style.- Returns:
- the new style
-
size
public int size()
- Specified by:
sizein interfacejava.util.Map<java.lang.String,java.lang.Object>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfacejava.util.Map<java.lang.String,java.lang.Object>
-
containsKey
public boolean containsKey(java.lang.Object o)
- Specified by:
containsKeyin interfacejava.util.Map<java.lang.String,java.lang.Object>
-
containsValue
public boolean containsValue(java.lang.Object o)
- Specified by:
containsValuein interfacejava.util.Map<java.lang.String,java.lang.Object>
-
get
public java.lang.Object get(java.lang.Object o)
- Specified by:
getin interfacejava.util.Map<java.lang.String,java.lang.Object>
-
put
public java.lang.Object put(java.lang.String s, java.lang.Object o)- Specified by:
putin interfacejava.util.Map<java.lang.String,java.lang.Object>
-
remove
public java.lang.Object remove(java.lang.Object o)
- Specified by:
removein interfacejava.util.Map<java.lang.String,java.lang.Object>
-
putAll
public void putAll(java.util.Map<? extends java.lang.String,?> map)
- Specified by:
putAllin interfacejava.util.Map<java.lang.String,java.lang.Object>
-
clear
public void clear()
- Specified by:
clearin interfacejava.util.Map<java.lang.String,java.lang.Object>
-
keySet
public java.util.Set<java.lang.String> keySet()
- Specified by:
keySetin interfacejava.util.Map<java.lang.String,java.lang.Object>
-
values
public java.util.Collection<java.lang.Object> values()
- Specified by:
valuesin interfacejava.util.Map<java.lang.String,java.lang.Object>
-
entrySet
public java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Object>> entrySet()
- Specified by:
entrySetin interfacejava.util.Map<java.lang.String,java.lang.Object>
-
-