Package org.ghost4j

Class AbstractComponent

    • 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.
    • 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 converter
      void copySettings​(java.util.Map<java.lang.String,​java.lang.Object> settings)
      Copy settings (object properties except for property 'maxProcessCount') to the current component
      java.util.Map<java.lang.String,​java.lang.Object> extractSettings()
      Extract settings (object properties except for property 'maxProcessCount') of the current component
      protected boolean isDeviceSupported​(java.lang.String deviceName)
      Checks if a given device is supported by the current Ghostscript version.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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.
    • Constructor Detail

      • AbstractComponent

        public AbstractComponent()
    • 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 interface Component
        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 interface Component
        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