Package com.day.cq.wcm.foundation
Class Paragraph
- java.lang.Object
-
- org.apache.sling.api.resource.ResourceWrapper
-
- com.day.cq.wcm.foundation.Paragraph
-
public class Paragraph extends ResourceWrapper
Provides an abstraction of paragraph within a paragraph system.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Paragraph.Type
Type of the paragraph
-
Field Summary
-
Fields inherited from interface org.apache.sling.api.resource.Resource
RESOURCE_TYPE_NON_EXISTING
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <AdapterType>
AdapterTypeadaptTo(java.lang.Class<AdapterType> type)
Returns the value of callingadaptTo
on thewrapped resource
.java.lang.String
getBaseCssClass()
Returns the css class of this paragraph.int
getColNr()
Returns the columns number of this paragraph.java.lang.String
getCssClass()
Returns the auto generated css class for the column of this paragraph.int
getNumCols()
Returns the total number of columns of the column group this paragraph is in.Paragraph.Type
getType()
Returns the type of this paragraphvoid
setDiffInfo(DiffInfo di)
Set the diff information for this paragraph.java.lang.String
toString()
Returns a human readable string representation of this resource.-
Methods inherited from class org.apache.sling.api.resource.ResourceWrapper
getChild, getChildren, getName, getParent, getPath, getResource, getResourceMetadata, getResourceResolver, getResourceSuperType, getResourceType, getValueMap, hasChildren, isResourceType, listChildren
-
-
-
-
Method Detail
-
getType
public Paragraph.Type getType()
Returns the type of this paragraph- Returns:
- type of this paragraph
-
getColNr
public int getColNr()
Returns the columns number of this paragraph. Note thatParagraph.Type.BREAK
andParagraph.Type.END
paragraphs have the number of the next columns.- Returns:
- the columns number of this paragraph.
-
getNumCols
public int getNumCols()
Returns the total number of columns of the column group this paragraph is in.- Returns:
- the total number of columns.
-
getBaseCssClass
public java.lang.String getBaseCssClass()
Returns the css class of this paragraph.- Returns:
- the CSS class
-
getCssClass
public java.lang.String getCssClass()
Returns the auto generated css class for the column of this paragraph.- Returns:
- the CSS class
-
setDiffInfo
public void setDiffInfo(DiffInfo di)
Set the diff information for this paragraph.- Parameters:
di
- The diff information
-
adaptTo
public <AdapterType> AdapterType adaptTo(java.lang.Class<AdapterType> type)
Returns the value of callingadaptTo
on thewrapped resource
.- Specified by:
adaptTo
in interfaceAdaptable
- Overrides:
adaptTo
in classResourceWrapper
- Type Parameters:
AdapterType
- The generic type to which this object is adapted to- Parameters:
type
- The Class object of the target type, such asjavax.jcr.Node.class
orjava.io.File.class
- Returns:
- The adapter target or
null
if the object cannot adapt to the requested type
-
toString
public java.lang.String toString()
Returns a human readable string representation of this resource.- Overrides:
toString
in classResourceWrapper
-
-