### org.jfree.layouting.normalizer.generator

# Class DefaultContentGenerator

- `java.lang.Object`
- - `org.jfree.layouting.normalizer.generator.DefaultContentGenerator`

Implemented Interfaces:
  ContentGenerator, StatefullComponent

`public class DefaultContentGenerator`
`extends java.lang.Object`
`implements ContentGenerator`

The default content generator produces CSS-compliant content structures (also known as DOM-Trees). This model explicitly allows block elements to contain other block elements and to do all kinds of weird mixing of elements.

The content generator already has all knowledge to compute the manual pagebreaks. So this class could already fire pagebreaks. The next element in the layouting chain will be the Layouter itself. The renderer computes the element positions,knows about the page sizes (and whether we have pages anyway) and more important - keeps track of the current page and the page fill state.

The content generator is conceptionally a part of the normalizer step, and thererfore has access to the raw display model. The renderer receives a more generic view with no object hierarchies at all - if that whould be needed, it has to be rebuilt. (This simplifies serialization, so that most remote calls are now self-contained and do not supply a possibly contradictionary context (in terms of object-identity)).

Author:
  Thomas Morgner

  ## Constructor Summary

  `DefaultContentGenerator(LayoutProcess layoutProcess)`

  `DefaultContentGenerator(Renderer renderer)`

  ## Method Summary

  `void`

  `addContent(LayoutContext node, ContentToken contentToken)`

  `void`

  `addPassThroughContent(LayoutContext node, ContentToken token)`

  `void`

  `finishedBlock()`

  `void`

  `finishedDocument()`
    Receives notification, that a new flow has started.

  `void`

  `finishedFlow()`

  `void`

  `finishedInline()`

  `void`

  `finishedMarker()`

  `void`

  `finishedPassThrough()`

  `void`

  `finishedRootInline()`

  `void`

  `finishedTable()`

  `void`

  `finishedTableCaption()`

  `void`

  `finishedTableCell()`

  `void`

  `finishedTableColumn()`

  `void`

  `finishedTableColumnGroup()`

  `void`

  `finishedTableRow()`

  `void`

  `finishedTableSection()`

  `Renderer`

  `getRenderer()`

  `void`

  `handlePageBreak(PageContext pageContext)`

  `State`

  `saveState()`

  `void`

  `startedBlock(LayoutContext element)`

  `void`

  `startedDocument(PageContext pageContext)`
    Receives the information, that the document processing has been started.

  `void`

  `startedFlow(LayoutContext element)`

  `void`

  `startedInline(LayoutContext element)`

  `void`

  `startedMarker(LayoutContext element)`

  `void`

  `startedPassThrough(LayoutContext element)`

  `void`

  `startedRootInline(LayoutContext element)`

  `void`

  `startedTable(LayoutContext element)`

  `void`

  `startedTableCaption(LayoutContext context)`

  `void`

  `startedTableCell(LayoutContext element)`

  `void`

  `startedTableColumn(LayoutContext element)`

  `void`

  `startedTableColumnGroup(LayoutContext element)`

  `void`

  `startedTableRow(LayoutContext element)`

  `void`

  `startedTableSection(LayoutContext element)`

## Constructor Details

### DefaultContentGenerator

    public DefaultContentGenerator(LayoutProcess layoutProcess)

### DefaultContentGenerator

    protected DefaultContentGenerator(Renderer renderer)

## Method Details

### addContent

    public void addContent(LayoutContext node,
                           ContentToken contentToken)
                throws NormalizationException

> Specified by:
>   addContent in interface ContentGenerator

### addPassThroughContent

    public void addPassThroughContent(LayoutContext node,
                                      ContentToken token)
                throws NormalizationException

> Specified by:
>   addPassThroughContent in interface ContentGenerator

### finishedBlock

    public void finishedBlock()
                throws NormalizationException

> Specified by:
>   finishedBlock in interface ContentGenerator

### finishedDocument

    public void finishedDocument()
                throws NormalizationException

> Receives notification, that a new flow has started. A new flow is started for each flowing or absolutly positioned element.
> Specified by:
>   finishedDocument in interface ContentGenerator
> Parameters:

### finishedFlow

    public void finishedFlow()
                throws NormalizationException

> Specified by:
>   finishedFlow in interface ContentGenerator

### finishedInline

    public void finishedInline()
                throws NormalizationException

> Specified by:
>   finishedInline in interface ContentGenerator

### finishedMarker

    public void finishedMarker()
                throws NormalizationException

> Specified by:
>   finishedMarker in interface ContentGenerator

### finishedPassThrough

    public void finishedPassThrough()
                throws NormalizationException

> Specified by:
>   finishedPassThrough in interface ContentGenerator

### finishedRootInline

    public void finishedRootInline()
                throws NormalizationException

> Specified by:
>   finishedRootInline in interface ContentGenerator

### finishedTable

    public void finishedTable()
                throws NormalizationException

> Specified by:
>   finishedTable in interface ContentGenerator

### finishedTableCaption

    public void finishedTableCaption()
                throws NormalizationException

> Specified by:
>   finishedTableCaption in interface ContentGenerator

### finishedTableCell

    public void finishedTableCell()
                throws NormalizationException

> Specified by:
>   finishedTableCell in interface ContentGenerator

### finishedTableColumn

    public void finishedTableColumn()
                throws NormalizationException

> Specified by:
>   finishedTableColumn in interface ContentGenerator

### finishedTableColumnGroup

    public void finishedTableColumnGroup()
                throws NormalizationException

> Specified by:
>   finishedTableColumnGroup in interface ContentGenerator

### finishedTableRow

    public void finishedTableRow()
                throws NormalizationException

> Specified by:
>   finishedTableRow in interface ContentGenerator

### finishedTableSection

    public void finishedTableSection()
                throws NormalizationException

> Specified by:
>   finishedTableSection in interface ContentGenerator

### getRenderer

    public Renderer getRenderer()

> Specified by:
>   getRenderer in interface ContentGenerator

### handlePageBreak

    public void handlePageBreak(PageContext pageContext)

> Specified by:
>   handlePageBreak in interface ContentGenerator

### saveState

    public State saveState()
                throws StateException

> Specified by:
>   saveState in interface StatefullComponent

### startedBlock

    public void startedBlock(LayoutContext element)
                throws NormalizationException

> Specified by:
>   startedBlock in interface ContentGenerator

### startedDocument

    public void startedDocument(PageContext pageContext)

> Receives the information, that the document processing has been started. This is fired only once.
> Specified by:
>   startedDocument in interface ContentGenerator

### startedFlow

    public void startedFlow(LayoutContext element)
                throws NormalizationException

> Specified by:
>   startedFlow in interface ContentGenerator

### startedInline

    public void startedInline(LayoutContext element)
                throws NormalizationException

> Specified by:
>   startedInline in interface ContentGenerator

### startedMarker

    public void startedMarker(LayoutContext element)
                throws NormalizationException

> Specified by:
>   startedMarker in interface ContentGenerator

### startedPassThrough

    public void startedPassThrough(LayoutContext element)
                throws NormalizationException

> Specified by:
>   startedPassThrough in interface ContentGenerator

### startedRootInline

    public void startedRootInline(LayoutContext element)
                throws NormalizationException

> Specified by:
>   startedRootInline in interface ContentGenerator

### startedTable

    public void startedTable(LayoutContext element)
                throws NormalizationException

> Specified by:
>   startedTable in interface ContentGenerator

### startedTableCaption

    public void startedTableCaption(LayoutContext context)
                throws NormalizationException

> Specified by:
>   startedTableCaption in interface ContentGenerator

### startedTableCell

    public void startedTableCell(LayoutContext element)
                throws NormalizationException

> Specified by:
>   startedTableCell in interface ContentGenerator

### startedTableColumn

    public void startedTableColumn(LayoutContext element)
                throws NormalizationException

> Specified by:
>   startedTableColumn in interface ContentGenerator

### startedTableColumnGroup

    public void startedTableColumnGroup(LayoutContext element)
                throws NormalizationException

> Specified by:
>   startedTableColumnGroup in interface ContentGenerator

### startedTableRow

    public void startedTableRow(LayoutContext element)
                throws NormalizationException

> Specified by:
>   startedTableRow in interface ContentGenerator

### startedTableSection

    public void startedTableSection(LayoutContext element)
                throws NormalizationException

> Specified by:
>   startedTableSection in interface ContentGenerator