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.
-
-
Field Summary
-
Fields inherited from interface org.apache.xmlgraphics.ps.dsc.DSCParserConstants
COMMENT, DSC_COMMENT, EOF, HEADER_COMMENT, LINE
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DSCCommentasDSCComment()Casts this instance to a DSCComment if possible.PostScriptLineasLine()Casts this instance to a PostScriptLine if possible.voidgenerate(PSGenerator gen)Writes the event to the given PSGenerator.intgetEventType()Returns the event type.booleanisComment()Indicates whether the instance is a PostScript comment.booleanisDSCComment()Indicates whether the instance is a DSC comment.booleanisHeaderComment()Indicates whether the instance is a header comment.booleanisLine()Indicates whether the instance is a PostScript line.
-
-
-
Method Detail
-
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:
java.lang.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:
java.lang.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 java.io.IOException
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
-
-