|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.hpi.fgis.dude.util.AbstractCleanable de.hpi.fgis.dude.datasource.AbstractDataSource<BibtexSource> de.hpi.fgis.dude.datasource.BibtexSource
public class BibtexSource
BibtexSource
represents *.bib files containing BibTeX syntax.
Nested Class Summary | |
---|---|
protected class |
BibtexSource.BibtexSourceIterator
BibtexSourceIterator is used for generating DuDeObject s out of BibtexSource s. |
Nested classes/interfaces inherited from class de.hpi.fgis.dude.datasource.AbstractDataSource |
---|
AbstractDataSource.AbstractDataSourceIterator<T extends AbstractDataSource<?>> |
Field Summary | |
---|---|
static String |
ADDITIONAL_AUTHORS_EXISTS_ATTRIBUTE
The name of the attribute for storing information, whether there is an explicit mention that not all authors are listed. |
static String |
KEY_ATTRIBUTE
The name of the attribute that stores the key. |
static String |
PERSON_FIRST_NAME_ATTRIBUTE
The name of the attribute that stores the first name of a person. |
static String |
PERSON_LAST_NAME_ATTRIBUTE
The name of the attribute that stores the last name of a person. |
static String |
PERSON_LINEAGE_ATTRIBUTE
The name of the attribute that stores the lineage (like 'jr' or 'sr') of a person. |
static String |
PERSON_PRE_LAST_NAME_ATTRIBUTE
The name of the attribute that stores the prefix of the person's last name. |
static String |
TYPE_ATTRIBUTE
The name of the attribute that stores the type. |
Constructor Summary | |
---|---|
protected |
BibtexSource()
Internal constructor for Jsonable deserialization. |
|
BibtexSource(String identifier,
File file)
Initializes a BibtexSource . |
|
BibtexSource(String identifier,
File file,
boolean resolveCrossReferences)
Initializes a BibtexSource object. |
Method Summary | |
---|---|
void |
close()
|
void |
disableRetainingUnresolvedMacroReferences()
Disables retaining the macros, if their value cannot be resolved. |
void |
enableRetainingUnresolvedMacroReferences()
Enables retaining the macros, if their value cannot be resolved. |
void |
fromJson(DuDeJsonParser<?> jsonParser)
Initializes the current instance using the passed DuDeJsonParser . |
protected Iterator<BibtexAbstractEntry> |
getEntryIterator()
Returns the entry iterator. |
Iterator<DuDeObject> |
iterator()
|
boolean |
retainUnresolvedMacroReferences()
Checks, whether unresolved macro references are retained. |
void |
toJson(DuDeJsonGenerator jsonGenerator)
Generates the Json code using the passed DuDeJsonGenerator . |
Methods inherited from class de.hpi.fgis.dude.datasource.AbstractDataSource |
---|
addIdAttributes, autoGeneratedIds, equals, getExtractedRecordCount, getIdAttributes, getIdentifier, hashCode, setExtractedRecordCount, toString, withIdAttributes |
Methods inherited from class de.hpi.fgis.dude.util.AbstractCleanable |
---|
cleanUp, registerCleanable, registerCloseable |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface de.hpi.fgis.dude.util.Cleanable |
---|
cleanUp, registerCleanable, registerCloseable |
Field Detail |
---|
public static final String KEY_ATTRIBUTE
public static final String TYPE_ATTRIBUTE
public static final String ADDITIONAL_AUTHORS_EXISTS_ATTRIBUTE
public static final String PERSON_FIRST_NAME_ATTRIBUTE
public static final String PERSON_PRE_LAST_NAME_ATTRIBUTE
public static final String PERSON_LAST_NAME_ATTRIBUTE
public static final String PERSON_LINEAGE_ATTRIBUTE
Constructor Detail |
---|
protected BibtexSource()
Jsonable
deserialization.
public BibtexSource(String identifier, File file) throws FileNotFoundException, IOException, ExpansionException, ParseException
BibtexSource
.
identifier
- The identifier of the DataSource
instance.file
- The file of which the data will be extracted.
FileNotFoundException
- If the passed file was not found on the file system.
IOException
- If an error occurs while reading the file.
ExpansionException
- If an error occurred while resolving cross references, macros, etc.
ParseException
- If the BibTeX syntax of the passed file is invalid.public BibtexSource(String identifier, File file, boolean resolveCrossReferences) throws FileNotFoundException, IOException, ExpansionException, ParseException
BibtexSource
object.
identifier
- The identifier of the DataSource
instance.file
- The File
object, from which the data will be extracted.resolveCrossReferences
- Determines whether cross references shall be resolved or not.
FileNotFoundException
- If the passed file was not found on the file system.
IOException
- If an error occurs while reading the file.
ExpansionException
- If an error occurred while resolving cross references, macros, etc.
ParseException
- If the BibTeX syntax of the passed file is invalid.Method Detail |
---|
public void enableRetainingUnresolvedMacroReferences()
public void disableRetainingUnresolvedMacroReferences()
public boolean retainUnresolvedMacroReferences()
true
, if unresolved macro references will be retained; otherwise false
.protected Iterator<BibtexAbstractEntry> getEntryIterator()
public void close()
close
in interface Closeable
close
in class AbstractDataSource<BibtexSource>
public Iterator<DuDeObject> iterator()
iterator
in interface Iterable<DuDeObject>
iterator
in class AbstractDataSource<BibtexSource>
public void toJson(DuDeJsonGenerator jsonGenerator) throws org.codehaus.jackson.JsonGenerationException, IOException
Jsonable
DuDeJsonGenerator
.
toJson
in interface Jsonable
jsonGenerator
- The DuDeJsonGenerator
that is used internally.
org.codehaus.jackson.JsonGenerationException
- If an error occurs while generating the Json syntax.
IOException
- If an error occurs while writing to the output.public void fromJson(DuDeJsonParser<?> jsonParser) throws org.codehaus.jackson.JsonParseException, IOException
Jsonable
DuDeJsonParser
.
fromJson
in interface Jsonable
jsonParser
- The parser that is used for extracting the data out of the Json.
org.codehaus.jackson.JsonParseException
- If an error occurs while parsing the Json.
IOException
- If an error occurs while reading from the stream.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |