Class RecordContainer

java.lang.Object
org.apache.poi.hslf.record.Record
org.apache.poi.hslf.record.RecordContainer
All Implemented Interfaces:
GenericRecord
Direct Known Subclasses:
AnimationInfo, Comment2000, DocInfoListContainer, DummyRecordWithChildren, EscherTextboxWrapper, ExEmbed, ExHyperlink, ExMCIMovie, ExObjList, ExVideoContainer, FontCollection, HeadersFootersContainer, InteractiveInfo, PositionDependentRecordContainer, SlideListWithText, Sound, SoundCollection, VBAInfoContainer

public abstract class RecordContainer extends Record
Abstract class which all container records will extend. Providers helpful methods for writing child records out to disk
  • Constructor Details

    • RecordContainer

      public RecordContainer()
  • Method Details

    • getChildRecords

      public Record[] getChildRecords()
      Return any children
      Specified by:
      getChildRecords in class Record
    • isAnAtom

      public boolean isAnAtom()
      We're not an atom
      Specified by:
      isAnAtom in class Record
    • findFirstOfType

      public Record findFirstOfType(long type)
      Finds the first child record of the given type, or null if none of the child records are of the given type. Does not descend.
    • removeChild

      public Record removeChild(Record ch)
      Remove a child record from this record container
      Parameters:
      ch - the child to remove
      Returns:
      the removed record
    • appendChildRecord

      public int appendChildRecord(Record newChild)
      Add a new child record onto a record's list of children.
      Parameters:
      newChild - the child record to be added
      Returns:
      the position of the added child within the list, i.e. the last index
    • addChildAfter

      public int addChildAfter(Record newChild, Record after)
      Adds the given Child Record after the supplied record
      Parameters:
      newChild - The record to add as new child.
      after - The record after which the given record should be added.
      Returns:
      the position of the added child within the list
    • addChildBefore

      public int addChildBefore(Record newChild, Record before)
      Adds the given Child Record before the supplied record
      Parameters:
      newChild - The record to add as new child.
      before - The record before which the given record should be added.
      Returns:
      the position of the added child within the list
    • setChildRecord

      public void setChildRecord(Record[] records)
      Set child records.
      Parameters:
      records - the new child records
    • writeOut

      public void writeOut(byte headerA, byte headerB, long type, Record[] children, OutputStream out) throws IOException
      Write out our header, and our children.
      Parameters:
      headerA - the first byte of the header
      headerB - the second byte of the header
      type - the record type
      children - our child records
      out - the stream to write to
      Throws:
      IOException
    • handleParentAwareRecords

      public static void handleParentAwareRecords(RecordContainer br)
      Find the records that are parent-aware, and tell them who their parent is
    • getGenericProperties

      public Map<String,Supplier<?>> getGenericProperties()