public interface PageWriter
Pageable
connectors.Modifier and Type | Field and Description |
---|---|
static long |
UNKNOWN_TOTAL_SIZE
A constant that should be used by
addPage(String, int, long, long) and
addPage(String, String, long, long) to signal that the number of children is either unknown or too large to
compute. |
Modifier and Type | Method and Description |
---|---|
PageWriter |
addChild(String id,
Name name)
Add a child with the given id and name to the underlying document.
|
PageWriter |
addChild(String id,
String name)
Add a child with the given id and name to the underlying document.
|
PageWriter |
addPage(String parentId,
int nextPageOffset,
long blockSize,
long totalChildCount)
Create a reference to a separate page of children in its underlying document.
|
PageWriter |
addPage(String parentId,
String nextPageOffset,
long blockSize,
long totalChildCount)
Create a reference to a separate page of children in its underlying document.
|
EditableDocument |
document()
Returns the underlying document.
|
PageWriter |
removeChild(String id)
Remove a child from this document.
|
PageWriter |
setChildren(LinkedHashMap<String,Name> children)
Set an ordered of (childId, childName) for the underlying document.
|
PageWriter |
setChildren(List<? extends Document> children)
Set the list of children for the underlying document.
|
static final long UNKNOWN_TOTAL_SIZE
addPage(String, int, long, long)
and
addPage(String, String, long, long)
to signal that the number of children is either unknown or too large to
compute.PageWriter addChild(String id, String name)
id
- the new child's id; may not be nullname
- the new child's name; may not be nullPageWriter addChild(String id, Name name)
id
- the new child's id; may not be nullname
- the new child's name; may not be nullPageWriter removeChild(String id)
id
- the identifier of the childPageWriter setChildren(List<? extends Document> children)
children
- a list of EditableDocument
instances each describing a single child; may not be nullPageWriter setChildren(LinkedHashMap<String,Name> children)
The passed map does not contain any explicit information about same name siblings, so a connector would need to handle that logic.
children
- a map of (childId, childName) pairs; may not be nullPageWriter addPage(String parentId, String nextPageOffset, long blockSize, long totalChildCount)
parentId
- a non-null
String representing the identifier of the parent (owning) documentnextPageOffset
- a non-null
String representing the offset of the next page. The meaning of the offset isn't
defined and it's up to each connector to define it.blockSize
- an integer which indicates the size of the next block of childrentotalChildCount
- an integer which indicates the total number of children; should be UNKNOWN_TOTAL_SIZE
if
the number of children is unknown, too large to compute efficiently, or to signal that the repository should use the
Connector.getChildReference(String, String)
method to find the child reference for a parent and a (supposed)
child node.Connector.getChildReference(String, String)
PageWriter addPage(String parentId, int nextPageOffset, long blockSize, long totalChildCount)
parentId
- a non-null
String representing the identifier of the parent (owning) documentnextPageOffset
- a non-null
int representing a numeric offset of the next page.blockSize
- an integer which indicates the size of the next block of childrentotalChildCount
- an integer which indicates the total number of children; should be UNKNOWN_TOTAL_SIZE
if
the number of children is unknown, too large to compute efficiently, or to signal that the repository should use the
Connector.getChildReference(String, String)
method to find the child reference for a parent and a (supposed)
child node.Connector.getChildReference(String, String)
EditableDocument document()
EditableDocument
instance; never nullCopyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.