Package htsjdk.samtools

# Class CustomReaderFactory

java.lang.Object
htsjdk.samtools.CustomReaderFactory

public class CustomReaderFactory extends Object
Factory for creating custom readers for accessing API based resources, e.g. ga4gh. The configuration is controlled via custom_reader property (@see Defaults). This allows injection of such readers from code bases outside HTSJDK.

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static interface`
`CustomReaderFactory.ICustomReaderFactory`
Interface to be implemented by custom factory classes that register themselves with this factory and are loaded dynamically.

## Method Summary

Modifier and Type
Method
Description
`static CustomReaderFactory`
`getInstance()`
`SamReader`
`maybeOpen(URL url)`
Check if the url is supposed to be handled by the custom factory and if so attempt to create reader via an instance of this custom factory.
`static void`
`resetToDefaultInstance()`
`static void`
`setInstance(CustomReaderFactory factory)`

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

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

## Method Details

### setInstance

public static void setInstance(CustomReaderFactory factory)

### resetToDefaultInstance

public static void resetToDefaultInstance()

### getInstance

public static CustomReaderFactory getInstance()

### maybeOpen

public SamReader maybeOpen(URL url)
Check if the url is supposed to be handled by the custom factory and if so attempt to create reader via an instance of this custom factory.

Returns:
  null if the url is not handled by this factory, SamReader otherwise.