Package org.ghost4j
Class AbstractComponent
- java.lang.Object
-
- org.ghost4j.AbstractComponent
-
- All Implemented Interfaces:
Component
- Direct Known Subclasses:
AbstractAnalyzer
,AbstractConverter
,AbstractModifier
,AbstractRemoteComponent
,AbstractRenderer
public abstract class AbstractComponent extends java.lang.Object implements Component
Abstract component implementation. Contains methods that are common to the different component types (converter, analyzer, modifier ...)
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.List<java.lang.String>
AVAILABLE_DEVICE_NAMES
Holds available device names of the Ghostscript interperter.protected java.lang.Class<?>[]
supportedDocumentClasses
Classes of Document supported by the converter.
-
Constructor Summary
Constructors Constructor Description AbstractComponent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
assertDeviceSupported(java.lang.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(java.util.Map<java.lang.String,java.lang.Object> settings)
Copy settings (object properties except for property 'maxProcessCount') to the current componentjava.util.Map<java.lang.String,java.lang.Object>
extractSettings()
Extract settings (object properties except for property 'maxProcessCount') of the current componentprotected boolean
isDeviceSupported(java.lang.String deviceName)
Checks if a given device is supported by the current Ghostscript version.
-
-
-
Field Detail
-
AVAILABLE_DEVICE_NAMES
private static final java.util.List<java.lang.String> AVAILABLE_DEVICE_NAMES
Holds available device names of the Ghostscript interperter.
-
supportedDocumentClasses
protected java.lang.Class<?>[] supportedDocumentClasses
Classes of Document supported by the converter.
-
-
Method Detail
-
assertDocumentSupported
protected void assertDocumentSupported(Document document) throws DocumentException
Assert a given document instance is supported by the converter- Parameters:
document
-- Throws:
DocumentException
- When document is not supported
-
copySettings
public void copySettings(java.util.Map<java.lang.String,java.lang.Object> settings) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
Description copied from interface:Component
Copy settings (object properties except for property 'maxProcessCount') to the current component- Specified by:
copySettings
in interfaceComponent
- Throws:
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
-
extractSettings
public java.util.Map<java.lang.String,java.lang.Object> extractSettings() throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodException
Description 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:
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
java.lang.NoSuchMethodException
-
isDeviceSupported
protected boolean isDeviceSupported(java.lang.String deviceName) throws GhostscriptException
Checks if a given device is supported by the current Ghostscript version.- Parameters:
deviceName
- Device name- Returns:
- true/false
- Throws:
GhostscriptException
-
assertDeviceSupported
protected void assertDeviceSupported(java.lang.String deviceName) throws GhostscriptException
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
-
-