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
Interface representing a DSC event. A DSC event can be a DSC comment, a PostScript comment
or a line of PostScript code.
-
Field Summary
Fields inherited from interface org.apache.xmlgraphics.ps.dsc.DSCParserConstants
COMMENT, DSC_COMMENT, EOF, HEADER_COMMENT, LINE
-
Method Summary
Modifier and TypeMethodDescriptionCasts this instance to a DSCComment if possible.asLine()
Casts this instance to a PostScriptLine if possible.void
generate
(PSGenerator gen) Writes the event to the given PSGenerator.int
Returns the event type.boolean
Indicates whether the instance is a PostScript comment.boolean
Indicates whether the instance is a DSC comment.boolean
Indicates whether the instance is a header comment.boolean
isLine()
Indicates whether the instance is a PostScript line.
-
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
Writes the event to the given PSGenerator.- Parameters:
gen
- the PSGenerator to write to- Throws:
IOException
- In case of an I/O error
-