Interface DSCEvent

All Superinterfaces:
DSCParserConstants
All Known Subinterfaces:
DSCComment
All Known Implementing Classes:
AbstractDSCComment, AbstractEvent, AbstractResourceDSCComment, AbstractResourcesDSCComment, DSCAtend, DSCCommentBeginDocument, DSCCommentBeginResource, DSCCommentBoundingBox, DSCCommentDocumentNeededResources, DSCCommentDocumentSuppliedResources, DSCCommentEndComments, DSCCommentEndOfFile, DSCCommentHiResBoundingBox, DSCCommentIncludeResource, DSCCommentLanguageLevel, DSCCommentPage, DSCCommentPageBoundingBox, DSCCommentPageHiResBoundingBox, DSCCommentPageResources, DSCCommentPages, DSCCommentTitle, DSCHeaderComment, PostScriptComment, PostScriptLine, UnparsedDSCComment

public interface DSCEvent extends DSCParserConstants
Interface representing a DSC event. A DSC event can be a DSC comment, a PostScript comment or a line of PostScript code.
  • Method Details

    • getEventType

      int getEventType()
      Returns the event type.
      Returns:
      the event type (see DSCParserConstants)
    • asDSCComment

      DSCComment asDSCComment()
      Casts this instance to a DSCComment if possible.
      Returns:
      this event as a DSCComment
      Throws:
      ClassCastException - if the event is no DSCComment
    • asLine

      PostScriptLine asLine()
      Casts this instance to a PostScriptLine if possible.
      Returns:
      this event as a PostScriptLine
      Throws:
      ClassCastException - if the event is no PostScriptLine
    • isDSCComment

      boolean isDSCComment()
      Indicates whether the instance is a DSC comment.
      Returns:
      true if the instance is a DSC comment
    • isComment

      boolean isComment()
      Indicates whether the instance is a PostScript comment.
      Returns:
      true if the instance is a PostScript comment
    • isHeaderComment

      boolean isHeaderComment()
      Indicates whether the instance is a header comment.
      Returns:
      true if the instance is a header comment
    • isLine

      boolean isLine()
      Indicates whether the instance is a PostScript line.
      Returns:
      true if the instance is a PostScript line
    • generate

      void generate(PSGenerator gen) throws IOException
      Writes the event to the given PSGenerator.
      Parameters:
      gen - the PSGenerator to write to
      Throws:
      IOException - In case of an I/O error