Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.jfor.jfor.converter
Class ParagraphBuilder  view ParagraphBuilder download ParagraphBuilder.java

java.lang.Object
  extended byorg.jfor.jfor.converter.AbstractBuilder
      extended byorg.jfor.jfor.converter.ParagraphBuilder
All Implemented Interfaces:
IBuilder

class ParagraphBuilder
extends AbstractBuilder

Builds RtfParagraphs for fo:block elements.


Field Summary
static java.lang.String ATTRIBUTE_FO_KEEP_TOGETHER
           
private  org.xml.sax.Attributes m_attrib
           
private  ParagraphBuilder m_nestedInto
          if this fo:block is nested into another one, this is the builder that processes the enclosing block
private  org.jfor.jfor.rtflib.rtfdoc.RtfParagraph m_para
           
private  org.jfor.jfor.rtflib.rtfdoc.ParagraphKeeptogetherContext m_paragraphKeeptogetherContext
           
private  boolean m_paraKeepOpenOwner
          Determine if this block is the owner of the keep-together attribute
private  TextBuilder m_textBuilder
           
static java.lang.String TAG_FO_BLOCK
           
 
Fields inherited from class org.jfor.jfor.converter.AbstractBuilder
m_context
 
Constructor Summary
(package private) ParagraphBuilder(BuilderContext ctx)
           
 
Method Summary
 void characters(java.lang.String str)
          called by the parser for Text nodes
 void end()
          called by Converter at the end of an element
 IBuilder getBuilder(BuilderContext ctx, java.lang.String rawName, org.xml.sax.Attributes atts)
          this builder processes fo:block elements
private  void nestedParagraphEnds()
          called by end() when an fo:block that is directly nested into the one we are processing ends
 void start(java.lang.String rawName, org.xml.sax.Attributes attrs)
          called by Converter at the start of an element
private  org.jfor.jfor.rtflib.rtfdoc.RtfParagraph startParagraph(boolean isAfterNestedBlock)
          Add an RtfParagraph to the current paragraph container.
private  org.jfor.jfor.rtflib.rtfdoc.RtfParagraphKeepTogether startParagraphKeepTogether()
          Create a new RtfParagraphKeepTogether
 
Methods inherited from class org.jfor.jfor.converter.AbstractBuilder
attributeIsSet, attributeIsSet, getAttribute, getAttribute, getValue, getValue, hasAttributeValue, hasAttributeValue, ignoreChildren, postEnd, preStart, useForChildren
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TAG_FO_BLOCK

public static final java.lang.String TAG_FO_BLOCK
See Also:
Constant Field Values

ATTRIBUTE_FO_KEEP_TOGETHER

public static final java.lang.String ATTRIBUTE_FO_KEEP_TOGETHER
See Also:
Constant Field Values

m_textBuilder

private TextBuilder m_textBuilder

m_attrib

private org.xml.sax.Attributes m_attrib

m_para

private org.jfor.jfor.rtflib.rtfdoc.RtfParagraph m_para

m_paragraphKeeptogetherContext

private org.jfor.jfor.rtflib.rtfdoc.ParagraphKeeptogetherContext m_paragraphKeeptogetherContext

m_paraKeepOpenOwner

private boolean m_paraKeepOpenOwner
Determine if this block is the owner of the keep-together attribute


m_nestedInto

private final ParagraphBuilder m_nestedInto
if this fo:block is nested into another one, this is the builder that processes the enclosing block

Constructor Detail

ParagraphBuilder

ParagraphBuilder(BuilderContext ctx)
Method Detail

start

public void start(java.lang.String rawName,
                  org.xml.sax.Attributes attrs)
           throws java.io.IOException
called by Converter at the start of an element


end

public void end()
         throws java.io.IOException
called by Converter at the end of an element


characters

public void characters(java.lang.String str)
                throws java.io.IOException
called by the parser for Text nodes

Specified by:
characters in interface IBuilder
Overrides:
characters in class AbstractBuilder

getBuilder

public IBuilder getBuilder(BuilderContext ctx,
                           java.lang.String rawName,
                           org.xml.sax.Attributes atts)
this builder processes fo:block elements


nestedParagraphEnds

private void nestedParagraphEnds()
                          throws java.io.IOException
called by end() when an fo:block that is directly nested into the one we are processing ends


startParagraphKeepTogether

private org.jfor.jfor.rtflib.rtfdoc.RtfParagraphKeepTogether startParagraphKeepTogether()
                                                                                 throws java.io.IOException
Create a new RtfParagraphKeepTogether


startParagraph

private org.jfor.jfor.rtflib.rtfdoc.RtfParagraph startParagraph(boolean isAfterNestedBlock)
                                                         throws java.io.IOException
Add an RtfParagraph to the current paragraph container. Can be called several times for the same ParagraphBuilder, for example when fo:blocks are nested (see XSL-FO example file 001-fop-compare-blocks.fo.xml);
      Example of nested blocks:
      fo:block A, attributes A
      text A1
          fo:block B nested into A, attributes B
          text B1
      text A2

      The resulting RTF is:
      RtfParagraph(attributes A):"text A1"
      RtfParagraph(attributes B):"text B1"
      RtfParagraph(attributes A):"text A2"
      Which is similar to what FOP does in such a case