org.jfree.layouting.layouter.feed

Class DefaultInputFeed

Implemented Interfaces:
InputFeed, StatefullComponent

public class DefaultInputFeed
extends java.lang.Object
implements InputFeed

Creation-Date: 05.12.2005, 18:19:03
Author:
Thomas Morgner

Field Summary

static int
DOCUMENT_FINISHED
static int
DOCUMENT_STARTING
static int
ELEMENT_ATTRIBUTES
static int
ELEMENT_CONTENT
static int
ELEMENT_EXPECTED
static int
ELEMENT_STARTED
static int
META_EXPECTED
static int
META_NODE_ATTRIBUTES
static int
META_NODE_START
static int
META_PROCESSING

Constructor Summary

DefaultInputFeed(LayoutProcess process)
DefaultInputFeed(LayoutProcess process, boolean init)

Method Summary

void
addContent(String text)
void
addDocumentAttribute(String name, Object attr)
Adds document attributes.
void
endDocument()
void
endElement()
void
endMetaInfo()
void
endMetaNode()
Normalizer
getCurrentNormalizer()
Warning; This method is needed internally, mess with it from the outside and you will run into trouble.
NamespaceCollection
getNamespaceCollection()
Normalizer
getNormalizer()
protected LayoutProcess
getProcess()
protected int
getState()
void
handlePageBreakEncountered(CSSValue pageName, PseudoPage[] pseudoPages)
boolean
isPagebreakEncountered()
protected void
performAddContent(String text)
protected void
performAddDocumentAttribute(String name, Object attr)
protected void
performEndDocument()
protected void
performEndElement()
protected void
performEndMetaInfo()
protected void
performEndMetaNode()
protected void
performSetAttribute(String namespace, String name, Object attr)
protected void
performSetMetaNodeAttribute(String name, Object attr)
protected void
performStartDocument()
protected void
performStartElement(String namespace, String name)
protected void
performStartMetaInfo()
protected void
performStartMetaNode()
void
resetPageBreakFlag()
State
saveState()
void
setAttribute(String namespace, String name, Object attr)
void
setMetaNodeAttribute(String name, Object attr)
Defines an attribute for the meta-nodes.
void
startDocument()
Starts the document processing.
void
startElement(String namespace, String name)
void
startMetaInfo()
Signals, that meta-data follows.
void
startMetaNode()
Starts a new meta-node structure.

Field Details

DOCUMENT_FINISHED

public static final int DOCUMENT_FINISHED
Field Value:
9

DOCUMENT_STARTING

public static final int DOCUMENT_STARTING
Field Value:
0

ELEMENT_ATTRIBUTES

public static final int ELEMENT_ATTRIBUTES
Field Value:
7

ELEMENT_CONTENT

public static final int ELEMENT_CONTENT
Field Value:
8

ELEMENT_EXPECTED

public static final int ELEMENT_EXPECTED
Field Value:
5

ELEMENT_STARTED

public static final int ELEMENT_STARTED
Field Value:
6

META_EXPECTED

public static final int META_EXPECTED
Field Value:
1

META_NODE_ATTRIBUTES

public static final int META_NODE_ATTRIBUTES
Field Value:
4

META_NODE_START

public static final int META_NODE_START
Field Value:
3

META_PROCESSING

public static final int META_PROCESSING
Field Value:
2

Constructor Details

DefaultInputFeed

public DefaultInputFeed(LayoutProcess process)

DefaultInputFeed

protected DefaultInputFeed(LayoutProcess process,
                           boolean init)

Method Details

addContent

public final void addContent(String text)
            throws InputFeedException
Specified by:
addContent in interface InputFeed

addDocumentAttribute

public final void addDocumentAttribute(String name,
                                       Object attr)
Adds document attributes. Document attributes hold object factories and document wide resources which appear only once.
Specified by:
addDocumentAttribute in interface InputFeed
Parameters:
name -
attr -

endDocument

public final void endDocument()
            throws InputFeedException
Specified by:
endDocument in interface InputFeed

endElement

public final void endElement()
            throws InputFeedException
Specified by:
endElement in interface InputFeed

endMetaInfo

public final void endMetaInfo()
            throws InputFeedException
Specified by:
endMetaInfo in interface InputFeed

endMetaNode

public void endMetaNode()
Specified by:
endMetaNode in interface InputFeed

getCurrentNormalizer

public Normalizer getCurrentNormalizer()
Warning; This method is needed internally, mess with it from the outside and you will run into trouble. The normalizer is a statefull component and any call to it may mess up the state. From there on, 'Abandon every hope, ye who enter here'.
Specified by:
getCurrentNormalizer in interface InputFeed
Returns:

getNamespaceCollection

public NamespaceCollection getNamespaceCollection()
Specified by:
getNamespaceCollection in interface InputFeed

getNormalizer

public Normalizer getNormalizer()

getProcess

protected LayoutProcess getProcess()

getState

protected int getState()

handlePageBreakEncountered

public void handlePageBreakEncountered(CSSValue pageName,
                                       PseudoPage[] pseudoPages)
            throws NormalizationException
Specified by:
handlePageBreakEncountered in interface InputFeed

isPagebreakEncountered

public boolean isPagebreakEncountered()
Specified by:
isPagebreakEncountered in interface InputFeed

performAddContent

protected void performAddContent(String text)
            throws InputFeedException,
                   IOException,
                   NormalizationException

performAddDocumentAttribute

protected void performAddDocumentAttribute(String name,
                                           Object attr)

performEndDocument

protected void performEndDocument()
            throws IOException,
                   NormalizationException

performEndElement

protected void performEndElement()
            throws IOException,
                   NormalizationException

performEndMetaInfo

protected void performEndMetaInfo()
            throws InputFeedException

performEndMetaNode

protected void performEndMetaNode()

performSetAttribute

protected void performSetAttribute(String namespace,
                                   String name,
                                   Object attr)

performSetMetaNodeAttribute

protected void performSetMetaNodeAttribute(String name,
                                           Object attr)

performStartDocument

protected void performStartDocument()

performStartElement

protected void performStartElement(String namespace,
                                   String name)

performStartMetaInfo

protected void performStartMetaInfo()

performStartMetaNode

protected void performStartMetaNode()

resetPageBreakFlag

public void resetPageBreakFlag()
Specified by:
resetPageBreakFlag in interface InputFeed

saveState

public State saveState()
            throws StateException
Specified by:
saveState in interface StatefullComponent

setAttribute

public final void setAttribute(String namespace,
                               String name,
                               Object attr)
Specified by:
setAttribute in interface InputFeed

setMetaNodeAttribute

public final void setMetaNodeAttribute(String name,
                                       Object attr)
Defines an attribute for the meta-nodes. For each meta node, at least the 'type' attribute (namespace: LibLayout) should be defined.
Specified by:
setMetaNodeAttribute in interface InputFeed
Parameters:
name -
attr -

startDocument

public final void startDocument()
Starts the document processing. This is the first method to call. After calling this method, the meta-data should be fed into the inputfeed.
Specified by:
startDocument in interface InputFeed

startElement

public final void startElement(String namespace,
                               String name)
            throws InputFeedException
Specified by:
startElement in interface InputFeed

startMetaInfo

public final void startMetaInfo()
Signals, that meta-data follows. Calling this method is only valid directly after startDocument has been called.
Specified by:
startMetaInfo in interface InputFeed

startMetaNode

public void startMetaNode()
Starts a new meta-node structure. Meta-Nodes are used to hold content that can appear more than once (like stylesheet declarations).

For now, only stylesheet declarations are defined as meta-node content; more content types will surely arise in the future.

Calling this method is only valid after 'startMetaInfo' has been called.

Specified by:
startMetaNode in interface InputFeed