Package org.rcsb.cif.model
Interface BlockBuilder<P extends CifFileBuilder>
- Type Parameters:
P- the parent builder type
- All Known Implementing Classes:
BlockBuilderImpl,CifCoreBlockBuilder,MmCifBlockBuilder
public interface BlockBuilder<P extends CifFileBuilder>
The specification of a builder for generic
Block instances.-
Method Summary
Modifier and Type Method Description BlockBuilder<P>addCategory(Category category)Add a category to this builder.Blockbuild()Build this block as a detached instance.voiddigest(CategoryBuilder<? extends BlockBuilder<P>,P> categoryBuilder)A hook to make this instance aware of the data in all child nodes.CategoryBuilder<? extends BlockBuilder<P>,P>enterCategory(String categoryName)Descend 1 level and enter a new Category.StringgetBlockHeader()The header of this block.Map<String,Category>getCategories()The category map of this builder (and Block about to be created).PleaveBlock()Leave this block and move back to the parent builder at CifFile level.
-
Method Details
-
enterCategory
Descend 1 level and enter a new Category.- Parameters:
categoryName- the name for this category- Returns:
- a parent-aware builder instance at category level
-
getBlockHeader
String getBlockHeader()The header of this block.- Returns:
- a String
-
getCategories
The category map of this builder (and Block about to be created).- Returns:
- a map with category names as keys and Category instances as values
-
digest
A hook to make this instance aware of the data in all child nodes.- Parameters:
categoryBuilder- the child builder to digest
-
leaveBlock
P leaveBlock()Leave this block and move back to the parent builder at CifFile level.- Returns:
- the parent builder
-
build
Block build()Build this block as a detached instance.- Returns:
- the Block described by this builder
-
addCategory
Add a category to this builder.- Parameters:
category- some category with data- Returns:
- this builder instance
-