## com.lowagie.text.rtf
Class RtfAddableElement

    java.lang.Object
      com.lowagie.text.Chunk
          com.lowagie.text.rtf.RtfAddableElement

All Implemented Interfaces:
  Element, MarkupAttributes, RtfBasicElement

Direct Known Subclasses:
  RtfDirectContent, RtfShape, RtfShapePosition, RtfShapeProperty, RtfTab, RtfTabGroup

    public abstract class RtfAddableElement

extends Chunk
implements RtfBasicElement

The RtfAddableElement is the superclass for all rtf specific elements that need to be added to an iText document. It is an extension of Chunk and it also implements RtfBasicElement. It is an abstract class thus it cannot be instantiated itself and has to be subclassed to be used.

Version:
  $Revision: 1.1 $
Author:
  Mark Hall (mhall@edu.uni-klu.ac.at)

Field Summary
`protected RtfDocument` `doc` The RtfDocument this RtfAddableElement belongs to.
`protected boolean` `inHeader` Whether this RtfAddableElement is contained in a header.
`protected boolean` `inTable` Whether this RtfAddableElement is contained in a table.

Fields inherited from class com.lowagie.text.Chunk
`ACTION, attributes, BACKGROUND, COLOR, content, ENCODING, font, GENERICTAG, HSCALE, HYPHENATION, IMAGE, LOCALDESTINATION, LOCALGOTO, markupAttributes, NEWLINE, NEWPAGE, NEXTPAGE, OBJECT_REPLACEMENT_CHARACTER, PDFANNOTATION, REMOTEGOTO, SKEW, SPLITCHARACTER, SUBSUPSCRIPT, TEXTRENDERMODE, UNDERLINE`

Fields inherited from interface com.lowagie.text.rtf.RtfBasicElement
`CLOSE_GROUP, COMMA_DELIMITER, DELIMITER, OPEN_GROUP, TWIPS_FACTOR`

Constructor Summary
`RtfAddableElement()` Constructs a new RtfAddableElement.

Method Summary
`byte[]` `intToByteArray(int i)` Transforms an integer into its String representation and then returns the bytes of that string.
`void` `setInHeader(boolean inHeader)` Sets whether this RtfAddableElement is contained in a header/footer.
`void` `setInTable(boolean inTable)` Sets whether this RtfAddableElement is contained in a table.
`void` `setRtfDocument(RtfDocument doc)` Sets the RtfDocument this RtfAddableElement belongs to
`abstract byte[]` `write()` Subclasses have to implement this method.

Methods inherited from class com.lowagie.text.Chunk

`addToArray, append, content, font, getAttributes, getChunks, getHorizontalScaling, getImage, getKeySet, getMarkupAttribute, getMarkupAttributeNames, getMarkupAttributes, getTextRise, getWidthPoint, hasAttributes, isEmpty, isTag, process, setAction, setAnchor, setAnchor, setAnnotation, setBackground, setBackground, setFont, setGenericTag, setHorizontalScaling, setHyphenation, setLocalDestination, setLocalGoto, setMarkupAttribute, setMarkupAttributes, setNewPage, setRemoteGoto, setRemoteGoto, setSkew, setSplitCharacter, setTextRenderMode, setTextRise, setUnderline, setUnderline, toString, type`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### doc

    protected RtfDocument doc

  The RtfDocument this RtfAddableElement belongs to.

### inTable

    protected boolean inTable

  Whether this RtfAddableElement is contained in a table.

### inHeader

    protected boolean inHeader

  Whether this RtfAddableElement is contained in a header.

Constructor Detail

### RtfAddableElement

    public RtfAddableElement()

  Constructs a new RtfAddableElement. The Chunk content is set to an empty string and the font to the default Font().

Method Detail

### write

    public abstract byte[] write()

  Subclasses have to implement this method.

  Specified by:
    `write` in interface `RtfBasicElement`
  Returns:
    The byte array containing the data

### setRtfDocument

    public void setRtfDocument(RtfDocument doc)

  Sets the RtfDocument this RtfAddableElement belongs to

  Specified by:
    `setRtfDocument` in interface `RtfBasicElement`
  Parameters:
    `doc` - The RtfDocument to use

### setInTable

    public void setInTable(boolean inTable)

  Sets whether this RtfAddableElement is contained in a table.

  Specified by:
    `setInTable` in interface `RtfBasicElement`
  Parameters:
    `inTable` - Whether this RtfBasicElement is in a table

### setInHeader

    public void setInHeader(boolean inHeader)

  Sets whether this RtfAddableElement is contained in a header/footer.

  Specified by:
    `setInHeader` in interface `RtfBasicElement`
  Parameters:
    `inHeader` - Whether this RtfBasicElement is in a header

### intToByteArray

    public byte[] intToByteArray(int i)

  Transforms an integer into its String representation and then returns the bytes of that string.

  Parameters:
    `i` - The integer to convert
  Returns:
    A byte array representing the integer