Verified Owner
Top Description Inners Fields Constructors Methods
org.jabref.logic.bst.util

public Class BstTextPrefixer

extends Object
Class Inheritance
Annotations
@NullMarked
Imports
org.jspecify.annotations.NullMarked, org.slf4j.Logger, .LoggerFactory

The |built_in| function {.{text.prefix$}} pops the top two literals (the integer literal |pop_lit1| and a string literal, in that order). It pushes the substring of the (at most) |pop_lit1| consecutive text characters starting from the beginning of the string. This function is similar to {.{substring$}}, but this one considers an accented character (or more precisely, a ``special character''$!$, even if it's missing its matching |right_brace|) to be a single text character (rather than however many |ASCII_code| characters it actually comprises), and this function doesn't consider braces to be text characters; furthermore, this function appends any needed matching |right_brace|s. If any of the types is incorrect, it complains and pushes the null string.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private static final Logger

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static void
handleClosingBrace(BstTextPrefixer.PrefixState prefixState, String toPrefix, char c)

private static void
handleOpeningBrace(char[] cs, BstTextPrefixer.PrefixState prefixState, char c)

public static String
textPrefix(int numOfChars, String toPrefix)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

LOGGERback to summary
private static final Logger LOGGER

Constructor Detail

BstTextPrefixerback to summary
private BstTextPrefixer()

Method Detail

handleClosingBraceback to summary
private static void handleClosingBrace(BstTextPrefixer.PrefixState prefixState, String toPrefix, char c)
handleOpeningBraceback to summary
private static void handleOpeningBrace(char[] cs, BstTextPrefixer.PrefixState prefixState, char c)
textPrefixback to summary
public static String textPrefix(int numOfChars, String toPrefix)
org.jabref.logic.bst.util back to summary

private Class BstTextPrefixer.PrefixState

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
public int
public int
public int

Constructor Summary

AccessConstructor and Description
public
PrefixState(int index, int braceLevel, int numOfChars)

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

braceLevelback to summary
public int braceLevel
indexback to summary
public int index
numOfCharsback to summary
public int numOfChars

Constructor Detail

PrefixStateback to summary
public PrefixState(int index, int braceLevel, int numOfChars)