Verified Owner
Top Inners Fields Constructors Methods
org.jabref.model.entry

public Class BibEntryTypesManager

extends Object
Class Inheritance
Imports
java.util.Collection, .HashSet, .List, .Optional, .Set, .SortedSet, .TreeSet, java.util.function.Predicate, java.util.stream.Collectors, .Stream, org.jabref.model.database.BibDatabaseMode, org.jabref.model.entry.field.BibField, .Field, .OrFields, org.jabref.model.entry.types.BiblatexAPAEntryTypeDefinitions, .BiblatexEntryTypeDefinitions, .BiblatexNonStandardEntryTypeDefinitions, .BiblatexSoftwareEntryTypeDefinitions, .BibtexEntryTypeDefinitions, .EntryType, .EntryTypeFactory, .IEEETranEntryTypeDefinitions, com.google.common.annotations.VisibleForTesting, org.slf4j.Logger, .LoggerFactory

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
BibEntryTypesManager.InternalEntryTypes

This class is used to specify entry types for either BIBTEX and BIBLATEX.

Field Summary

Modifier and TypeField and Description
private final BibEntryTypesManager.InternalEntryTypes
private final BibEntryTypesManager.InternalEntryTypes
private static final Logger

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
public void
addCustomOrModifiedTypes(List<BibEntryType> customizedEntryTypes, BibDatabaseMode mode)

Sets the given custom entry types for BibTeX and biblatex mode

public void
public Optional<BibEntryType>
enrich(EntryType type, BibDatabaseMode
the mode of the BibDatabase, may be null
mode
)

This method returns the BibEntryType for the entry type.

public Collection<BibEntryType>
getAllCustomizedTypes(BibDatabaseMode mode)

Returns all types which are customized (be it a variant of a standard type or a completely new type)

public List<BibEntryType>

Returns:

the list of all found custom types
getAllCustomTypes
(BibDatabaseMode
the BibDatabaseMode to be checked
mode
)

For a given database mode, determine all custom entry types, i.e. types that are not overwritten standard types but real custom types.

public Collection<BibEntryType>
getAllTypes(BibDatabaseMode mode)

Returns all types known to JabRef.

pack-priv BibEntryTypesManager.InternalEntryTypes
public boolean
isCustomOrModifiedType(BibEntryType type, BibDatabaseMode mode)

Returns true if the type is a custom type, or if it is a standard type which has different customized fields

public boolean
isCustomType(EntryType type, BibDatabaseMode mode)

Checks if the given type is NOT a standard type AND customized inside the entry types manager.

public boolean
isCustomType(BibEntryType type, BibDatabaseMode mode)

Checks if the given type is NOT a standard type AND customized inside the entry types manager.

public boolean

Returns:

true if the given type is unknown here or is different from the stored one
isDifferentCustomOrModifiedType
(BibEntryType type, BibDatabaseMode mode)

Required to check if during load of a .bib file the customization of the entry type is different

public void
public void
update(BibEntryType entryType, BibDatabaseMode mode)

Updates the internal list.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

BIBLATEX_ENTRYTYPESback to summary
private final BibEntryTypesManager.InternalEntryTypes BIBLATEX_ENTRYTYPES
BIBTEX_ENTRYTYPESback to summary
private final BibEntryTypesManager.InternalEntryTypes BIBTEX_ENTRYTYPES
LOGGERback to summary
private static final Logger LOGGER

Constructor Detail

BibEntryTypesManagerback to summary
public BibEntryTypesManager()

Method Detail

addCustomOrModifiedTypeback to summary
public void addCustomOrModifiedType(BibEntryType entryType, BibDatabaseMode mode)
addCustomOrModifiedTypesback to summary
public void addCustomOrModifiedTypes(List<BibEntryType> customizedEntryTypes, BibDatabaseMode mode)

Sets the given custom entry types for BibTeX and biblatex mode

clearAllCustomEntryTypesback to summary
public void clearAllCustomEntryTypes(BibDatabaseMode mode)
enrichback to summary
public Optional<BibEntryType> enrich(EntryType type, BibDatabaseMode mode)

This method returns the BibEntryType for the entry type.

Parameters
mode:BibDatabaseMode

the mode of the BibDatabase, may be null

getAllCustomizedTypesback to summary
public Collection<BibEntryType> getAllCustomizedTypes(BibDatabaseMode mode)

Returns all types which are customized (be it a variant of a standard type or a completely new type)

getAllCustomTypesback to summary
public List<BibEntryType> getAllCustomTypes(BibDatabaseMode mode)

For a given database mode, determine all custom entry types, i.e. types that are not overwritten standard types but real custom types. For example, a modified "article" type will not be included in the list, but an entry type like "MyCustomType" will be included.

Parameters
mode:BibDatabaseMode

the BibDatabaseMode to be checked

Returns:List<BibEntryType>

the list of all found custom types

getAllTypesback to summary
public Collection<BibEntryType> getAllTypes(BibDatabaseMode mode)

Returns all types known to JabRef. This includes the standard types as well as the customized types

getEntryTypesback to summary
pack-priv BibEntryTypesManager.InternalEntryTypes getEntryTypes(BibDatabaseMode mode)
Annotations
@VisibleForTesting
isCustomOrModifiedTypeback to summary
public boolean isCustomOrModifiedType(BibEntryType type, BibDatabaseMode mode)

Returns true if the type is a custom type, or if it is a standard type which has different customized fields

isCustomTypeback to summary
public boolean isCustomType(EntryType type, BibDatabaseMode mode)

Checks if the given type is NOT a standard type AND customized inside the entry types manager. There might be also types not known to the entry types manager, which are neither standard nor customized.

isCustomTypeback to summary
public boolean isCustomType(BibEntryType type, BibDatabaseMode mode)

Checks if the given type is NOT a standard type AND customized inside the entry types manager. There might be also types not known to the entry types manager, which are neither standard nor customized.

isDifferentCustomOrModifiedTypeback to summary
public boolean isDifferentCustomOrModifiedType(BibEntryType type, BibDatabaseMode mode)

Required to check if during load of a .bib file the customization of the entry type is different

Returns:boolean

true if the given type is unknown here or is different from the stored one

removeCustomOrModifiedEntryTypeback to summary
public void removeCustomOrModifiedEntryType(BibEntryType entryType, BibDatabaseMode mode)
updateback to summary
public void update(BibEntryType entryType, BibDatabaseMode mode)

Updates the internal list. In case the given entry type equals a standard type, it is removed from the list of customized types. Otherwise, it is stored as customized.

org.jabref.model.entry back to summary

pack-priv Class BibEntryTypesManager.InternalEntryTypes

extends Object
Class Inheritance
  • java.lang.Object
  • org.jabref.model.entry.BibEntryTypesManager.InternalEntryTypes
Annotations
@VisibleForTesting

This class is used to specify entry types for either BIBTEX and BIBLATEX.

Field Summary

Modifier and TypeField and Description
private final SortedSet<BibEntryType>
pack-priv final Set<BibEntryType>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private void
private void
private Optional<BibEntryType>
enrich(EntryType type)

This method returns the BibtexEntryType for the name of a type, or an empty optional if it does not exist.

private SortedSet<BibEntryType>
getAllCustomizedTypes()

Returns all types which are customized (be it a variant of a standard type or a completely new type)

private List<BibEntryType>
private SortedSet<BibEntryType>
getAllTypes()

Returns all types known to JabRef.

private Optional<BibEntryType>
private boolean
private boolean
private boolean
private void
pack-priv static Predicate<BibEntryType>
typeEquals(EntryType toCompare)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

customOrModifiedTypeback to summary
private final SortedSet<BibEntryType> customOrModifiedType
standardTypesback to summary
pack-priv final Set<BibEntryType> standardTypes
Annotations
@VisibleForTesting

Constructor Detail

InternalEntryTypesback to summary
private InternalEntryTypes(List<BibEntryType> standardTypes)

Method Detail

addCustomOrModifiedTypeback to summary
private void addCustomOrModifiedType(BibEntryType type)
clearAllCustomEntryTypesback to summary
private void clearAllCustomEntryTypes()
enrichback to summary
private Optional<BibEntryType> enrich(EntryType type)

This method returns the BibtexEntryType for the name of a type, or an empty optional if it does not exist.

getAllCustomizedTypesback to summary
private SortedSet<BibEntryType> getAllCustomizedTypes()

Returns all types which are customized (be it a variant of a standard type or a completely new type)

getAllCustomTypesback to summary
private List<BibEntryType> getAllCustomTypes()
getAllTypesback to summary
private SortedSet<BibEntryType> getAllTypes()

Returns all types known to JabRef. This includes the standard types as well as the customized types

getStandardTypeback to summary
private Optional<BibEntryType> getStandardType(BibEntryType entryType)
isCustomOrModifiedTypeback to summary
private boolean isCustomOrModifiedType(BibEntryType entryType)
isStandardTypeback to summary
private boolean isStandardType(BibEntryType entryType)
isStandardTypeback to summary
private boolean isStandardType(EntryType entryType)
removeCustomOrModifiedEntryTypeback to summary
private void removeCustomOrModifiedEntryType(BibEntryType type)
typeEqualsback to summary
pack-priv static Predicate<BibEntryType> typeEquals(EntryType toCompare)