cucumber.io
Class DelegatingResourceIteratorFactory

java.lang.Object
  extended by cucumber.io.DelegatingResourceIteratorFactory
All Implemented Interfaces:
ResourceIteratorFactory

public class DelegatingResourceIteratorFactory
extends Object
implements ResourceIteratorFactory

A ResourceIteratorFactory implementation which delegates to factories found by the ServiceLoader class.


Constructor Summary
DelegatingResourceIteratorFactory()
          Initializes a new instance of the DelegatingResourceIteratorFactory class.
DelegatingResourceIteratorFactory(ResourceIteratorFactory fallback)
          Initializes a new instance of the DelegatingResourceIteratorFactory class with a fallback factory.
 
Method Summary
 Iterator<Resource> createIterator(URL url, String path, String suffix)
          Creates an iterator for the given URL with the path and suffix.
 boolean isFactoryFor(URL url)
          Gets a value indicating whether the factory can create iterators for the resource specified by the given URL.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DelegatingResourceIteratorFactory

public DelegatingResourceIteratorFactory()
Initializes a new instance of the DelegatingResourceIteratorFactory class.


DelegatingResourceIteratorFactory

public DelegatingResourceIteratorFactory(ResourceIteratorFactory fallback)
Initializes a new instance of the DelegatingResourceIteratorFactory class with a fallback factory.

Parameters:
fallback - The fallback resource iterator factory to use when an appropriate one couldn't be found otherwise.
Method Detail

isFactoryFor

public boolean isFactoryFor(URL url)
Description copied from interface: ResourceIteratorFactory
Gets a value indicating whether the factory can create iterators for the resource specified by the given URL.

Specified by:
isFactoryFor in interface ResourceIteratorFactory
Parameters:
url - The URL to check.
Returns:
True if the factory can create an iterator for the given URL.

createIterator

public Iterator<Resource> createIterator(URL url,
                                         String path,
                                         String suffix)
Description copied from interface: ResourceIteratorFactory
Creates an iterator for the given URL with the path and suffix.

Specified by:
createIterator in interface ResourceIteratorFactory
Parameters:
url - The URL.
path - The path.
suffix - The suffix.
Returns:
The iterator over the resources designated by the URL, path, and suffix.


Copyright © 2012. All Rights Reserved.