<case1>@<range11>@"<format>"@<range12>@"<format>"@<range13>...@@
<case2>@<range21>@... and so on.
Individual cases are separated by @@ and items in a case by @.
Cases are just integers or the character * and will tell the formatter to apply the following formats if there are
less or equal authors given to it. The cases must be in strict increasing order with the * in the last position.
For instance:
case1 = 2
case2 = 3
case3 = *
Ranges are either <integer>..<integer>, <integer> or the character * using a 1 based index for indexing
authors from the given authorlist. Integer indexes can be negative to denote them to start from
the end of the list where -1 is the last author.
For instance with an authorlist of "Joe Doe and Mary Jane and Bruce Bar and Arthur Kay":
1..3 will affect Joe, Mary and Bruce
4..4 will affect Arthur
* will affect all of them
2..-1 will affect Mary, Bruce and Arthur
The <format> uses the Bibtex formatter format:
The four letter v, f, l, j indicate the name parts von, first, last, jr which
are used within curly braces. A single letter v, f, l, j indicates that the name should be abbreviated.
To put a quote in the format string quote it using \" (mh. this doesn't work yet)
I give some examples but would rather point you to the bibtex documentation.
"{ll}, {f}." Will turn "Joe Doe" into "Doe, J."
Complete example:
To turn:
"Joe Doe and Mary Jane and Bruce Bar and Arthur Kay"
into
"Doe, J., Jane, M., Bar, B. and Kay, A."
you would use
1@*@{ll}, {f}.@@2@1@{ll}, {f}.@2@ and {ll}, {f}.@@*@1..-3@{ll}, {f}., @-2@{ll}, {f}.@-1@ and {ll}, {f}.
Yeah this is trouble-some to write, but should work.
For more examples see the test-cases.
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private static String | |
| public String | |
| public String | format(String
The text to layout. fieldText)Implements org. Failure Mode: Formatters should be robust in the sense that they always return some relevant string. |
| public static Map | |
| public void |
| DEFAULT_FORMAT | back to summary |
|---|---|
| public static final String DEFAULT_FORMAT | |
| parameter | back to summary |
|---|---|
| private String parameter | |
| NameFormatter | back to summary |
|---|---|
| public NameFormatter() | |
| format | back to summary |
|---|---|
| private static String format(String toFormat, AuthorList al, String[] formats) | |
| format | back to summary |
|---|---|
| public String format(String toFormat, String inParameters) | |
| format | back to summary |
|---|---|
| public String format(String fieldText) Implements org. Doc from org. 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. | |
| getNameFormatters | back to summary |
|---|---|
| public static Map | |
| setParameter | back to summary |
|---|---|
| public void setParameter(String parameter) | |