|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.tuberlin.cs.flp.jspwiki.plugin.wikiarchive.ArchiveHandlerAbstract
de.tuberlin.cs.flp.jspwiki.plugin.wikiarchive.ArchiveHandlerExternalFormatAbstract
de.tuberlin.cs.flp.jspwiki.plugin.wikiarchive.ArchiveHandlerBibTeX
I/O-handler for bidirectional data interchange from/to a BibTeX bibliography file.
Field Summary | |
static java.lang.String |
CONTENT_SUFFIX
|
static java.lang.String |
CONTENT_TYPE
|
protected static java.util.Properties |
DEFAULT_ENTRIES
Default BibTeX-entries to labels mapping. |
protected static java.util.Map |
DEFAULT_ENTRIES_OPTIONS
Default entries to options-map mapping. |
protected static java.util.Properties |
DEFAULT_FORMATS
|
protected static java.util.Properties |
DEFAULT_TYPES
Default BibTeX-type to labels mapping. |
protected java.util.Properties |
entries
|
protected java.util.Map |
entriesOptions
|
protected java.util.Properties |
formats
|
protected java.util.Properties |
types
|
Fields inherited from class de.tuberlin.cs.flp.jspwiki.plugin.wikiarchive.ArchiveHandlerAbstract |
config, engine |
Fields inherited from interface de.tuberlin.cs.flp.jspwiki.plugin.wikiarchive.ArchiveHandler |
EXPORT, IMPORT |
Constructor Summary | |
ArchiveHandlerBibTeX()
|
Method Summary | |
protected static void |
appendToken(java.io.StreamTokenizer st,
java.lang.StringBuffer sb)
Appends the current token to a StringBuffer. |
protected static java.lang.String |
bibtexEntry(java.lang.String key,
java.lang.Object val)
Generated a field entry string inside a BibTeX entry. |
protected static java.lang.String |
braceBlock(java.io.StreamTokenizer st)
Parses a block enclosed in curly braces "{" and "}". |
protected ArchiveEntryBibTeX |
convertEntry(ArchiveEntry entry)
|
void |
createEntry(java.lang.Object data,
ArchiveEntry entry)
Creates a new archive entry in the data source handled by this ArchiveIOHandler. |
protected java.lang.String |
entry2bibtex(ArchiveEntryBibTeX entry)
Generate a single BibTeX entry string. |
java.lang.String |
getContentSuffix()
Content type for export via HTTP. |
java.lang.String |
getContentType()
Content type for export via HTTP. |
java.util.Properties |
getEntries()
|
java.util.Properties |
getEntryOptions(java.lang.String entryName)
|
java.util.Properties |
getFormats()
|
java.util.Properties |
getTypes()
Get BibTeX-type to labels mapping. |
void |
init(WikiEngine engine,
java.util.Map config)
Init. |
boolean |
isEntryOptional(java.lang.String entryName)
|
boolean |
isType(java.lang.String type)
|
protected static void |
optional(java.io.StreamTokenizer st,
char c)
Optionally allows a token to be the current token. |
protected java.util.Map |
parseAll(java.lang.Object data)
Retrieves all archive entries from the data source. |
java.lang.String |
performIO(boolean io,
Archive archive,
java.lang.Object data,
int mode,
java.util.Collection exceptions)
Perform either input from the Archive model interface
into the data source handled by this ArchiveIOHandler. |
protected static void |
putDefaults(java.util.Properties p,
java.lang.String[] s)
Puts an array of strings into the Properties-object, buy using each array member both as key and value for each entry. |
protected void |
replaceEntry(java.lang.Object data,
ArchiveEntry newEntryA,
ArchiveEntry oldEntryA)
Replaces an archive entry in the data source handled by this ArchiveIOHandler. |
protected static void |
require(java.io.StreamTokenizer st,
char tok)
Tests if the tokenizer's current token matches a specified character. |
protected static void |
require(java.io.StreamTokenizer st,
java.lang.String tok)
Tests if the tokenizer's current token matches a specified string. |
protected static void |
syntax(java.io.StreamTokenizer st)
Sets the tokenizer's syntax for parsing BibTeX. |
protected java.lang.String |
translateKey(java.lang.String key,
boolean fromTo)
|
protected java.util.Map |
translateKeys(java.util.Map m,
boolean fromTo)
Converts the key names of Map m from/to label-strings. |
protected java.lang.String |
translateType(java.lang.String name,
boolean fromTo)
Converts a BibTeX type name from or to its label-string. |
protected static java.lang.String |
until(java.io.StreamTokenizer st,
char tok)
Returns all tokens until another token occurs, concatenated as one string. |
Methods inherited from class de.tuberlin.cs.flp.jspwiki.plugin.wikiarchive.ArchiveHandlerExternalFormatAbstract |
createData, dataToString, msgDone, msgNotDone, msgToDo, stringToData |
Methods inherited from class de.tuberlin.cs.flp.jspwiki.plugin.wikiarchive.ArchiveHandlerAbstract |
equalEntries, getEngine, setEngine |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String CONTENT_TYPE
public static final java.lang.String CONTENT_SUFFIX
protected static java.util.Properties DEFAULT_FORMATS
formats
protected static java.util.Properties DEFAULT_ENTRIES
entries
protected static java.util.Map DEFAULT_ENTRIES_OPTIONS
entriesOptions
protected static java.util.Properties DEFAULT_TYPES
types
protected java.util.Properties types
protected java.util.Properties entries
protected java.util.Map entriesOptions
protected java.util.Properties formats
Constructor Detail |
public ArchiveHandlerBibTeX()
Method Detail |
public void init(WikiEngine engine, java.util.Map config)
init
in interface ArchiveHandler
init
in class ArchiveHandlerAbstract
engine
- config
- public java.lang.String performIO(boolean io, Archive archive, java.lang.Object data, int mode, java.util.Collection exceptions) throws java.io.IOException
Archive
model interface
into the data source handled by this ArchiveIOHandler.
performIO
in interface ArchiveHandler
performIO
in class ArchiveHandlerAbstract
io
- Switch between input or output mode, Archive
model interface.archive
- The Archive
model interface.data
- The data source handled by this ArchiveIOHandler.mode
- The processing mode. This is a bit mask with:exceptions
- Collection of entry names that should be treated as exceptions to the behaviour specified by mode
. (Not used.)
java.io.IOException
- if an i/o error occurspublic java.lang.String getContentType()
getContentType
in interface ArchiveHandler
getContentType
in class ArchiveHandlerAbstract
public java.lang.String getContentSuffix()
getContentSuffix
in interface ArchiveHandler
getContentSuffix
in class ArchiveHandlerAbstract
public void createEntry(java.lang.Object data, ArchiveEntry entry)
createEntry
in class ArchiveHandlerAbstract
data
- The data source handled by this ArchiveIOHandler.entry
- The entry.protected void replaceEntry(java.lang.Object data, ArchiveEntry newEntryA, ArchiveEntry oldEntryA)
replaceEntry
in class ArchiveHandlerAbstract
data
- The data source handled by this ArchiveIOHandler.newEntryA
- The new entry.oldEntryA
- The old entry.protected java.util.Map parseAll(java.lang.Object data) throws java.io.IOException
parseAll
in class ArchiveHandlerAbstract
data
- The data source handled by this ArchiveIOHandler.
java.io.IOException
- if an i/o error occursprotected ArchiveEntryBibTeX convertEntry(ArchiveEntry entry)
entry
-
public java.util.Properties getTypes()
types
public java.util.Properties getFormats()
public java.util.Properties getEntries()
public java.util.Properties getEntryOptions(java.lang.String entryName)
entryName
-
public boolean isEntryOptional(java.lang.String entryName)
entryName
-
public boolean isType(java.lang.String type)
type
- The type.
protected java.util.Map translateKeys(java.util.Map m, boolean fromTo)
m
- The map.fromTo
- If protected java.lang.String translateKey(java.lang.String key, boolean fromTo)
key
- fromTo
-
protected java.lang.String translateType(java.lang.String name, boolean fromTo)
name
- The name or label.fromTo
- If types
protected java.lang.String entry2bibtex(ArchiveEntryBibTeX entry)
entry
- The entry to output as BibTeX.
protected static java.lang.String bibtexEntry(java.lang.String key, java.lang.Object val)
key
- The field's name.val
- The field's value.
protected static void require(java.io.StreamTokenizer st, java.lang.String tok) throws java.io.IOException
st
- The stream tokenizer.tok
- The token to test match with.
java.io.IOException
- If the token does not match.protected static void require(java.io.StreamTokenizer st, char tok) throws java.io.IOException
st
- The stream tokenizer.tok
- The token to test match with.
java.io.IOException
- If the token does not match.protected static void optional(java.io.StreamTokenizer st, char c) throws java.io.IOException
st
- The stream tokenizer.c
- The token that may optionally occur.
java.io.IOException
- if an i/o error occursprotected static java.lang.String until(java.io.StreamTokenizer st, char tok) throws java.io.IOException
st
- The stream tokenizer.tok
- The token until which other tokens should be concatenated to the result string.
java.io.IOException
- if an i/o error occursprotected static void appendToken(java.io.StreamTokenizer st, java.lang.StringBuffer sb)
st
- The stream tokenizer.sb
- The string buffer.protected static java.lang.String braceBlock(java.io.StreamTokenizer st) throws java.io.IOException
st
- The stream tokenizer.
java.io.IOException
- if an i/o error occursprotected static void syntax(java.io.StreamTokenizer st)
st
- The stream tokenizer.protected static void putDefaults(java.util.Properties p, java.lang.String[] s)
p
- The properties.s
- The string array.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |