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 classParagraph.TypeType 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 callingadaptToon thewrapped resource.java.lang.StringgetBaseCssClass()Returns the css class of this paragraph.intgetColNr()Returns the columns number of this paragraph.java.lang.StringgetCssClass()Returns the auto generated css class for the column of this paragraph.intgetNumCols()Returns the total number of columns of the column group this paragraph is in.Paragraph.TypegetType()Returns the type of this paragraphvoidsetDiffInfo(DiffInfo di)Set the diff information for this paragraph.java.lang.StringtoString()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.BREAKandParagraph.Type.ENDparagraphs 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 callingadaptToon thewrapped resource.- Specified by:
adaptToin interfaceAdaptable- Overrides:
adaptToin 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.classorjava.io.File.class- Returns:
- The adapter target or
nullif the object cannot adapt to the requested type
-
toString
public java.lang.String toString()
Returns a human readable string representation of this resource.- Overrides:
toStringin classResourceWrapper
-
-