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
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:
-
Field Summary
Fields inherited from class de.hsh.graja.util.comment.Content
EXCLUSIVE, renderUuid
-
Constructor Summary
ConstructorsConstructorDescriptionInitialize as a collection with a few starting items added.Sequence
(WhiteSpace whiteSpace, Content... initialItems) Initialize as a collection with a few starting items added.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
Modifier and TypeMethodDescriptionvoid
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
implements the contract ofObject.equals(Object)
.static Sequence
formatAsInlineNewlineSeq
(IncludeSpec includeSpec, String msg) 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.AbstractSequenceContent
isInlineContent
Methods inherited from class de.hsh.graja.util.comment.Content
click, dehighlight, disableCallerStacktraceRecording, enableCallerStacktraceRecording, excludeGlobally, getIncludeSpec, getRenderUuid, getStackdump, hide, highlight, 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 Details
-
Sequence
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
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
Initialize as a collection with a few starting items added.- Parameters:
initialItems
- initial items that are added to the end of the collection.
-
Sequence
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 Details
-
addItem
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
Adds several items to the collection by callingaddItem(Content)
method.- Parameters:
items
- to be added
-
getNestedContents
- Specified by:
getNestedContents
in classContent
- Returns:
- returns an unmodifiable view of the collection
-
hashCode
public int hashCode()implements the contract ofObject.hashCode()
. -
equals
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
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:
-
formatAsInlineNewlineSeq
-