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 Details

    • enterCategory

      CategoryBuilder<? extends BlockBuilder<P>,​P> enterCategory​(String categoryName)
      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

      Map<String,​Category> 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

      void digest​(CategoryBuilder<? extends BlockBuilder<P>,​P> categoryBuilder)
      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

      BlockBuilder<P> addCategory​(Category category)
      Add a category to this builder.
      Parameters:
      category - some category with data
      Returns:
      this builder instance