Top Description Constructors Methods
de.undercouch.citeproc.bibtex

public Class NameParser

extends Object
Class Inheritance
Imports
de.undercouch.citeproc.bibtex.internal.InternalNameLexer, .InternalNameParser, .InternalNameParser.NamesContext, de.undercouch.citeproc.csl.CSLName, .CSLNameBuilder, org.antlr.v4.runtime.CharStream, .CharStreams, .CommonTokenStream

Parses a human's name to a CSLName object
Author
Michel Kraemer

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static CSLName[]

Returns:

the CSLName objects (never null and never empty)
parse
(String
the names to parse
names
)

Parses names to CSLName objects.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

NameParserback to summary
public NameParser()

Method Detail

parseback to summary
public static CSLName[] parse(String names)

Parses names to CSLName objects. Also handles strings containing multiple names separated by and. The method always returns at least one object, even if the given names cannot be parsed. In this case the returned object just contains a literal string.

Special handling is provided for names enclosed in braces {}, which are meant to be preserved as-is in the output.

Parameters
names:String

the names to parse

Returns:CSLName[]

the CSLName objects (never null and never empty)