Class AbstractResourcesDSCComment
java.lang.Object
org.apache.xmlgraphics.ps.dsc.events.AbstractEvent
org.apache.xmlgraphics.ps.dsc.events.AbstractDSCComment
org.apache.xmlgraphics.ps.dsc.events.AbstractResourcesDSCComment
- All Implemented Interfaces:
DSCParserConstants, DSCComment, DSCEvent
- Direct Known Subclasses:
DSCCommentDocumentNeededResources, DSCCommentDocumentSuppliedResources, DSCCommentPageResources
Abstract base class for Resource DSC comments (DocumentNeededResources,
DocumentSuppliedResources and PageResources).
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final SetDefines the known resource types (font, procset, file, pattern etc.).private SetFields inherited from interface DSCParserConstants
COMMENT, DSC_COMMENT, EOF, HEADER_COMMENT, LINE -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance.AbstractResourcesDSCComment(Collection resources) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddResource(PSResource res) Adds a new resource.voidaddResources(Collection resources) Adds a collection of resources.voidgenerate(PSGenerator gen) Writes the event to the given PSGenerator.Returns the set of resources associated with this DSC comment.booleanIndicates whether this DSC comment has values.voidparseValue(String value) Parses the value of the DSC comment.private voidMethods inherited from class AbstractDSCComment
asDSCComment, getEventType, isAtend, isDSCComment, splitParamsMethods inherited from class AbstractEvent
asLine, isComment, isHeaderComment, isLineMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface DSCComment
getNameMethods inherited from interface DSCEvent
asLine, isComment, isHeaderComment, isLine
-
Field Details
-
resources
-
RESOURCE_TYPES
Defines the known resource types (font, procset, file, pattern etc.).
-
-
Constructor Details
-
AbstractResourcesDSCComment
public AbstractResourcesDSCComment()Creates a new instance. -
AbstractResourcesDSCComment
Creates a new instance.- Parameters:
resources- a Collection of PSResource instances
-
-
Method Details
-
hasValues
public boolean hasValues()Indicates whether this DSC comment has values.- Returns:
- true if the DSC comment has values
-
prepareResourceSet
private void prepareResourceSet() -
addResource
-
addResources
Adds a collection of resources.- Parameters:
resources- a Collection of PSResource instances.
-
getResources
Returns the set of resources associated with this DSC comment.- Returns:
- the set of resources
-
parseValue
Parses the value of the DSC comment.- Parameters:
value- the value
-
generate
Writes the event to the given PSGenerator.- Parameters:
gen- the PSGenerator to write to- Throws:
IOException- In case of an I/O error- See Also:
-