SubtitleParser.Factory


public interface SubtitleParser.Factory

Known direct subclasses
DefaultSubtitleParserFactory

A factory for SubtitleParser instances.

ThrowingSubtitleParserFactory

A SubtitleParser.Factory for SubtitleParser instances that throw an exception on every call to parse.


Factory for SubtitleParser instances.

Summary

Constants

default static final SubtitleParser.Factory

A subtitle parser factory that supports no formats.

Public methods

abstract SubtitleParser
create(Format format)

Creates a SubtitleParser for the given Format.

abstract int

Returns the CueReplacementBehavior of the SubtitleParser implementation that handles format.

abstract boolean

Returns whether the factory is able to instantiate a SubtitleParser for the given Format.

Constants

UNSUPPORTED

default static final SubtitleParser.Factory UNSUPPORTED

A subtitle parser factory that supports no formats.

Public methods

create

abstract SubtitleParser create(Format format)

Creates a SubtitleParser for the given Format.

Returns
SubtitleParser

The SubtitleParser instance.

Throws
java.lang.IllegalArgumentException

if format is not supported by this factory.

getCueReplacementBehavior

@Format.CueReplacementBehavior
abstract int getCueReplacementBehavior(Format format)

Returns the CueReplacementBehavior of the SubtitleParser implementation that handles format.

Returns
int

The replacement behavior.

Throws
java.lang.IllegalArgumentException

if format is not supported by this factory.

supportsFormat

abstract boolean supportsFormat(Format format)

Returns whether the factory is able to instantiate a SubtitleParser for the given Format.

Parameters
Format format

The Format.

Returns
boolean

Whether the factory can instantiate a suitable SubtitleParser.