public class OutputDocument extends Object
Modifier and Type | Class and Description |
---|---|
static class |
OutputDocument.Bookmark
Container for bookmark information.
|
Constructor and Description |
---|
OutputDocument() |
Modifier and Type | Method and Description |
---|---|
void |
addDependency(String section,
String value)
Adds a dependency to a dependency list identified by [section] without checking if the dependency already
exists.
|
boolean |
ensureBookmark(String identifier,
int position,
boolean requiresCodeBlock)
Make sure a bookmark for the [identifier] exists.
|
void |
ensureDependency(String section,
String value)
Makes sure a dependency ([value]) exists in a dependency list identified by [section].
|
String |
getBody()
Returns the body as it was produced by the tag handlers.
|
OutputDocument.Bookmark |
getBookmark(String identifier)
Returns the bookmark for the given identifier.
|
List |
getBookmarks()
Gives an ordered list of Bookmark objects.
|
List |
getDependencies(String section)
Returns the list of dependencies identified by [section].
|
protected Collection |
getDependencySections()
All unique sections currently present.
|
void |
removeDependency(String section,
String value)
Removes an existing dependency.
|
void |
setBookmark(String identifier,
boolean requiresCodeBlock)
Marks the current position using an identifier.
|
protected void |
updateBookmarks(int offsetAmount,
boolean topLevel)
Updates all (if any) currently still relative bookmark positions.
|
protected void |
write(String data)
Use by the framework to write the body data after tag processing is completed.
|
protected void |
writeDocumentTo(OutputStream target)
For debug purposes only.
|
public void addDependency(String section, String value)
section
- identifier for the list you want to add the value tovalue
- value to add to the dependency listpublic void ensureDependency(String section, String value)
section
- identifier for the list you want to add the value tovalue
- value to add to the dependency listpublic void removeDependency(String section, String value)
section
- identifier for the list you want to remove the value fromvalue
- value that is to be removedpublic List getDependencies(String section)
A dependency list is a collection of (unique) statements, for example a list of imports for a jsp/.net page
section
- identifier for the list you want to retrieveprotected Collection getDependencySections()
protected void write(String data)
data
- string data to append to the body.public String getBody()
public void setBookmark(String identifier, boolean requiresCodeBlock)
This position will be relative at first and resolved to an absolute position while processing the tcdl data. It is absolute once the tag and its parent tags are closed (and only then)
identifier
- the identifierpublic OutputDocument.Bookmark getBookmark(String identifier)
Note that the position of a bookmark is only known after all parent tags in which the bookmark is done have finished processing (e.g. after their closing tag).
identifier
- the identifierpublic boolean ensureBookmark(String identifier, int position, boolean requiresCodeBlock)
identifier
- the identifierposition
- the positionrequiresCodeBlock
- boolean indicating code block is requiredpublic List getBookmarks()
protected void updateBookmarks(int offsetAmount, boolean topLevel)
offsetAmount
- the offset amounttopLevel
- boolean indicating top levelprotected void writeDocumentTo(OutputStream target) throws IOException
target
- the output streamIOException
Copyright (c) 2014-2021 All Rights Reserved by the RWS Group for and on behalf of its affiliates and subsidiaries