Class ResponsiveColumn
- java.lang.Object
-
- org.apache.sling.api.adapter.SlingAdaptable
-
- org.apache.sling.api.resource.AbstractResource
-
- com.day.cq.wcm.foundation.model.responsivegrid.ResponsiveColumn
-
- All Implemented Interfaces:
ComponentExporter
,ResponsiveColumnExporter
,Adaptable
,Resource
@ProviderType public class ResponsiveColumn extends AbstractResource implements ResponsiveColumnExporter
Represents a column of a responsive grid. A responsive grid's column is basically a virtual wrapper of a component that is part of the grid.
-
-
Field Summary
-
Fields inherited from interface org.apache.sling.api.resource.Resource
RESOURCE_TYPE_NON_EXISTING
-
-
Constructor Summary
Constructors Constructor Description ResponsiveColumn(Resource resource, java.util.Map<java.lang.String,Breakpoint> gridBreakpoints, java.lang.String classNamePrefix)
ResponsiveColumn(Resource resource, java.util.Map<java.lang.String,Breakpoint> gridBreakpoints, java.lang.String classNamePrefix, SlingHttpServletRequest slingRequest, ModelFactory modelFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.util.Map<java.lang.String,Breakpoint>
getBreakpoints()
java.lang.String
getColumnClassNames()
java.lang.Integer
getColumnCount(java.lang.String breakpointName)
Deprecated.java.lang.String
getCssClass()
Deprecated.ComponentExporter
getExportedComponent()
java.lang.String
getExportedType()
Returns the type of the resource for which the export is performed.java.util.Set<java.lang.String>
getMissingBreakpointNames()
Deprecated.UsegetBreakpoints()
java.lang.String
getPath()
Returns the absolute path of this resource in the resource tree.ValueMap
getProperties()
Deprecated.Resource
getResource()
ResourceMetadata
getResourceMetadata()
Deprecated.ResourceResolver
getResourceResolver()
Deprecated.java.lang.String
getResourceSuperType()
Deprecated.java.lang.String
getResourceType()
Deprecated.-
Methods inherited from class org.apache.sling.api.resource.AbstractResource
getChild, getChildren, getName, getParent, getValueMap, hasChildren, isResourceType, listChildren
-
Methods inherited from class org.apache.sling.api.adapter.SlingAdaptable
adaptTo, setAdapterManager, unsetAdapterManager
-
-
-
-
Constructor Detail
-
ResponsiveColumn
public ResponsiveColumn(Resource resource, java.util.Map<java.lang.String,Breakpoint> gridBreakpoints, java.lang.String classNamePrefix)
-
ResponsiveColumn
public ResponsiveColumn(Resource resource, java.util.Map<java.lang.String,Breakpoint> gridBreakpoints, java.lang.String classNamePrefix, SlingHttpServletRequest slingRequest, ModelFactory modelFactory)
-
-
Method Detail
-
getBreakpoints
public java.util.Map<java.lang.String,Breakpoint> getBreakpoints()
- Specified by:
getBreakpoints
in interfaceResponsiveColumnExporter
- Returns:
- A map of
Breakpoint
s associated with the column. The keys of the map are the breakpoint names.
-
getColumnClassNames
public java.lang.String getColumnClassNames()
- Specified by:
getColumnClassNames
in interfaceResponsiveColumnExporter
- Returns:
- The CSS class names associated with the column.
-
getExportedComponent
@Nonnull public ComponentExporter getExportedComponent()
- Specified by:
getExportedComponent
in interfaceResponsiveColumnExporter
- Returns:
- Returns the actual component model that is wrapped inside of the responsive column. This is useful when performing a JSON export of the responsive grid; in such case, responsive child columns act as wrappers for the actual components that are part of the grid.
-
getExportedType
@Nonnull public java.lang.String getExportedType()
Description copied from interface:ResponsiveColumnExporter
Returns the type of the resource for which the export is performed.
NOTE: methods whose JSON serialization would lead to the same JSON property name (":type") will not be serialized.
- Specified by:
getExportedType
in interfaceComponentExporter
- Specified by:
getExportedType
in interfaceResponsiveColumnExporter
- Returns:
- the type of the component
-
getResource
@Nonnull public Resource getResource()
- Returns:
- The wrapped
Resource
associated with the column.
-
getPath
@Nonnull public java.lang.String getPath()
Description copied from interface:Resource
Returns the absolute path of this resource in the resource tree.
-
getCssClass
@Deprecated public java.lang.String getCssClass()
Deprecated.
-
getMissingBreakpointNames
@Deprecated public java.util.Set<java.lang.String> getMissingBreakpointNames()
Deprecated.UsegetBreakpoints()
-
getColumnCount
@Deprecated public java.lang.Integer getColumnCount(java.lang.String breakpointName)
Deprecated.Returns the number of columns for the given breakpoint name- Parameters:
breakpointName
- The name of the breakpoint- Returns:
- The number of columns for given breakpoint name.
-
getResourceType
@Nonnull @Deprecated public java.lang.String getResourceType()
Deprecated.Description copied from interface:Resource
The resource type is meant to point to rendering/processing scripts, editing dialogs, etc. It is usually a path in the repository, where scripts and other tools definitions are found, but theResourceResolver
is free to set this to any suitable value such as the primary node type of the JCR node from which the resource is created.If the resource instance represents a resource which is not actually existing, this method returns
Resource.RESOURCE_TYPE_NON_EXISTING
.- Specified by:
getResourceType
in interfaceResource
- Returns:
- The resource type
-
getResourceSuperType
@Deprecated public java.lang.String getResourceSuperType()
Deprecated.Description copied from interface:Resource
Returns the super type of the resource if the resource defines its own super type. Otherwisenull
is returned. A resource might return a resource super type to overwrite the resource type hierarchy. If a client is interested in the effective resource super type of a resource, it should callResourceResolver.getParentResourceType(Resource)
.- Specified by:
getResourceSuperType
in interfaceResource
- Returns:
- The super type of the resource or
null
.
-
getResourceMetadata
@Nonnull @Deprecated public ResourceMetadata getResourceMetadata()
Deprecated.Description copied from interface:Resource
Returns the meta data of this resource. The concrete data contained in theResourceMetadata
object returned is implementation specific except for theResourceMetadata.RESOLUTION_PATH
property which is required to be set to the part of the request URI used to resolve the resource.- Specified by:
getResourceMetadata
in interfaceResource
- Returns:
- The resource meta data
- See Also:
ResourceMetadata
-
getResourceResolver
@Nonnull @Deprecated public ResourceResolver getResourceResolver()
Deprecated.Description copied from interface:Resource
Returns theResourceResolver
from which this resource has been retrieved.- Specified by:
getResourceResolver
in interfaceResource
- Returns:
- The resource resolver
-
getProperties
@Deprecated public ValueMap getProperties()
Deprecated.
-
-