Package org.apache.maven.doxia.index
Class IndexingSink
- java.lang.Object
-
- org.apache.maven.doxia.sink.impl.AbstractSink
-
- org.apache.maven.doxia.sink.impl.SinkAdapter
-
- org.apache.maven.doxia.index.IndexingSink
-
- All Implemented Interfaces:
LogEnabled
,Markup
,Sink
public class IndexingSink extends SinkAdapter
A sink implementation for index.- Version:
- $Id$
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Stack<IndexEntry>
stack
The stack.private java.lang.String
title
The current title.private static int
TITLE
Title.private int
type
The current type.private static int
TYPE_DEFINED_TERM
Defined term.private static int
TYPE_FIGURE
Figure.private static int
TYPE_SECTION_1
Section 1.private static int
TYPE_SECTION_2
Section 2.private static int
TYPE_SECTION_3
Section 3.private static int
TYPE_SECTION_4
Section 4.private static int
TYPE_SECTION_5
Section 5.private static int
TYPE_TABLE
Table.-
Fields inherited from interface org.apache.maven.doxia.markup.Markup
COLON, EOL, EQUAL, GREATER_THAN, LEFT_CURLY_BRACKET, LEFT_SQUARE_BRACKET, LESS_THAN, MINUS, PLUS, QUOTE, RIGHT_CURLY_BRACKET, RIGHT_SQUARE_BRACKET, SEMICOLON, SLASH, SPACE, STAR
-
Fields inherited from interface org.apache.maven.doxia.sink.Sink
JUSTIFY_CENTER, JUSTIFY_LEFT, JUSTIFY_RIGHT, NUMBERING_DECIMAL, NUMBERING_LOWER_ALPHA, NUMBERING_LOWER_ROMAN, NUMBERING_UPPER_ALPHA, NUMBERING_UPPER_ROMAN, ROLE, SECTION_LEVEL_1, SECTION_LEVEL_2, SECTION_LEVEL_3, SECTION_LEVEL_4, SECTION_LEVEL_5, SECTION_LEVEL_6
-
-
Constructor Summary
Constructors Constructor Description IndexingSink(IndexEntry sectionEntry)
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Close the writer or the stream, if needed.java.lang.String
getTitle()
Getter for the fieldtitle
.protected void
init()
This is called inSink.head()
or inSink.close()
, and can be used to set the sink into a clear state so it can be re-used.IndexEntry
peek()
peek.void
pop()
Removes the IndexEntry at the top of this stack.void
push(IndexEntry entry)
Pushes an IndexEntry onto the top of this stack.void
pushNewEntry()
Creates and pushes a new IndexEntry onto the top of this stack.void
section1()
Starts a first heading element which contains the topic of the section.void
section1_()
Ends a first heading element.void
section2()
Starts a second heading element which contains the topic of the section.void
section2_()
Ends a second heading element.void
section3()
Starts a third heading element which contains the topic of the section.void
section3_()
Ends a third heading element.void
section4()
Starts a 4th heading element which contains the topic of the section.void
section4_()
Ends a 4th heading element.void
section5()
Starts a 5th heading element which contains the topic of the section.void
section5_()
Ends a 5th heading element.void
sectionTitle1()
Starts a first title heading element.void
sectionTitle1_()
Ends a first title heading element.void
sectionTitle2()
Starts a second title heading element.void
sectionTitle2_()
Ends a second title heading element.void
sectionTitle3()
Starts a third title heading element.void
sectionTitle3_()
Ends a third title heading element.void
sectionTitle4()
Starts a 4th title heading element.void
sectionTitle4_()
Ends a 4th title heading element.void
sectionTitle5()
Starts a 5th title heading element.void
sectionTitle5_()
Ends a 5th title heading element.void
text(java.lang.String text)
Adding a text.void
title()
Starts the title element.void
title_()
Ends the title element.-
Methods inherited from class org.apache.maven.doxia.sink.impl.SinkAdapter
address, address, address_, anchor, anchor, anchor_, article, article, article_, author, author, author_, blockquote, blockquote, blockquote_, body, body, body_, bold, bold_, comment, content, content, content_, data, data, data_, date, date, date_, definedTerm, definedTerm, definedTerm_, definition, definition, definition_, definitionList, definitionList, definitionList_, definitionListItem, definitionListItem, definitionListItem_, division, division, division_, figure, figure, figure_, figureCaption, figureCaption, figureCaption_, figureGraphics, figureGraphics, flush, footer, footer, footer_, head, head, head_, header, header, header_, horizontalRule, horizontalRule, inline, inline, inline_, italic, italic_, lineBreak, lineBreak, lineBreakOpportunity, lineBreakOpportunity, link, link, link_, list, list, list_, listItem, listItem, listItem_, monospaced, monospaced_, navigation, navigation, navigation_, nonBreakingSpace, numberedList, numberedList, numberedList_, numberedListItem, numberedListItem, numberedListItem_, pageBreak, paragraph, paragraph, paragraph_, rawText, section, section_, section6, section6_, sectionTitle, sectionTitle, sectionTitle_, sectionTitle_, sectionTitle6, sectionTitle6_, sidebar, sidebar, sidebar_, table, table, table_, tableCaption, tableCaption, tableCaption_, tableCell, tableCell, tableCell, tableCell_, tableHeaderCell, tableHeaderCell, tableHeaderCell, tableHeaderCell_, tableRow, tableRow, tableRow_, tableRows, tableRows_, text, time, time, time_, title, unknown, verbatim, verbatim, verbatim_
-
Methods inherited from class org.apache.maven.doxia.sink.impl.AbstractSink
enableLogging, getLog, unifyEOLs
-
-
-
-
Field Detail
-
TYPE_SECTION_1
private static final int TYPE_SECTION_1
Section 1.- See Also:
- Constant Field Values
-
TYPE_SECTION_2
private static final int TYPE_SECTION_2
Section 2.- See Also:
- Constant Field Values
-
TYPE_SECTION_3
private static final int TYPE_SECTION_3
Section 3.- See Also:
- Constant Field Values
-
TYPE_SECTION_4
private static final int TYPE_SECTION_4
Section 4.- See Also:
- Constant Field Values
-
TYPE_SECTION_5
private static final int TYPE_SECTION_5
Section 5.- See Also:
- Constant Field Values
-
TYPE_DEFINED_TERM
private static final int TYPE_DEFINED_TERM
Defined term.- See Also:
- Constant Field Values
-
TYPE_FIGURE
private static final int TYPE_FIGURE
Figure.- See Also:
- Constant Field Values
-
TYPE_TABLE
private static final int TYPE_TABLE
Table.- See Also:
- Constant Field Values
-
TITLE
private static final int TITLE
Title.- See Also:
- Constant Field Values
-
type
private int type
The current type.
-
title
private java.lang.String title
The current title.
-
stack
private final java.util.Stack<IndexEntry> stack
The stack.
-
-
Constructor Detail
-
IndexingSink
public IndexingSink(IndexEntry sectionEntry)
Default constructor.- Parameters:
sectionEntry
- The first index entry.
-
-
Method Detail
-
getTitle
public java.lang.String getTitle()
Getter for the field
title
.- Returns:
- the title
-
title
public void title()
Starts the title element.- Specified by:
title
in interfaceSink
- Overrides:
title
in classSinkAdapter
- See Also:
Sink.title(SinkEventAttributes)
-
section1
public void section1()
Starts a first heading element which contains the topic of the section.- Specified by:
section1
in interfaceSink
- Overrides:
section1
in classSinkAdapter
- See Also:
Sink.section(int,SinkEventAttributes)
-
sectionTitle1
public void sectionTitle1()
Starts a first title heading element. This element is optional, but if it exists, it has to be contained, and be the first element, within aSink.section1()
element.- Specified by:
sectionTitle1
in interfaceSink
- Overrides:
sectionTitle1
in classSinkAdapter
- See Also:
Sink.sectionTitle(int,SinkEventAttributes)
-
title_
public void title_()
Ends the title element.- Specified by:
title_
in interfaceSink
- Overrides:
title_
in classSinkAdapter
-
sectionTitle1_
public void sectionTitle1_()
Description copied from interface:Sink
Ends a first title heading element.- Specified by:
sectionTitle1_
in interfaceSink
- Overrides:
sectionTitle1_
in classSinkAdapter
-
section1_
public void section1_()
Ends a first heading element.- Specified by:
section1_
in interfaceSink
- Overrides:
section1_
in classSinkAdapter
-
section2
public void section2()
Starts a second heading element which contains the topic of the section. This has to be contained within aSink.section1()
element.- Specified by:
section2
in interfaceSink
- Overrides:
section2
in classSinkAdapter
- See Also:
Sink.section(int,SinkEventAttributes)
-
sectionTitle2
public void sectionTitle2()
Starts a second title heading element. This element is optional, but if it exists, it has to be contained, and be the first element, within aSink.section2()
element.- Specified by:
sectionTitle2
in interfaceSink
- Overrides:
sectionTitle2
in classSinkAdapter
- See Also:
Sink.sectionTitle(int,SinkEventAttributes)
-
sectionTitle2_
public void sectionTitle2_()
Description copied from interface:Sink
Ends a second title heading element.- Specified by:
sectionTitle2_
in interfaceSink
- Overrides:
sectionTitle2_
in classSinkAdapter
-
section2_
public void section2_()
Ends a second heading element.- Specified by:
section2_
in interfaceSink
- Overrides:
section2_
in classSinkAdapter
-
section3
public void section3()
Starts a third heading element which contains the topic of the section. This has to be contained within aSink.section2()
element.- Specified by:
section3
in interfaceSink
- Overrides:
section3
in classSinkAdapter
- See Also:
Sink.section(int,SinkEventAttributes)
-
sectionTitle3
public void sectionTitle3()
Starts a third title heading element. This element is optional, but if it exists, it has to be contained, and be the first element, within aSink.section3()
element.- Specified by:
sectionTitle3
in interfaceSink
- Overrides:
sectionTitle3
in classSinkAdapter
- See Also:
Sink.sectionTitle(int,SinkEventAttributes)
-
sectionTitle3_
public void sectionTitle3_()
Description copied from interface:Sink
Ends a third title heading element.- Specified by:
sectionTitle3_
in interfaceSink
- Overrides:
sectionTitle3_
in classSinkAdapter
-
section3_
public void section3_()
Ends a third heading element.- Specified by:
section3_
in interfaceSink
- Overrides:
section3_
in classSinkAdapter
-
section4
public void section4()
Starts a 4th heading element which contains the topic of the section. This has to be contained within aSink.section3()
element.- Specified by:
section4
in interfaceSink
- Overrides:
section4
in classSinkAdapter
- See Also:
Sink.section(int,SinkEventAttributes)
-
sectionTitle4
public void sectionTitle4()
Starts a 4th title heading element. This element is optional, but if it exists, it has to be contained, and be the first element, within aSink.section4()
element.- Specified by:
sectionTitle4
in interfaceSink
- Overrides:
sectionTitle4
in classSinkAdapter
- See Also:
Sink.sectionTitle(int,SinkEventAttributes)
-
sectionTitle4_
public void sectionTitle4_()
Description copied from interface:Sink
Ends a 4th title heading element.- Specified by:
sectionTitle4_
in interfaceSink
- Overrides:
sectionTitle4_
in classSinkAdapter
-
section4_
public void section4_()
Ends a 4th heading element.- Specified by:
section4_
in interfaceSink
- Overrides:
section4_
in classSinkAdapter
-
section5
public void section5()
Starts a 5th heading element which contains the topic of the section. This has to be contained within aSink.section4()
element.- Specified by:
section5
in interfaceSink
- Overrides:
section5
in classSinkAdapter
- See Also:
Sink.section(int,SinkEventAttributes)
-
sectionTitle5
public void sectionTitle5()
Starts a 5th title heading element. This element is optional, but if it exists, it has to be contained, and be the first element, within aSink.section5()
element.- Specified by:
sectionTitle5
in interfaceSink
- Overrides:
sectionTitle5
in classSinkAdapter
- See Also:
Sink.sectionTitle(int,SinkEventAttributes)
-
sectionTitle5_
public void sectionTitle5_()
Description copied from interface:Sink
Ends a 5th title heading element.- Specified by:
sectionTitle5_
in interfaceSink
- Overrides:
sectionTitle5_
in classSinkAdapter
-
section5_
public void section5_()
Ends a 5th heading element.- Specified by:
section5_
in interfaceSink
- Overrides:
section5_
in classSinkAdapter
-
text
public void text(java.lang.String text)
Adding a text.- Specified by:
text
in interfaceSink
- Overrides:
text
in classSinkAdapter
- Parameters:
text
- The text to write.- See Also:
Sink.text(String,SinkEventAttributes)
-
pushNewEntry
public void pushNewEntry()
Creates and pushes a new IndexEntry onto the top of this stack.
-
push
public void push(IndexEntry entry)
Pushes an IndexEntry onto the top of this stack.- Parameters:
entry
- to put.
-
pop
public void pop()
Removes the IndexEntry at the top of this stack.
-
peek
public IndexEntry peek()
peek.
- Returns:
- Looks at the IndexEntry at the top of this stack.
-
close
public void close()
Close the writer or the stream, if needed. Closing a previously-closed Sink has no effect.- Specified by:
close
in interfaceSink
- Overrides:
close
in classSinkAdapter
-
init
protected void init()
This is called inSink.head()
or inSink.close()
, and can be used to set the sink into a clear state so it can be re-used.- Overrides:
init
in classAbstractSink
-
-