org.apache.xmlgraphics.ps.dsc.events

## Class PostScriptComment

- java.lang.Object
- - org.apache.xmlgraphics.ps.dsc.events.AbstractEvent
  - - org.apache.xmlgraphics.ps.dsc.events.PostScriptComment

- All Implemented Interfaces:
    DSCParserConstants, DSCEvent

      public class PostScriptComment
      extends AbstractEvent

  Represents a PostScript comment

- - ### Field Summary

    - ### Fields inherited from interface org.apache.xmlgraphics.ps.dsc.DSCParserConstants

      `COMMENT, DSC_COMMENT, EOF, HEADER_COMMENT, LINE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PostScriptComment(java.lang.String comment)` Creates a new instance.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `generate(PSGenerator gen)` Writes the event to the given PSGenerator.
    `java.lang.String` | `getComment()` Returns the comment text.
    `int` | `getEventType()` Returns the event type.
    `boolean` | `isComment()` Indicates whether the instance is a PostScript comment.

    - ### Methods inherited from class org.apache.xmlgraphics.ps.dsc.events.AbstractEvent

      `asDSCComment, asLine, isDSCComment, isHeaderComment, isLine`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### PostScriptComment

          public PostScriptComment(java.lang.String comment)

      Creates a new instance.
      Parameters:
        `comment` - the comment

  - ### Method Detail

    - #### getComment

          public java.lang.String getComment()

      Returns the comment text.
      Returns:
        the comment (without the "%" prefix)

    - #### generate

          public void generate(PSGenerator gen)
                        throws java.io.IOException

      Description copied from interface: `DSCEvent`
      Writes the event to the given PSGenerator.
      Parameters:
        `gen` - the PSGenerator to write to
      Throws:
        `java.io.IOException` - In case of an I/O error
      See Also:
        `DSCEvent.generate(org.apache.xmlgraphics.ps.PSGenerator)`

    - #### getEventType

          public int getEventType()

      Description copied from interface: `DSCEvent`
      Returns the event type.
      Returns:
        the event type (see `DSCParserConstants`)
      See Also:
        `DSCEvent.getEventType()`

    - #### isComment

          public boolean isComment()

      Description copied from interface: `DSCEvent`
      Indicates whether the instance is a PostScript comment.
      Specified by:
        `isComment` in interface `DSCEvent`
      Overrides:
        `isComment` in class `AbstractEvent`
      Returns:
        true if the instance is a PostScript comment
      See Also:
        `AbstractEvent.isComment()`

Copyright 1999-2025 The Apache Software Foundation. All Rights Reserved.