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

public Class GroupsParser

extends Object
Class Inheritance
Imports
java.io.IOException, java.nio.file.InvalidPathException, .Path, java.util.EnumSet, .List, org.jabref.logic.auxparser.DefaultAuxParser, org.jabref.logic.groups.DefaultGroupsFactory, org.jabref.logic.importer.ParseException, org.jabref.logic.l10n.Localization, org.jabref.logic.util.MetadataSerializationConfiguration, org.jabref.logic.util.strings.QuotedStringTokenizer, org.jabref.model.database.BibDatabase, org.jabref.model.entry.field.Field, .FieldFactory, org.jabref.model.groups.AbstractGroup, .AutomaticKeywordGroup, .AutomaticPersonsGroup, .ExplicitGroup, .GroupHierarchyType, .GroupTreeNode, .KeywordGroup, .RegexKeywordGroup, .SearchGroup, .TexGroup, .WordKeywordGroup, org.jabref.model.metadata.MetaData, org.jabref.model.search.rules.SearchRules, .SearchRules.SearchFlags, org.jabref.model.strings.StringUtil, org.jabref.model.util.FileUpdateMonitor, org.slf4j.Logger, .LoggerFactory

Converts string representation of groups to a parsed GroupTreeNode.

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
private static void
addLegacyEntryKeys(QuotedStringTokenizer tok, ExplicitGroup group)

Called only when created fromString.

private static AbstractGroup
private static AbstractGroup
private static AbstractGroup
private static ExplicitGroup
explicitGroupFromString(String input, Character keywordSeparator)

public static AbstractGroup

Returns:

New instance of the encoded group.
fromString
(String
The result from the group's toString() method.
s
,
Character keywordSeparator, FileUpdateMonitor fileMonitor, MetaData metaData)

Re-create a group instance from a textual representation.

public static GroupTreeNode
importGroups(List<String> orderedData, Character keywordSeparator, FileUpdateMonitor fileMonitor, MetaData metaData)

private static KeywordGroup
keywordGroupFromString(String
The String representation obtained from KeywordGroup.toString()
s
,
Character keywordSeparator)

Parses s and recreates the KeywordGroup from it.

private static ExplicitGroup
private static AbstractGroup
searchGroupFromString(String
The String representation obtained from SearchGroup.toString(), or null if incompatible
s
)

Parses s and recreates the SearchGroup from it.

private static AbstractGroup
texGroupFromString(String string, FileUpdateMonitor fileMonitor, MetaData metaData)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

LOGGERback to summary
private static final Logger LOGGER

Constructor Detail

GroupsParserback to summary
private GroupsParser()

Method Detail

addGroupDetailsback to summary
private static void addGroupDetails(QuotedStringTokenizer tokenizer, AbstractGroup group)
addLegacyEntryKeysback to summary
private static void addLegacyEntryKeys(QuotedStringTokenizer tok, ExplicitGroup group)

Called only when created fromString. JabRef used to store the entries of an explicit group in the serialization, e.g. ExplicitGroup:GroupName\;0\;Key1\;Key2\;; This method exists for backwards compatibility.

allEntriesGroupFromStringback to summary
private static AbstractGroup allEntriesGroupFromString(String s)
automaticKeywordGroupFromStringback to summary
private static AbstractGroup automaticKeywordGroupFromString(String string)
automaticPersonsGroupFromStringback to summary
private static AbstractGroup automaticPersonsGroupFromString(String string)
explicitGroupFromStringback to summary
private static ExplicitGroup explicitGroupFromString(String input, Character keywordSeparator) throws ParseException
fromStringback to summary
public static AbstractGroup fromString(String s, Character keywordSeparator, FileUpdateMonitor fileMonitor, MetaData metaData) throws ParseException

Re-create a group instance from a textual representation.

Parameters
s:String

The result from the group's toString() method.

Returns:AbstractGroup

New instance of the encoded group.

Exceptions
ParseException:
If an error occurred and a group could not be created, e.g. due to a malformed regular expression.
importGroupsback to summary
public static GroupTreeNode importGroups(List<String> orderedData, Character keywordSeparator, FileUpdateMonitor fileMonitor, MetaData metaData) throws ParseException
keywordGroupFromStringback to summary
private static KeywordGroup keywordGroupFromString(String s, Character keywordSeparator) throws ParseException

Parses s and recreates the KeywordGroup from it.

Parameters
s:String

The String representation obtained from KeywordGroup.toString()

legacyExplicitGroupFromStringback to summary
private static ExplicitGroup legacyExplicitGroupFromString(String input, Character keywordSeparator) throws ParseException
searchGroupFromStringback to summary
private static AbstractGroup searchGroupFromString(String s)

Parses s and recreates the SearchGroup from it.

Parameters
s:String

The String representation obtained from SearchGroup.toString(), or null if incompatible

texGroupFromStringback to summary
private static AbstractGroup texGroupFromString(String string, FileUpdateMonitor fileMonitor, MetaData metaData) throws ParseException