|
xmlgraphics-commons 1.3 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.xmlgraphics.image.loader.impl.AbstractImageSessionContext
Abstract base class for classes implementing ImageSessionContext. This class provides all the special treatment for Source creation, i.e. it provides optimized Source objects where possible.
Constructor Summary | |
AbstractImageSessionContext()
|
Method Summary | |
javax.xml.transform.Source |
getSource(java.lang.String uri)
Returns a Source object for a URI. This method is not guaranteed to return an instance. Implementations normally return already created Sources from a pool (normally populated through the ImageSessionContext.returnSource(String, Source) method). |
protected boolean |
isReusable(javax.xml.transform.Source src)
Indicates whether a Source is reusable. |
javax.xml.transform.Source |
needSource(java.lang.String uri)
Returns a Source object for a URI. This method is guaranteed to return a Source object. If the image cannot be found, a FileNotFoundException is thrown. |
javax.xml.transform.Source |
newSource(java.lang.String uri)
Attempts to create a Source object from the given URI. If possible this method returns an ImageSource instance which provides the best possible method to access the image. |
protected abstract javax.xml.transform.Source |
resolveURI(java.lang.String uri)
Attempts to resolve the given URI. |
void |
returnSource(java.lang.String uri,
javax.xml.transform.Source src)
Returns a Source object to a pool. This is provided in order to reuse a Source object between the preloading and the final loading of an image. Note that not all Source objects can be reused! Non-reusable Sources are discarded. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.xmlgraphics.image.loader.ImageSessionContext |
getParentContext, getTargetResolution |
Constructor Detail |
public AbstractImageSessionContext()
Method Detail |
protected abstract javax.xml.transform.Source resolveURI(java.lang.String uri)
uri
- URI to access
Source
object, or null if the URI
cannot be resolved.public javax.xml.transform.Source newSource(java.lang.String uri)
newSource
in interface ImageSessionContext
uri
- URI to access
Source
object, or null if the URI
cannot be resolved.public javax.xml.transform.Source getSource(java.lang.String uri)
ImageSessionContext.returnSource(String, Source)
method).
getSource
in interface ImageSessionContext
uri
- the URI of the image
public javax.xml.transform.Source needSource(java.lang.String uri) throws java.io.FileNotFoundException
FileNotFoundException
is thrown.
needSource
in interface ImageSessionContext
uri
- the URI of the image
java.io.FileNotFoundException
- if the image cannot be foundpublic void returnSource(java.lang.String uri, javax.xml.transform.Source src)
returnSource
in interface ImageSessionContext
uri
- the URI of the imagesrc
- the Source object belonging to the URIprotected boolean isReusable(javax.xml.transform.Source src)
ImageSource
(containing an ImageInputStream
) or a DOMSource
.
src
- the Source object
|
xmlgraphics-commons 1.3 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |