Package org.ghost4j
Class AbstractComponent
java.lang.Object
org.ghost4j.AbstractComponent
- All Implemented Interfaces:
Component
- Direct Known Subclasses:
AbstractAnalyzer
,AbstractConverter
,AbstractModifier
,AbstractRemoteComponent
,AbstractRenderer
Abstract component implementation. Contains methods that are common to the
different component types (converter, analyzer, modifier ...)
-
Field Summary
FieldsModifier and TypeFieldDescriptionHolds available device names of the Ghostscript interperter.protected Class<?>[]
Classes of Document supported by the converter. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
assertDeviceSupported
(String deviceName) Asserts a given device is supported by the current Ghostscript version.protected void
assertDocumentSupported
(Document document) Assert a given document instance is supported by the convertervoid
copySettings
(Map<String, Object> settings) Copy settings (object properties except for property 'maxProcessCount') to the current componentExtract settings (object properties except for property 'maxProcessCount') of the current componentprotected boolean
isDeviceSupported
(String deviceName) Checks if a given device is supported by the current Ghostscript version.
-
Field Details
-
AVAILABLE_DEVICE_NAMES
Holds available device names of the Ghostscript interperter. -
supportedDocumentClasses
Classes of Document supported by the converter.
-
-
Constructor Details
-
AbstractComponent
public AbstractComponent()
-
-
Method Details
-
assertDocumentSupported
Assert a given document instance is supported by the converter- Parameters:
document
-- Throws:
DocumentException
- When document is not supported
-
copySettings
public void copySettings(Map<String, Object> settings) throws IllegalAccessException, InvocationTargetExceptionDescription copied from interface:Component
Copy settings (object properties except for property 'maxProcessCount') to the current component- Specified by:
copySettings
in interfaceComponent
- Parameters:
settings
-- Throws:
IllegalAccessException
InvocationTargetException
-
extractSettings
public Map<String,Object> extractSettings() throws IllegalAccessException, InvocationTargetException, NoSuchMethodExceptionDescription copied from interface:Component
Extract settings (object properties except for property 'maxProcessCount') of the current component- Specified by:
extractSettings
in interfaceComponent
- Returns:
- a Map of settings
- Throws:
IllegalAccessException
InvocationTargetException
NoSuchMethodException
-
isDeviceSupported
Checks if a given device is supported by the current Ghostscript version.- Parameters:
deviceName
- Device name- Returns:
- true/false
- Throws:
GhostscriptException
-
assertDeviceSupported
Asserts a given device is supported by the current Ghostscript version.- Parameters:
deviceName
- Device name- Throws:
GhostscriptException
- Thrown is device is not supported, or call to the interpreter fails
-