org.jfor.jfor.converter
Class AbstractBuilder

java.lang.Object
  extended by org.jfor.jfor.converter.AbstractBuilder
All Implemented Interfaces:
IBuilder
Direct Known Subclasses:
AfterBuilder, BasicLinkBuilder, BeforeBuilder, ExternalGraphicBuilder, ListBuilder, ListItemBuilder, ListItemLabelBuilder, NullBuilder, PageBuilder, PageNumberBuilder, PageNumberCitationBuilder, ParagraphBuilder, SectionBuilder, StyleSheetBuilder, TableBuilder, TableCellBuilder, TableColumnBuilder, TableHeaderBuilder, TableRowBuilder, TemplateBuilder, TextBuilder

public abstract class AbstractBuilder
extends java.lang.Object
implements IBuilder

Base class for Builders

Author:
Bertrand Delacretaz bdelacretaz@codeconsult.ch

Field Summary
protected  BuilderContext m_context
           
 
Constructor Summary
AbstractBuilder(BuilderContext ctx)
           
 
Method Summary
(package private) static boolean attributeIsSet(org.xml.sax.Attributes attrs, java.lang.String name)
          true if the given attribute has a value (attribute is present) in the given Attributes
(package private) static boolean attributeIsSet(org.xml.sax.Attributes attrs, java.lang.String name, org.xml.sax.Attributes defattrs)
          true if the given attribute has a value (attribute is present) in the given Attributes or the default attributes
 void characters(java.lang.String str)
          called by the parser for Text nodes
(package private) static java.lang.String getAttribute(org.xml.sax.Attributes attrs, java.lang.String tagName, java.lang.String attrName, boolean required)
          return the value of given attribute
(package private) static java.lang.String getAttribute(org.xml.sax.Attributes attrs, java.lang.String tagName, java.lang.String attrName, boolean required, org.xml.sax.Attributes defattrs)
          return the value of given attribute from the Attributes or the default Attributes
(package private) static java.lang.String getValue(org.xml.sax.Attributes attrs, java.lang.String name)
          return the value of the attribute with the specified name from the given Attributes
(package private) static java.lang.String getValue(org.xml.sax.Attributes attrs, java.lang.String name, org.xml.sax.Attributes defattrs)
          return the value of the attribute with the specified name from the given Attributes or the default attributes
(package private) static boolean hasAttributeValue(org.xml.sax.Attributes attrs, java.lang.String name, java.lang.String desiredValue)
          true if the given attribute value is contained in the given Attributes
(package private) static boolean hasAttributeValue(org.xml.sax.Attributes attrs, java.lang.String name, java.lang.String desiredValue, org.xml.sax.Attributes defattrs)
          true if the given attribute value is contained in the given Attributes or the default attributes
 boolean ignoreChildren()
          if true, xsl:fo elements that are children of an element using this builder must be ignored
 void postEnd()
          called by Converter after calling end()
 void preStart(java.lang.String rawName, org.xml.sax.Attributes atts)
          called by Converter before calling start()
 boolean useForChildren(java.lang.String rawName, org.xml.sax.Attributes attrs)
          if true, builder is used for its child elements as well
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jfor.jfor.converter.IBuilder
end, getBuilder, start
 

Field Detail

m_context

protected final BuilderContext m_context
Constructor Detail

AbstractBuilder

AbstractBuilder(BuilderContext ctx)
Method Detail

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
Throws:
java.io.IOException

hasAttributeValue

static boolean hasAttributeValue(org.xml.sax.Attributes attrs,
                                 java.lang.String name,
                                 java.lang.String desiredValue,
                                 org.xml.sax.Attributes defattrs)
true if the given attribute value is contained in the given Attributes or the default attributes


hasAttributeValue

static boolean hasAttributeValue(org.xml.sax.Attributes attrs,
                                 java.lang.String name,
                                 java.lang.String desiredValue)
true if the given attribute value is contained in the given Attributes


attributeIsSet

static boolean attributeIsSet(org.xml.sax.Attributes attrs,
                              java.lang.String name)
true if the given attribute has a value (attribute is present) in the given Attributes


attributeIsSet

static boolean attributeIsSet(org.xml.sax.Attributes attrs,
                              java.lang.String name,
                              org.xml.sax.Attributes defattrs)
true if the given attribute has a value (attribute is present) in the given Attributes or the default attributes


getValue

static java.lang.String getValue(org.xml.sax.Attributes attrs,
                                 java.lang.String name)
return the value of the attribute with the specified name from the given Attributes


getValue

static java.lang.String getValue(org.xml.sax.Attributes attrs,
                                 java.lang.String name,
                                 org.xml.sax.Attributes defattrs)
return the value of the attribute with the specified name from the given Attributes or the default attributes


getAttribute

static java.lang.String getAttribute(org.xml.sax.Attributes attrs,
                                     java.lang.String tagName,
                                     java.lang.String attrName,
                                     boolean required,
                                     org.xml.sax.Attributes defattrs)
                              throws ConverterException
return the value of given attribute from the Attributes or the default Attributes

Parameters:
required - if true and no value, throws ConverterException
Throws:
ConverterException

getAttribute

static java.lang.String getAttribute(org.xml.sax.Attributes attrs,
                                     java.lang.String tagName,
                                     java.lang.String attrName,
                                     boolean required)
                              throws ConverterException
return the value of given attribute

Parameters:
required - if true and no value, throws ConverterException
Throws:
ConverterException

ignoreChildren

public boolean ignoreChildren()
if true, xsl:fo elements that are children of an element using this builder must be ignored

Specified by:
ignoreChildren in interface IBuilder

useForChildren

public boolean useForChildren(java.lang.String rawName,
                              org.xml.sax.Attributes attrs)
if true, builder is used for its child elements as well

Specified by:
useForChildren in interface IBuilder

preStart

public void preStart(java.lang.String rawName,
                     org.xml.sax.Attributes atts)
              throws java.io.IOException
called by Converter before calling start()

Specified by:
preStart in interface IBuilder
Throws:
java.io.IOException

postEnd

public void postEnd()
             throws java.io.IOException
called by Converter after calling end()

Specified by:
postEnd in interface IBuilder
Throws:
java.io.IOException