Interface CifFileBuilder

All Known Implementing Classes:
CifCoreFileBuilder, CifFileBuilderImpl, MmCifFileBuilder

public interface CifFileBuilder
The specification of a builder for generic CifFile instances.
  • Method Details

    • enterBlock

      BlockBuilder<? extends CifFileBuilder> enterBlock​(String blockHeader)
      Descend 1 level and enter a new Block.
      Parameters:
      blockHeader - the name for this block (usually the structure ID)
      Returns:
      a parent-aware builder instance at block level
    • leaveFile

      CifFile leaveFile()
      Leave this builder instance. As this is the top-level and no parent exists, return the finished CifFile instance.
      Returns:
      a CifFile instance
    • build

      CifFile build()
      Build the file described by this builder.
      Returns:
      a CifFile instance
    • addBlock

      CifFileBuilder addBlock​(Block block)
      Add a block to this builder.
      Parameters:
      block - some block with data
      Returns:
      this builder instance
    • digest

      void digest​(BlockBuilder<? extends CifFileBuilder> blockBuilder)
      A hook to make this instance aware of the data in all child nodes.
      Parameters:
      blockBuilder - the child builder to digest
    • as

      default <F extends CifFile,​ B extends CifFileBuilder> B as​(SchemaProvider<F,​B> schemaProvider)
      Specify a schema for this build operation.
      Type Parameters:
      F - the type of file that is being build
      B - the type of builder that does the work
      Parameters:
      schemaProvider - the schema to use - see StandardSchemata
      Returns:
      a schema-aware builder instance