Verified Owner
Top Description Fields Constructors Methods
org.jabref.logic.layout.format

public Class Replace

extends AbstractParamLayoutFormatter
Class Inheritance
Imports
java.util.List, org.jabref.logic.layout.AbstractParamLayoutFormatter

Formatter that does regexp replacement. To use this formatter, a two-part argument must be given. The parts are separated by a comma. To indicate the comma character, use an escape sequence: , For inserting newlines and tabs in arguments, use \n and \t, respectively. The first part is the regular expression to search for. Remember that any commma character must be preceded by a backslash, and consequently a literal backslash must be written as a pair of backslashes. A description of Java regular expressions can be found at: http://java.sun.com/j2se/1.4.2/docs/api/java/util/regex/Pattern.html The second part is the text to replace all matches with. For instance:

\format[Replace(and,&)]{\author} will output the "author" field after replacing all occurences of "and" by "&"

\format[Replace(\s,_)]{\author} will output the "author" field after replacing all whitespace by underscores.

\format[Replace(\,,;)]{\author} will output the "author" field after replacing all commas by semicolons.

Field Summary

Modifier and TypeField and Description
private String
private String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String
format(String fieldText)

Implements org.jabref.logic.layout.LayoutFormatter.format.

Failure Mode:

Formatters should be robust in the sense that they always return some relevant string.

public void
setArgument(String arg)

Implements org.jabref.logic.layout.ParamLayoutFormatter.setArgument.

Method for setting the argument of this formatter.

Inherited from org.jabref.logic.layout.AbstractParamLayoutFormatter:
parseArgument

Field Detail

regexback to summary
private String regex
replaceWithback to summary
private String replaceWith

Constructor Detail

Replaceback to summary
public Replace()

Method Detail

formatback to summary
public String format(String fieldText)

Implements org.jabref.logic.layout.LayoutFormatter.format.

Doc from org.jabref.logic.layout.LayoutFormatter.format.

Failure Mode:

Formatters should be robust in the sense that they always return some relevant string.

If the formatter can detect an invalid input it should return the original string otherwise it may simply return a wrong output.

Annotations
@Override
setArgumentback to summary
public void setArgument(String arg)

Implements org.jabref.logic.layout.ParamLayoutFormatter.setArgument.

Doc from org.jabref.logic.layout.ParamLayoutFormatter.setArgument.

Method for setting the argument of this formatter.

Annotations
@Override