|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nuiton.jrst.JRSTReader
public class JRSTReader
Le principe est d'utiliser les methodes peek* JRSTLexer pour
prendre l'element que l'on attend, si la methode retourne null ou un autre
element et bien c que ce n'est pas le bon choix, cela veut dire que l'element
courant est fini d'etre lu (plus de paragraphe dans la section par exemple)
ou qu'il y a une erreur dans le fichier en entre.
On construit un arbre XML representant le RST au fur et a mesure, on peut
ensuite appliquer une feuille de style ou autre chose avec
JRSTGenerator
Tous les elements ont un attribut level qui permet de savoir on il est dans la hierarchie. Le Document a le level -1001, et les sections/titres on pour level les valeurs 1000, -999, -998, ...
de cette facon les methods isUpperLevel et isSameLevel fonctionne pour tous les elements de la meme facon
abbreviation acronym address (done) admonition (done) attention (done) attribution author (done) authors (done) block_quote (done) bullet_list (done) caption caution (done) citation citation_reference classifier (done) colspec (done) comment compound contact (done) container copyright (done) danger (done) date (done) decoration (done) definition (done) definition_list (done) definition_list_item (done) description (done) docinfo (done) doctest_block (done) document (done) emphasis (done) entry (done) enumerated_list (done) error (done) field (done) field_body (done) field_list (done) field_name (done) figure footer (done) footnote (done) footnote_reference (done) generated header (done) hint (done) image (done) important (done) inline label legend line (done) line_block (done) list_item (done) literal (done) literal_block (done) note (done) option (done) option_argument (done) option_group (done) option_list (done) option_list_item (done) option_string (done) organization (done) paragraph (done) pending problematic raw reference (done) revision (done) row (done) rubric section (done) sidebar (done) status (done) strong (done) subscript substitution_definition substitution_reference subtitle (done) superscript system_message table (done) target (done) tbody (done) term (done) tgroup (done) thead (done) tip (done) title (done) title_reference topic (done) transition (done) version (done) warning (done)Created: 27 oct. 06 00:15:34
| Field Summary | |
|---|---|
protected static Map<String,JRSTDirective> |
defaultDirectives
|
protected Map<String,JRSTDirective> |
directives
|
protected boolean |
ERROR_MISSING_ITEM
|
protected static int |
MAX_SECTION_DEPTH
|
| Constructor Summary | |
|---|---|
JRSTReader()
|
|
| Method Summary | |
|---|---|
static void |
addDefaultDirectives(String name,
JRSTDirective directive)
|
void |
addDirectives(String name,
JRSTDirective directive)
|
static JRSTDirective |
getDefaultDirective(String name)
|
JRSTDirective |
getDirective(String name)
|
org.dom4j.Document |
read(Reader reader)
On commence par decouper tout le document en Element, puis on construit l'article a partir de ces elements. |
void |
setVariable(int idMax,
int symbolMax,
int symbolMaxRef,
LinkedList<Integer> lblFootnotes,
LinkedList<Integer> lblFootnotesRef,
LinkedList<org.dom4j.Element> eFootnotes,
LinkedList<org.dom4j.Element> eTarget,
LinkedList<org.dom4j.Element> eTargetAnonymous,
LinkedList<org.dom4j.Element> eTargetAnonymousCopy)
Initialises les variables d'environements par ex, les hyperlinks peuvent etre referencer dans tous le document |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected boolean ERROR_MISSING_ITEM
protected static int MAX_SECTION_DEPTH
protected static Map<String,JRSTDirective> defaultDirectives
protected Map<String,JRSTDirective> directives
| Constructor Detail |
|---|
public JRSTReader()
| Method Detail |
|---|
public static JRSTDirective getDefaultDirective(String name)
name -
public static void addDefaultDirectives(String name,
JRSTDirective directive)
name - directive - the defaultDirectives to setpublic JRSTDirective getDirective(String name)
name -
public void addDirectives(String name,
JRSTDirective directive)
name - directive - the defaultDirectives to set
public org.dom4j.Document read(Reader reader)
throws Exception
reader -
Exception
public void setVariable(int idMax,
int symbolMax,
int symbolMaxRef,
LinkedList<Integer> lblFootnotes,
LinkedList<Integer> lblFootnotesRef,
LinkedList<org.dom4j.Element> eFootnotes,
LinkedList<org.dom4j.Element> eTarget,
LinkedList<org.dom4j.Element> eTargetAnonymous,
LinkedList<org.dom4j.Element> eTargetAnonymousCopy)
Initialises les variables d'environements par ex, les hyperlinks peuvent etre referencer dans tous le document
idMax - symbolMax - symbolMaxRef - lblFootnotes - lblFootnotesRef - eFootnotes - eTarget - eTargetAnonymous - eTargetAnonymousCopy -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||