Top Description Fields Constructors Methods
org.jabref.logic.bst.util

public Class BstNameFormatter

extends Object
Class Inheritance
Imports
java.util.Arrays, .Locale, .Optional, java.util.stream.Collectors, org.jabref.logic.bst.BstVMException, org.jabref.model.entry.Author, .AuthorList, org.slf4j.Logger, .LoggerFactory

From Bibtex: "The |built_in| function {\.{format.name\$}} pops the top three literals (they are a string, an integer, and a string literal, in that order). The last string literal represents a name list (each name corresponding to a person), the integer literal specifies which name to pick from this list, and the first string literal specifies how to format this name, as described in the \BibTeX\ documentation. Finally, this function pushes the formatted name. If any of the types is incorrect, it complains and pushes the null string." Sounds easy - is a nightmare... X-(

Field Summary

Modifier and TypeField and Description
private static final Logger

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static int
consumeToMatchingBrace(StringBuilder interTokenSb, char[] c, int pos)

Including the matching brace.

public static String
formatName(String
The string from an author field
authorsNameList
,
int
index of the list, starting with 1
whichName
,
String
TODO
formatString
)

Formats the nth author of the author name list by a given format string

public static String
formatName(Author author, String format)

public static String
getFirstCharOfString(String s)

Takes care of special characters too

public static int
numberOfChars(String token, int inStop)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

LOGGERback to summary
private static final Logger LOGGER

Constructor Detail

BstNameFormatterback to summary
private BstNameFormatter()

Method Detail

consumeToMatchingBraceback to summary
public static int consumeToMatchingBrace(StringBuilder interTokenSb, char[] c, int pos)

Including the matching brace.

formatNameback to summary
public static String formatName(String authorsNameList, int whichName, String formatString)

Formats the nth author of the author name list by a given format string

Parameters
authorsNameList:String

The string from an author field

whichName:int

index of the list, starting with 1

formatString:String

TODO

formatNameback to summary
public static String formatName(Author author, String format)
getFirstCharOfStringback to summary
public static String getFirstCharOfString(String s)

Takes care of special characters too

numberOfCharsback to summary
public static int numberOfChars(String token, int inStop)