public class BibtexEntry
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ID_FIELD |
Constructor and Description |
---|
BibtexEntry() |
BibtexEntry(java.lang.String id) |
BibtexEntry(java.lang.String id,
BibtexEntryType type) |
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(java.beans.VetoableChangeListener listener)
Adds a VetoableChangeListener, which is notified of field
changes.
|
protected boolean |
allFieldsPresent(java.lang.String[] fields,
BibtexDatabase database)
Determines whether this entry has all the given fields present.
|
void |
clearField(java.lang.String name)
Remove the mapping for the field name, and notify listeners about
the change.
|
java.lang.Object |
clone()
Returns a clone of this entry.
|
java.lang.String |
describeRequiredFields()
Returns a string describing the required fields for this entry.
|
java.util.Set<java.lang.String> |
getAllFields()
Returns an set containing the names of all fields that are
set for this particular entry.
|
java.lang.String |
getAuthorTitleYear(int maxCharacters) |
java.lang.String |
getCiteKey() |
java.lang.String |
getField(java.lang.String name)
Returns the contents of the given field, or null if it is not set.
|
java.lang.String |
getId()
Returns this entry's ID.
|
java.lang.String[] |
getOptionalFields()
Returns an array describing the optional fields for this entry.
|
java.lang.String[] |
getRequiredFields()
Returns an array describing the required fields for this entry.
|
BibtexEntryType |
getType()
Returns this entry's type.
|
boolean |
hasAllRequiredFields(BibtexDatabase database)
Returns true if this entry contains the fields it needs to be
complete.
|
boolean |
isGroupHit() |
boolean |
isSearchHit() |
void |
removePropertyChangeListener(java.beans.VetoableChangeListener listener)
Removes a property listener.
|
void |
setField(java.util.Map<java.lang.String,java.lang.String> fields)
Sets a number of fields simultaneously.
|
void |
setField(java.lang.String name,
java.lang.String value)
Set a field, and notify listeners about the change.
|
void |
setGroupHit(boolean groupHit) |
void |
setId(java.lang.String id)
Sets this entry's ID, provided the database containing it
doesn't veto the change.
|
void |
setSearchHit(boolean searchHit) |
void |
setType(BibtexEntryType type)
Sets this entry's type.
|
java.lang.String |
toString() |
boolean |
updateType()
Prompts the entry to call BibtexEntryType.getType(String) with
its current type name as argument, and sets its type according
to what is returned.
|
void |
write(java.io.Writer out,
FieldFormatter ff,
boolean write)
Write this entry to the given Writer, with the given FieldFormatter.
|
public static final java.lang.String ID_FIELD
public BibtexEntry()
public BibtexEntry(java.lang.String id)
public BibtexEntry(java.lang.String id, BibtexEntryType type)
public java.lang.String[] getOptionalFields()
public java.lang.String[] getRequiredFields()
public java.util.Set<java.lang.String> getAllFields()
public java.lang.String describeRequiredFields()
public boolean hasAllRequiredFields(BibtexDatabase database)
public BibtexEntryType getType()
public void setType(BibtexEntryType type)
public boolean updateType()
public void setId(java.lang.String id) throws KeyCollisionException
KeyCollisionException
public java.lang.String getId()
public java.lang.String getField(java.lang.String name)
public java.lang.String getCiteKey()
public void setField(java.util.Map<java.lang.String,java.lang.String> fields)
public void setField(java.lang.String name, java.lang.String value)
name
- The field to set.value
- The value to set.public void clearField(java.lang.String name)
name
- The field to clear.protected boolean allFieldsPresent(java.lang.String[] fields, BibtexDatabase database)
fields
- An array of field names to be checked.database
- The database in which to look up crossref'd entries, if any. This
argument can be null, meaning that no attempt will be made to follow crossrefs.public void addPropertyChangeListener(java.beans.VetoableChangeListener listener)
public void removePropertyChangeListener(java.beans.VetoableChangeListener listener)
public void write(java.io.Writer out, FieldFormatter ff, boolean write) throws java.io.IOException
write
- True if this is a write, false if it is a display. The write will
not include non-writeable fields if it is a write, otherwise non-displayable fields
will be ignored. Refer to GUIGlobals for isWriteableField(String) and
isDisplayableField(String).java.io.IOException
public java.lang.Object clone()
clone
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public boolean isSearchHit()
public void setSearchHit(boolean searchHit)
public boolean isGroupHit()
public void setGroupHit(boolean groupHit)
public java.lang.String getAuthorTitleYear(int maxCharacters)
maxCharacters
- The maximum number of characters (additional
characters are replaced with "..."). Set to 0 to disable truncation.