DefaultImageSessionContext
Date: 2016-04-28

org.apache.xmlgraphics.image.loader.impl

## Class DefaultImageSessionContext

- java.lang.Object
- - org.apache.xmlgraphics.image.loader.impl.AbstractImageSessionContext
  - - org.apache.xmlgraphics.image.loader.impl.DefaultImageSessionContext

- All Implemented Interfaces:
    ImageSessionContext

      public class DefaultImageSessionContext
      extends AbstractImageSessionContext

  Very simple implementation of the ImageSessionContext interface. It works for absolute URLs and local filenames only. Consider writing your own implementation of the ImageSessionContext if you need more sophisticated functionality.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.xmlgraphics.image.loader.impl.AbstractImageSessionContext

      `AbstractImageSessionContext.FallbackResolver, AbstractImageSessionContext.RestrictedFallbackResolver, AbstractImageSessionContext.UnrestrictedFallbackResolver`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultImageSessionContext(ImageContext context, java.io.File baseDir)` Main constructor.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.io.File` | `getBaseDir()` Returns the base directory for resolving relative filenames.
    `ImageContext` | `getParentContext()` Returns the session-independent context object which provides configuration information.
    `float` | `getTargetResolution()` Returns the resolution (in dpi) of the target device used when painting images.
    `protected javax.xml.transform.Source` | `resolveURI(java.lang.String uri)` Attempts to resolve the given URI.

    - ### Methods inherited from class org.apache.xmlgraphics.image.loader.impl.AbstractImageSessionContext

      `createImageInputStream, getSource, isReusable, needSource, newSource, returnSource, toFile`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DefaultImageSessionContext

          public DefaultImageSessionContext(ImageContext context,
                                    java.io.File baseDir)

      Main constructor.
      Parameters:
        `context` - the parent image context
        `baseDir` - the base directory for resolving relative filenames

  - ### Method Detail

    - #### getParentContext

          public ImageContext getParentContext()

      Returns the session-independent context object which provides configuration information.
      Returns:
        the associated ImageContext instance

    - #### getBaseDir

          public java.io.File getBaseDir()

      Returns the base directory for resolving relative filenames.
      Returns:
        the base directory

    - #### resolveURI

          protected javax.xml.transform.Source resolveURI(java.lang.String uri)

      Attempts to resolve the given URI.
      Specified by:
        `resolveURI` in class `AbstractImageSessionContext`
      Parameters:
        `uri` - URI to access
      Returns:
        A `Source` object, or null if the URI cannot be resolved.

    - #### getTargetResolution

          public float getTargetResolution()

      Returns the resolution (in dpi) of the target device used when painting images.
      Returns:
        the target resolution (in dpi)