Top Fields Constructors Methods
org.jabref.logic.formatter.minifier

public Class TruncateFormatter

extends Formatter
Class Inheritance
Imports
java.util.Objects, org.jabref.logic.cleanup.Formatter, org.jabref.logic.l10n.Localization

Field Summary

Modifier and TypeField and Description
private final String
private final int

Constructor Summary

AccessConstructor and Description
public
TruncateFormatter(final int
truncate a string after this index.
truncateIndex
)

The TruncateFormatter truncates a string after the given index and removes trailing whitespaces.

Method Summary

Modifier and TypeMethod and Description
public String
format(final String
the input String
input
)

Implements abstract org.jabref.logic.cleanup.Formatter.format.

Truncates a string after the given index.

public String
getDescription()

Implements abstract org.jabref.logic.cleanup.Formatter.getDescription.

Returns a description of the formatter.

public String
getExampleInput()

Implements abstract org.jabref.logic.cleanup.Formatter.getExampleInput.

Returns an example input string of the formatter.

public String
getKey()

Implements abstract org.jabref.logic.cleanup.Formatter.getKey.

Returns a unique key for the formatter that can be used for its identification

public String
getName()

Implements abstract org.jabref.logic.cleanup.Formatter.getName.

Returns a human readable name of the formatter usable for e.g. in the GUI

Inherited from org.jabref.logic.cleanup.Formatter:
equalshashCode

Field Detail

KEYback to summary
private final String KEY
TRUNCATE_AFTERback to summary
private final int TRUNCATE_AFTER

Constructor Detail

TruncateFormatterback to summary
public TruncateFormatter(final int truncateIndex)

The TruncateFormatter truncates a string after the given index and removes trailing whitespaces.

Parameters
truncateIndex:int

truncate a string after this index.

Method Detail

formatback to summary
public String format(final String input)

Implements abstract org.jabref.logic.cleanup.Formatter.format.

Truncates a string after the given index.

Parameters
input:String

Doc from org.jabref.logic.cleanup.Formatter.format.

the input String

Returns:String

Doc from org.jabref.logic.cleanup.Formatter.format.

the formatted output String

Annotations
@Override
getDescriptionback to summary
public String getDescription()

Implements abstract org.jabref.logic.cleanup.Formatter.getDescription.

Doc from org.jabref.logic.cleanup.Formatter.getDescription.

Returns a description of the formatter.

Returns:String

the description string, always non empty

Annotations
@Override
getExampleInputback to summary
public String getExampleInput()

Implements abstract org.jabref.logic.cleanup.Formatter.getExampleInput.

Doc from org.jabref.logic.cleanup.Formatter.getExampleInput.

Returns an example input string of the formatter. This example is used as input to the formatter to demonstrate its functionality

Returns:String

the example input string, always non empty

Annotations
@Override
getKeyback to summary
public String getKey()

Implements abstract org.jabref.logic.cleanup.Formatter.getKey.

Doc from org.jabref.logic.cleanup.Formatter.getKey.

Returns a unique key for the formatter that can be used for its identification

Returns:String

the key of the formatter, always not null

Annotations
@Override
getNameback to summary
public String getName()

Implements abstract org.jabref.logic.cleanup.Formatter.getName.

Doc from org.jabref.logic.cleanup.Formatter.getName.

Returns a human readable name of the formatter usable for e.g. in the GUI

Returns:String

the name of the formatter, always not null

Annotations
@Override