Class RefinedImageFlavor
- java.lang.Object
-
- org.apache.xmlgraphics.image.loader.ImageFlavor
-
- org.apache.xmlgraphics.image.loader.RefinedImageFlavor
-
- Direct Known Subclasses:
MimeEnabledImageFlavor
,SimpleRefinedImageFlavor
,XMLNamespaceEnabledImageFlavor
public abstract class RefinedImageFlavor extends ImageFlavor
Special image flavor subclass which enables the refinement to specific (sub-)flavors but maintaining compatibility to a parent (i.e. more general) flavor.
-
-
Field Summary
Fields Modifier and Type Field Description private ImageFlavor
parentFlavor
-
Fields inherited from class org.apache.xmlgraphics.image.loader.ImageFlavor
BUFFERED_IMAGE, GRAPHICS2D, RAW, RAW_CCITTFAX, RAW_EMF, RAW_EPS, RAW_JPEG, RAW_LZW, RAW_PDF, RAW_PNG, RAW_TIFF, RENDERED_IMAGE, XML_DOM
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
RefinedImageFlavor(java.lang.String name, ImageFlavor parentFlavor)
Constructs a new image flavor.protected
RefinedImageFlavor(ImageFlavor parentFlavor)
Constructs a new image flavor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getMimeType()
Returns the MIME type that the image flavor represents if a MIME type is available.java.lang.String
getNamespace()
Returns the XML namespace URI that the image flavor represents if such a namespace URI is available.ImageFlavor
getParentFlavor()
Returns the associated parent image flavor.boolean
isCompatible(ImageFlavor flavor)
Indicates whether a particular image flavor is compatible with this one.-
Methods inherited from class org.apache.xmlgraphics.image.loader.ImageFlavor
equals, getName, hashCode, toString
-
-
-
-
Field Detail
-
parentFlavor
private ImageFlavor parentFlavor
-
-
Constructor Detail
-
RefinedImageFlavor
protected RefinedImageFlavor(ImageFlavor parentFlavor)
Constructs a new image flavor.- Parameters:
parentFlavor
- the parent image flavor
-
RefinedImageFlavor
protected RefinedImageFlavor(java.lang.String name, ImageFlavor parentFlavor)
Constructs a new image flavor.- Parameters:
parentFlavor
- the parent image flavorname
- the name of the flavor (must be unique)
-
-
Method Detail
-
getParentFlavor
public ImageFlavor getParentFlavor()
Returns the associated parent image flavor.- Returns:
- the parent image flavor
-
getMimeType
public java.lang.String getMimeType()
Returns the MIME type that the image flavor represents if a MIME type is available. This is only applicable to images which can also exist as files. For images flavors like decoded in-memory images (Rendered/BufferedImage), this method will return null.- Overrides:
getMimeType
in classImageFlavor
- Returns:
- the MIME type or null if no MIME type can be provided (like for in-memory images)
-
getNamespace
public java.lang.String getNamespace()
Returns the XML namespace URI that the image flavor represents if such a namespace URI is available. This is only applicable to images in XML form. Other image types will return null.- Overrides:
getNamespace
in classImageFlavor
- Returns:
- the XML or null if no MIME type can be provided (like for in-memory images)
-
isCompatible
public boolean isCompatible(ImageFlavor flavor)
Indicates whether a particular image flavor is compatible with this one.- Overrides:
isCompatible
in classImageFlavor
- Parameters:
flavor
- the other image flavor- Returns:
- true if the two are compatible
-
-