net.sf.jguiraffe.locators
Class AbstractLocator

java.lang.Object
  extended by net.sf.jguiraffe.locators.AbstractLocator
All Implemented Interfaces:
Locator
Direct Known Subclasses:
AbstractStreamLocator, ClassPathLocator, FileLocator, URLLocator

public abstract class AbstractLocator
extends java.lang.Object
implements Locator

An adapter class for implementing concrete Locator classes.

This class implements the Locator interface and provides dummy implementations for most of the methods defined in this interface. It can serve as a starting point for the implementation of custom Locator classes; then the developer only needs to deal with the methods that are really required.

Because the getURL() method must be implemented in every locator, no dummy implementation for this method is provided.

Version:
$Id: AbstractLocator.java 156 2009-03-03 21:04:47Z oheger $
Author:
Oliver Heger

Constructor Summary
AbstractLocator()
           
 
Method Summary
 java.io.File getFile()
          Dummy implementation of this interface method.
 java.io.InputStream getInputStream()
          Dummy implementation of this interface method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.jguiraffe.locators.Locator
getURL
 

Constructor Detail

AbstractLocator

public AbstractLocator()
Method Detail

getFile

public java.io.File getFile()
                     throws LocatorException
Dummy implementation of this interface method. Always returns null.

Specified by:
getFile in interface Locator
Returns:
a file object for the represented resource
Throws:
LocatorException - if an error occurs

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException,
                                          LocatorException
Dummy implementation of this interface method. Always returns null.

Specified by:
getInputStream in interface Locator
Returns:
an input stream for the represented resource
Throws:
java.io.IOException - if an IO error occurs
LocatorException - if an internal error occurs


Copyright © 2009 The JGUIraffe Team. All Rights Reserved.