com.itextpdf.text.html.simpleparser
Class ElementFactory

java.lang.Object
  extended by com.itextpdf.text.html.simpleparser.ElementFactory

public class ElementFactory
extends Object

Factory that produces iText Element objects, based on tags and their properties.

Since:
5.0.6 (renamed)
Author:
blowagie, psoares

Constructor Summary
ElementFactory()
          Creates a new instance of FactoryProperties.
 
Method Summary
 Chunk createChunk(String content, ChainedProperties chain)
          Creates an iText Chunk
 Image createImage(String src, Map<String,String> attrs, ChainedProperties chain, DocListener document, ImageProvider img_provider, HashMap<String,Image> img_store, String img_baseurl)
           
 LineSeparator createLineSeparator(Map<String,String> attrs, float offset)
          Creates a LineSeparator.
 List createList(String tag, ChainedProperties chain)
           
 ListItem createListItem(ChainedProperties chain)
          Creates an iText Paragraph object using the properties of the different tags and properties in the hierarchy chain.
 Paragraph createParagraph(ChainedProperties chain)
          Creates an iText Paragraph object using the properties of the different tags and properties in the hierarchy chain.
 Font getFont(ChainedProperties chain)
          Creates a Font object based on a chain of properties.
 FontProvider getFontProvider()
          Getter for the font provider
 HyphenationEvent getHyphenation(ChainedProperties chain)
          Gets a HyphenationEvent based on the hyphenation entry in the hierarchy chain.
 void setFontProvider(FontProvider provider)
          Setter for the font provider
protected static void setParagraphLeading(Paragraph paragraph, String leading)
          Sets the leading of a Paragraph object.
protected  void updateElement(Paragraph paragraph, ChainedProperties chain)
          Method that does the actual Element creating for the createParagraph and createListItem method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ElementFactory

public ElementFactory()
Creates a new instance of FactoryProperties.

Method Detail

setFontProvider

public void setFontProvider(FontProvider provider)
Setter for the font provider

Parameters:
provider -
Since:
5.0.6 renamed from setFontImp

getFontProvider

public FontProvider getFontProvider()
Getter for the font provider

Returns:
provider
Since:
5.0.6 renamed from getFontImp

getFont

public Font getFont(ChainedProperties chain)
Creates a Font object based on a chain of properties.

Parameters:
chain - chain of properties
Returns:
an iText Font object

createChunk

public Chunk createChunk(String content,
                         ChainedProperties chain)
Creates an iText Chunk

Parameters:
content - the content of the Chunk
chain - the hierarchy chain
Returns:
a Chunk

createParagraph

public Paragraph createParagraph(ChainedProperties chain)
Creates an iText Paragraph object using the properties of the different tags and properties in the hierarchy chain.

Parameters:
chain - the hierarchy chain
Returns:
a Paragraph without any content

createListItem

public ListItem createListItem(ChainedProperties chain)
Creates an iText Paragraph object using the properties of the different tags and properties in the hierarchy chain.

Parameters:
chain - the hierarchy chain
Returns:
a ListItem without any content

updateElement

protected void updateElement(Paragraph paragraph,
                             ChainedProperties chain)
Method that does the actual Element creating for the createParagraph and createListItem method.

Parameters:
paragraph -
chain -

setParagraphLeading

protected static void setParagraphLeading(Paragraph paragraph,
                                          String leading)
Sets the leading of a Paragraph object.

Parameters:
paragraph - the Paragraph for which we set the leading
leading - the String value of the leading

getHyphenation

public HyphenationEvent getHyphenation(ChainedProperties chain)
Gets a HyphenationEvent based on the hyphenation entry in the hierarchy chain.

Parameters:
chain - the hierarchy chain
Returns:
a HyphenationEvent
Since:
2.1.2

createLineSeparator

public LineSeparator createLineSeparator(Map<String,String> attrs,
                                         float offset)
Creates a LineSeparator.

Parameters:
attrs - the attributes
offset -
Returns:
a LineSeparator
Since:
5.0.6

createImage

public Image createImage(String src,
                         Map<String,String> attrs,
                         ChainedProperties chain,
                         DocListener document,
                         ImageProvider img_provider,
                         HashMap<String,Image> img_store,
                         String img_baseurl)
                  throws DocumentException,
                         IOException
Parameters:
src -
attrs -
chain -
document -
img_provider -
img_store -
img_baseurl -
Returns:
the Image
Throws:
DocumentException
IOException

createList

public List createList(String tag,
                       ChainedProperties chain)
Parameters:
tag -
chain -
Returns:
the List


Copyright © 2013. All Rights Reserved.