org.apache.cocoon.components.source.impl
Class GIFSourceInspector

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.components.source.impl.AbstractImageSourceInspector
          extended by org.apache.cocoon.components.source.impl.GIFSourceInspector
All Implemented Interfaces:
Component, LogEnabled, ThreadSafe, SourceInspector

public class GIFSourceInspector
extends AbstractImageSourceInspector
implements ThreadSafe

This source inspector adds extra attributes for image files.

Version:
CVS $Id: GIFSourceInspector.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Stephan Michels, Donald A. Ball Jr.

Field Summary
 
Fields inherited from class org.apache.cocoon.components.source.impl.AbstractImageSourceInspector
IMAGE_HEIGHT_PROPERTY_NAME, IMAGE_WIDTH_PROPERTY_NAME, PROPERTY_NS
 
Fields inherited from interface org.apache.cocoon.components.source.SourceInspector
ROLE
 
Constructor Summary
GIFSourceInspector()
           
 
Method Summary
protected  int[] getImageSize(Source source)
          Returns width as first element, height as second
protected  boolean isImageFileType(Source source)
          Checks that this is in fact a gif file.
protected  boolean isImageMimeType(Source source)
          Checks the source uri for the .gif extension.
 
Methods inherited from class org.apache.cocoon.components.source.impl.AbstractImageSourceInspector
getHandledPropertyTypes, getSourceProperties, getSourceProperty, getValidity, handlesProperty
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GIFSourceInspector

public GIFSourceInspector()
Method Detail

isImageMimeType

protected final boolean isImageMimeType(Source source)
Checks the source uri for the .gif extension.

Specified by:
isImageMimeType in class AbstractImageSourceInspector
Parameters:
source - the Source to test

isImageFileType

protected final boolean isImageFileType(Source source)
                                 throws SourceException
Checks that this is in fact a gif file.

Specified by:
isImageFileType in class AbstractImageSourceInspector
Parameters:
source - the Source to test
Throws:
SourceException

getImageSize

protected final int[] getImageSize(Source source)
                            throws SourceException
Returns width as first element, height as second

Specified by:
getImageSize in class AbstractImageSourceInspector
Parameters:
source - the Source to inspect.
Returns:
array carrying the calculated width parameter in its 0 index, the height under index 1.
Throws:
SourceException


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.