xmlgraphics-commons 1.3

org.apache.xmlgraphics.ps.dsc.events
Class UnparsedDSCComment

java.lang.Object
  extended by org.apache.xmlgraphics.ps.dsc.events.AbstractEvent
      extended by org.apache.xmlgraphics.ps.dsc.events.UnparsedDSCComment
All Implemented Interfaces:
DSCParserConstants, DSCComment, DSCEvent

public class UnparsedDSCComment
extends AbstractEvent
implements DSCComment

Represents a DSC comment that is not parsed into one of the concrete DSCComment subclasses. It is used whenever a DSC comment is encountered that is unknown to the parser.

See Also:
DSCCommentFactory

Field Summary
 
Fields inherited from interface org.apache.xmlgraphics.ps.dsc.DSCParserConstants
COMMENT, DSC_COMMENT, EOF, HEADER_COMMENT, LINE
 
Constructor Summary
UnparsedDSCComment(java.lang.String name)
          Creates a new instance.
 
Method Summary
 DSCComment asDSCComment()
          Casts this instance to a DSCComment if possible.
 void generate(PSGenerator gen)
          Writes the event to the given PSGenerator.
 int getEventType()
          Returns the event type.
 java.lang.String getName()
          Returns the name of the DSC comment.
 boolean hasValues()
          Indicates whether this DSC comment has values.
 boolean isAtend()
          Indicates whether the DSC comment's value is "Atend".
 boolean isDSCComment()
          Indicates whether the instance is a DSC comment.
 void parseValue(java.lang.String value)
          Parses the value of the DSC comment.
 
Methods inherited from class org.apache.xmlgraphics.ps.dsc.events.AbstractEvent
asLine, isComment, isHeaderComment, isLine
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.xmlgraphics.ps.dsc.events.DSCEvent
asLine, isComment, isHeaderComment, isLine
 

Constructor Detail

UnparsedDSCComment

public UnparsedDSCComment(java.lang.String name)
Creates a new instance.

Parameters:
name - the name of the DSC comment
Method Detail

getName

public java.lang.String getName()
Description copied from interface: DSCComment
Returns the name of the DSC comment.

Specified by:
getName in interface DSCComment
Returns:
the name of the DSC comment (without the "%%" prefix)
See Also:
DSCComment.getName()

hasValues

public boolean hasValues()
Description copied from interface: DSCComment
Indicates whether this DSC comment has values.

Specified by:
hasValues in interface DSCComment
Returns:
true if the DSC comment has values
See Also:
DSCComment.hasValues()

isAtend

public boolean isAtend()
Description copied from interface: DSCComment
Indicates whether the DSC comment's value is "Atend".

Specified by:
isAtend in interface DSCComment
Returns:
true if the value is "Atend"
See Also:
DSCComment.isAtend()

parseValue

public void parseValue(java.lang.String value)
Description copied from interface: DSCComment
Parses the value of the DSC comment.

Specified by:
parseValue in interface DSCComment
Parameters:
value - the value
See Also:
DSCComment.parseValue(java.lang.String)

generate

public void generate(PSGenerator gen)
              throws java.io.IOException
Description copied from interface: DSCEvent
Writes the event to the given PSGenerator.

Specified by:
generate in interface DSCComment
Specified by:
generate in interface DSCEvent
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)

isDSCComment

public boolean isDSCComment()
Description copied from interface: DSCEvent
Indicates whether the instance is a DSC comment.

Specified by:
isDSCComment in interface DSCEvent
Overrides:
isDSCComment in class AbstractEvent
Returns:
true if the instance is a DSC comment
See Also:
AbstractEvent.isDSCComment()

getEventType

public int getEventType()
Description copied from interface: DSCEvent
Returns the event type.

Specified by:
getEventType in interface DSCEvent
Returns:
the event type (see DSCParserConstants)
See Also:
DSCEvent.getEventType()

asDSCComment

public DSCComment asDSCComment()
Description copied from interface: DSCEvent
Casts this instance to a DSCComment if possible.

Specified by:
asDSCComment in interface DSCEvent
Overrides:
asDSCComment in class AbstractEvent
Returns:
this event as a DSCComment
See Also:
AbstractEvent.asDSCComment()

xmlgraphics-commons 1.3

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