Top Description Fields Constructors Methods
org.jabref.logic.formatter.bibtexfields

public Class CleanupUrlFormatter

extends Formatter
Class Inheritance
Imports
java.net.URLDecoder, java.nio.charset.Charset, .StandardCharsets, java.util.Objects, java.util.regex.Matcher, .Pattern, org.jabref.logic.cleanup.Formatter, org.jabref.logic.l10n.Localization

Cleanup URL link.

Expose string representations URL links clean up logic.

Field Summary

Modifier and TypeField and Description
private static final Pattern

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the decoded URL as a String representation
format
(String
should not be null
url
)

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

Escape and decodes a String from the application/x-www-form-urlencoded MIME format.

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

PATTERN_URLback to summary
private static final Pattern PATTERN_URL

Constructor Detail

CleanupUrlFormatterback to summary
public CleanupUrlFormatter()

Method Detail

formatback to summary
public String format(String url)

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

Escape and decodes a String from the application/x-www-form-urlencoded MIME format.

Method will also try to find a URL placed after "url=" or "to=".

The conversion process is the same as executed by URLDecoder to try to take guarantees against code injections.

The plus sign is replaced by its correspondent code (%2b) to avoid the character to be replaced by a space during the decoding execution.

Parameters
url:String

should not be null

Returns:String

the decoded URL as a String representation

Annotations
@Override
See Also
URLDecoder#decode(String, Charset)
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