Package de.hsh.graja.util.comment
Class Sequence
- java.lang.Object
-
- de.hsh.graja.util.comment.Content
-
- de.hsh.graja.util.comment.AbstractSequenceContent
-
- de.hsh.graja.util.comment.Sequence
-
- All Implemented Interfaces:
ContentLogger
,Serializable
public class Sequence extends AbstractSequenceContent implements ContentLogger
A sequence is a list of items. Every contained item is rendered one after the other. Usually the contained items are paragraphs or more complex contents.
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class de.hsh.graja.util.comment.Content
EXCLUSIVE, renderUuid
-
-
Constructor Summary
Constructors Constructor Description Sequence(Content... initialItems)
Initialize as a collection with a few starting items added.Sequence(WhiteSpace whiteSpace, Content... initialItems)
Initialize as a collection with a few starting items added.Sequence(String idPrefix, Content... initialItems)
Initialize as a collection with a few starting items added.Sequence(String idPrefix, WhiteSpace whiteSpace, Content... initialItems)
Initialize as a collection with a few starting items added.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addItem(Content item)
Adds an item to the collection.void
addItems(Collection<? extends Content> items)
Adds several items to the collection by callingaddItem(Content)
method.void
clear()
Discards all items from the collection.boolean
equals(Object obj)
implements the contract ofObject.equals(Object)
.static Sequence
formatAsInlineNewlineSeq(IncludeSpec includeSpec, String msg)
List<Content>
getNestedContents()
int
hashCode()
implements the contract ofObject.hashCode()
.void
renderHtmlImpl(StringBuilder sb, IncludeInfo includeInfo, RenderContext ctx, boolean useJavascript)
appends all comments in the sequence one after the other without any visual marks between the individual items.void
renderPlainImpl(StringBuilder sb, IncludeInfo includeInfo, RenderContext ctx)
appends all comments in the sequence one after the other without any visual marks between the individual items.int
size()
-
Methods inherited from class de.hsh.graja.util.comment.Content
click, disableCallerStacktraceRecording, enableCallerStacktraceRecording, excludeGlobally, getIncludeSpec, getRenderUuid, getStackdump, hide, include, isCallerStacktraceRecordingEnabled, isHidden, isShowing, onClick, onClick, onHide, onHide, onLoad, onLoad, onShow, onShow, registerCallable, renderHtml, renderHtml, renderIdAttribute, renderJavascriptOncePerClass, renderOnClickAttribute, renderPlain, renderPlain, setGlobalIncludeInfo, setHref, setIncludeSpec, show, toString, toString
-
-
-
-
Constructor Detail
-
Sequence
public Sequence(String idPrefix, WhiteSpace whiteSpace, Content... initialItems)
Initialize as a collection with a few starting items added.- Parameters:
idPrefix
- an optional id prefixwhiteSpace
- the white space specificationinitialItems
- initial items that are added to the end of the collection.
-
Sequence
public Sequence(String idPrefix, Content... initialItems)
Initialize as a collection with a few starting items added.- Parameters:
idPrefix
- an optional id prefixinitialItems
- initial items that are added to the end of the collection.
-
Sequence
public Sequence(Content... initialItems)
Initialize as a collection with a few starting items added.- Parameters:
initialItems
- initial items that are added to the end of the collection.
-
Sequence
public Sequence(WhiteSpace whiteSpace, Content... initialItems)
Initialize as a collection with a few starting items added.- Parameters:
whiteSpace
- the white space specificationinitialItems
- initial items that are added to the end of the collection.
-
-
Method Detail
-
addItem
public void addItem(Content item)
Adds an item to the collection. If the item is excluded byAbstractSequenceContent#excludeGlobally(Content)
, then the item is not added and ignored.- Specified by:
addItem
in interfaceContentLogger
- Parameters:
item
- to be added
-
clear
public void clear()
Discards all items from the collection.
-
size
public int size()
- Returns:
- number of items in the collection. If the items are complex items by itself, the number of subitems is not counted. The return value simply is the number of direct children of this content node.
-
addItems
public void addItems(Collection<? extends Content> items)
Adds several items to the collection by callingaddItem(Content)
method.- Parameters:
items
- to be added
-
getNestedContents
public List<Content> getNestedContents()
- Specified by:
getNestedContents
in classContent
- Returns:
- returns an unmodifiable view of the collection
-
hashCode
public int hashCode()
implements the contract ofObject.hashCode()
.- Overrides:
hashCode
in classContent
- See Also:
Object.hashCode()
-
equals
public boolean equals(Object obj)
implements the contract ofObject.equals(Object)
.
-
renderHtmlImpl
public void renderHtmlImpl(StringBuilder sb, IncludeInfo includeInfo, RenderContext ctx, boolean useJavascript)
appends all comments in the sequence one after the other without any visual marks between the individual items.- Specified by:
renderHtmlImpl
in classContent
- Parameters:
sb
- HTML code resultincludeInfo
- controls, which content to be rendered.ctx
- render contextuseJavascript
- if true, the generated HTML code will contain Javascript- See Also:
Content#renderHtmlImpl(StringBuilder, IncludeInfo, RenderContext)
-
renderPlainImpl
public void renderPlainImpl(StringBuilder sb, IncludeInfo includeInfo, RenderContext ctx)
appends all comments in the sequence one after the other without any visual marks between the individual items.- Specified by:
renderPlainImpl
in classContent
- Parameters:
sb
- plain text resultincludeInfo
- controls, which content to be rendered.ctx
- render context (unused).- See Also:
Content.renderPlainImpl(StringBuilder, IncludeInfo, RenderContext)
-
formatAsInlineNewlineSeq
public static Sequence formatAsInlineNewlineSeq(IncludeSpec includeSpec, String msg)
-
-