com.ivata.mask.web.format
Class LineBreakFormat

java.lang.Object
  extended bycom.ivata.mask.web.format.LineBreakFormat
All Implemented Interfaces:
HTMLFormat

public class LineBreakFormat
extends java.lang.Object
implements HTMLFormat

Convert line breaks into HTML break tags.

Since:
ivata masks 0.4 (2002-06-19)
Version:
$Revision: 1.3 $
Author:
Colin MacLeod colin.macleod@ivata.com

Constructor Summary
LineBreakFormat()
           
 
Method Summary
 java.lang.String format(java.lang.String hTMLTextParam)
           Convert all line breaks in the text provided to <br/> tags, and prepend a string to new each line.
 boolean getConvertLineBreaks()
           Get whether or not we should convert line breaks.
 java.lang.String getPrepend()
           Get the string which is prepended to each new line.
 void setConvertLineBreaks(boolean convertLineBreaksParam)
           Set whether or not we should convert line breaks.
 void setPrepend(java.lang.String prependParam)
           Set the string which is prepended to each new line.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LineBreakFormat

public LineBreakFormat()
Method Detail

format

public final java.lang.String format(java.lang.String hTMLTextParam)

Convert all line breaks in the text provided to <br/> tags, and prepend a string to new each line. One example where this is required is in'quoted' return emails, where each line is traditionally preceded by the 'greater than' symbol >

Specified by:
format in interface HTMLFormat
Parameters:
hTMLTextParam - HTML text to convert line breaks in.
Returns:
formatted text, with all of the line breaks converted to HTML tags

getPrepend

public final java.lang.String getPrepend()

Get the string which is prepended to each new line.

Returns:
the current value of the string to prepend to each line.

setPrepend

public final void setPrepend(java.lang.String prependParam)

Set the string which is prepended to each new line.

Parameters:
prependParam - the new value of the string to prepend to each line.

getConvertLineBreaks

public final boolean getConvertLineBreaks()

Get whether or not we should convert line breaks. If set to true, then all line break characters in the htmText (see format) are converted into HTML line-breaks (<br/>).

Returns:
true if line breaks are converted, otherwise false.

setConvertLineBreaks

public final void setConvertLineBreaks(boolean convertLineBreaksParam)

Set whether or not we should convert line breaks. If set to true, then all line break characters in the hTMLText (see format) are converted into HTML line-breaks (<br/>).

Parameters:
convertLineBreaksParam - set to true if line breaks should be converted, otherwise false.


Copyright © 2001-2005 ivata limited. All Rights Reserved.