|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.avalon.framework.logger.AbstractLogEnabled org.apache.cocoon.components.source.impl.AbstractImageSourceInspector
public abstract class AbstractImageSourceInspector
Abstract base class for inspectors that can calculate the size of an image of a particular type.
Field Summary | |
---|---|
static String |
IMAGE_HEIGHT_PROPERTY_NAME
height property name. |
static String |
IMAGE_WIDTH_PROPERTY_NAME
width property name. |
static String |
PROPERTY_NS
The namespace uri of the properties exposed by this SourceInspector. |
Fields inherited from interface org.apache.cocoon.components.source.SourceInspector |
---|
ROLE |
Constructor Summary | |
---|---|
AbstractImageSourceInspector()
|
Method Summary | |
---|---|
String[] |
getHandledPropertyTypes()
|
protected abstract int[] |
getImageSize(Source source)
Calculate the width and the height of the image represented by source. |
SourceProperty[] |
getSourceProperties(Source source)
Gets all the SourceProperties associated with the given Source. |
SourceProperty |
getSourceProperty(Source source,
String namespace,
String name)
Gets the SourceProperty associated with the given Source identified by the requested namespace and name. |
SourceValidity |
getValidity(Source source)
Returns NOPValidity |
boolean |
handlesProperty(String namespace,
String name)
Check whether this inspector handles properties of the given kind. |
protected abstract boolean |
isImageFileType(Source source)
Inspects the input stream to verify this is in fact a file of the type that this inspector handles. |
protected abstract boolean |
isImageMimeType(Source source)
Checks whether the mime mapping yields the type this inspector handles. |
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 |
Field Detail |
---|
public static final String PROPERTY_NS
The value is http://apache.org/cocoon/inspector/image/1.0
.
public static final String IMAGE_WIDTH_PROPERTY_NAME
width
property name.
public static final String IMAGE_HEIGHT_PROPERTY_NAME
height
property name.
Constructor Detail |
---|
public AbstractImageSourceInspector()
Method Detail |
---|
public final SourceProperty getSourceProperty(Source source, String namespace, String name) throws SourceException
SourceInspector
getSourceProperty
in interface SourceInspector
source
- the source for which to compute the propertynamespace
- the namespace of the propertyname
- the name of the property
null
if the inspector does not provide this property.
SourceException
public final SourceProperty[] getSourceProperties(Source source) throws SourceException
SourceInspector
getSourceProperties
in interface SourceInspector
source
- the Source for wich to compute the property.
SourceException
public final String[] getHandledPropertyTypes()
public final boolean handlesProperty(String namespace, String name)
handlesProperty
in interface SourceInspector
namespace
- the namespace of the propertyname
- the name of the property
true
if this inspector handles properties of the given type
else false
.public SourceValidity getValidity(Source source)
getValidity
in interface SourceInspector
source
- the Source for which to calculate the validity
its properties, null
if the source properties
are not cacheable.protected abstract boolean isImageMimeType(Source source)
source
- the Source to testprotected abstract boolean isImageFileType(Source source) throws SourceException
source
- the Source to test
SourceException
protected abstract int[] getImageSize(Source source) throws SourceException
source
- the Source to inspect.
SourceException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |