ThrowingSubtitleParserFactory
@UnstableApi
public class ThrowingSubtitleParserFactory implements SubtitleParser.Factory
A SubtitleParser.Factory for SubtitleParser instances that throw an exception on every call to parse.
It claims support for all subtitle formats (returns the result of isText from supportsFormat).
Summary
Constants |
|
|---|---|
static final int |
Public constructors |
|---|
ThrowingSubtitleParserFactory( |
Public methods |
|
|---|---|
SubtitleParser |
Creates a |
int |
Returns the |
boolean |
supportsFormat(Format format)Returns whether the factory is able to instantiate a |
Inherited Constants |
||
|---|---|---|
|
Constants
Public constructors
ThrowingSubtitleParserFactory
public ThrowingSubtitleParserFactory(
Supplier<RuntimeException> exceptionSupplier
)
Public methods
create
public SubtitleParser create(Format format)
Creates a SubtitleParser for the given Format.
| Returns | |
|---|---|
SubtitleParser |
The |
| Throws | |
|---|---|
java.lang.IllegalArgumentException |
if |
getCueReplacementBehavior
@Format.CueReplacementBehavior
public int getCueReplacementBehavior(Format format)
Returns the CueReplacementBehavior of the SubtitleParser implementation that handles format.
| Returns | |
|---|---|
int |
The replacement behavior. |
| Throws | |
|---|---|
java.lang.IllegalArgumentException |
if |
supportsFormat
public boolean supportsFormat(Format format)
Returns whether the factory is able to instantiate a SubtitleParser for the given Format.
| Returns | |
|---|---|
boolean |
Whether the factory can instantiate a suitable |