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
ConstructorsConstructorDescriptionResponsiveColumn
(Resource resource, Map<String, Breakpoint> gridBreakpoints, String classNamePrefix) ResponsiveColumn
(Resource resource, Map<String, Breakpoint> gridBreakpoints, String classNamePrefix, SlingHttpServletRequest slingRequest, ModelFactory modelFactory) -
Method Summary
Modifier and TypeMethodDescriptiongetColumnCount
(String breakpointName) Deprecated.Deprecated.Returns the type of the resource for which the export is performed.Deprecated.UsegetBreakpoints()
getPath()
Returns the absolute path of this resource in the resource tree.Deprecated.Deprecated.Deprecated.Deprecated.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 Details
-
ResponsiveColumn
public ResponsiveColumn(Resource resource, Map<String, Breakpoint> gridBreakpoints, String classNamePrefix) -
ResponsiveColumn
public ResponsiveColumn(Resource resource, Map<String, Breakpoint> gridBreakpoints, String classNamePrefix, SlingHttpServletRequest slingRequest, ModelFactory modelFactory)
-
-
Method Details
-
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
- Specified by:
getColumnClassNames
in interfaceResponsiveColumnExporter
- Returns:
- The CSS class names associated with the column.
-
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
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
- Returns:
- The wrapped
Resource
associated with the column.
-
getPath
Description copied from interface:Resource
Returns the absolute path of this resource in the resource tree. -
getCssClass
Deprecated. -
getMissingBreakpointNames
Deprecated.UsegetBreakpoints()
-
getColumnCount
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
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.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
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:
-
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.
-
getColumnClassNames()