Package org.rcsb.cif.model.builder
Class BlockBuilderImpl<P extends CifFileBuilder>
java.lang.Object
org.rcsb.cif.model.builder.BlockBuilderImpl<P>
- All Implemented Interfaces:
BlockBuilder<P>
- Direct Known Subclasses:
CifCoreBlockBuilder,MmCifBlockBuilder
public class BlockBuilderImpl<P extends CifFileBuilder> extends Object implements BlockBuilder<P>
-
Field Summary
-
Constructor Summary
Constructors Constructor Description BlockBuilderImpl(String blockName, P parent) -
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> builder)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.
-
Field Details
-
Constructor Details
-
Method Details
-
enterCategory
Description copied from interface:BlockBuilderDescend 1 level and enter a new Category.- Specified by:
enterCategoryin interfaceBlockBuilder<P extends CifFileBuilder>- Parameters:
categoryName- the name for this category- Returns:
- a parent-aware builder instance at category level
-
getBlockHeader
Description copied from interface:BlockBuilderThe header of this block.- Specified by:
getBlockHeaderin interfaceBlockBuilder<P extends CifFileBuilder>- Returns:
- a String
-
getCategories
Description copied from interface:BlockBuilderThe category map of this builder (and Block about to be created).- Specified by:
getCategoriesin interfaceBlockBuilder<P extends CifFileBuilder>- Returns:
- a map with category names as keys and Category instances as values
-
digest
Description copied from interface:BlockBuilderA hook to make this instance aware of the data in all child nodes.- Specified by:
digestin interfaceBlockBuilder<P extends CifFileBuilder>- Parameters:
builder- the child builder to digest
-
leaveBlock
Description copied from interface:BlockBuilderLeave this block and move back to the parent builder at CifFile level.- Specified by:
leaveBlockin interfaceBlockBuilder<P extends CifFileBuilder>- Returns:
- the parent builder
-
build
Description copied from interface:BlockBuilderBuild this block as a detached instance.- Specified by:
buildin interfaceBlockBuilder<P extends CifFileBuilder>- Returns:
- the Block described by this builder
-
addCategory
Description copied from interface:BlockBuilderAdd a category to this builder.- Specified by:
addCategoryin interfaceBlockBuilder<P extends CifFileBuilder>- Parameters:
category- some category with data- Returns:
- this builder instance
-