Top Constructors Methods
org.jabref.logic.util

public Class UpdateField

extends Object
Class Inheritance
Imports
java.util.Collection, .Optional, org.jabref.logic.preferences.OwnerPreferences, .TimestampPreferences, org.jabref.model.FieldChange, org.jabref.model.entry.BibEntry, org.jabref.model.entry.field.Field, .StandardField

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static void
setAutomaticFields(BibEntry entry, boolean setOwner, String owner, boolean setTimeStamp, String timeStamp)

public static void
setAutomaticFields(Collection<BibEntry> entries, OwnerPreferences ownerPreferences, TimestampPreferences timestampPreferences)

Sets empty or non-existing owner fields of bibtex entries inside a List to a specified default value.

public static Optional<FieldChange>
updateField(BibEntry be, Field field, String newValue)

Updating a field will result in the entry being reformatted on save

public static Optional<FieldChange>
updateField(BibEntry be, Field field, String newValue, Boolean
If true the field value is removed when the current value is equals to newValue
nullFieldIfValueIsTheSame
)

Undoable change of field value

public static Optional<FieldChange>
updateNonDisplayableField(BibEntry be, Field field, String newValue)

Updating a non-displayable field does not result in the entry being reformatted on save

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

UpdateFieldback to summary
private UpdateField()

Method Detail

setAutomaticFieldsback to summary
private static void setAutomaticFields(BibEntry entry, boolean setOwner, String owner, boolean setTimeStamp, String timeStamp)
setAutomaticFieldsback to summary
public static void setAutomaticFields(Collection<BibEntry> entries, OwnerPreferences ownerPreferences, TimestampPreferences timestampPreferences)

Sets empty or non-existing owner fields of bibtex entries inside a List to a specified default value. Timestamp field is also set. Preferences are checked to see if these options are enabled.

updateFieldback to summary
public static Optional<FieldChange> updateField(BibEntry be, Field field, String newValue)

Updating a field will result in the entry being reformatted on save

updateFieldback to summary
public static Optional<FieldChange> updateField(BibEntry be, Field field, String newValue, Boolean nullFieldIfValueIsTheSame)

Undoable change of field value

Parameters
nullFieldIfValueIsTheSame:Boolean

If true the field value is removed when the current value is equals to newValue

updateNonDisplayableFieldback to summary
public static Optional<FieldChange> updateNonDisplayableField(BibEntry be, Field field, String newValue)

Updating a non-displayable field does not result in the entry being reformatted on save