net.sf.jasperreports.engine.util
Class JRStyledTextParser

java.lang.Object
  extended by net.sf.jasperreports.engine.util.JRStyledTextParser

public class JRStyledTextParser
extends java.lang.Object

Version:
$Id: JRStyledTextParser.java 2042 2007-12-12 21:55:16Z teodord $
Author:
Teodor Danciu (teodord@users.sourceforge.net)

Constructor Summary
JRStyledTextParser()
           
 
Method Summary
static JRStyledTextParser getInstance()
          Return a cached instance.
 JRStyledText getStyledText(java.util.Map parentAttributes, java.lang.String text, boolean isStyledText)
          Creates a styled text object by either parsing a styled text String or by wrapping an unstyled String.
 JRStyledText parse(java.util.Map attributes, java.lang.String text)
           
 java.lang.String write(JRStyledText styledText)
          Outputs a styled text String given a styled text instance.
 java.lang.String write(JRStyledText styledText, int startIndex, int endIndex)
          Outputs the String representation of a styled text chunk.
 java.lang.String write(java.util.Map parentAttrs, java.text.AttributedCharacterIterator iterator, java.lang.String text)
          Outputs a styled text String given a set of element-level styled text attributes and a styled text in the form of a String text and an iterator of style attributes.
 void writeChunk(java.lang.StringBuffer sbuffer, java.util.Map parentAttrs, java.util.Map attrs, java.lang.String chunk)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JRStyledTextParser

public JRStyledTextParser()
Method Detail

getInstance

public static JRStyledTextParser getInstance()
Return a cached instance.

Returns:
a cached instance

parse

public JRStyledText parse(java.util.Map attributes,
                          java.lang.String text)
                   throws org.xml.sax.SAXException
Throws:
org.xml.sax.SAXException

getStyledText

public JRStyledText getStyledText(java.util.Map parentAttributes,
                                  java.lang.String text,
                                  boolean isStyledText)
Creates a styled text object by either parsing a styled text String or by wrapping an unstyled String.

Parameters:
parentAttributes - the element-level styled text attributes
text - the (either styled or unstyled) text
isStyledText - flag indicating that the text is styled
Returns:
a styled text object

write

public java.lang.String write(JRStyledText styledText)
Outputs a styled text String given a styled text instance.

Parameters:
styledText - the styled text object
Returns:
the String styled text representation

write

public java.lang.String write(java.util.Map parentAttrs,
                              java.text.AttributedCharacterIterator iterator,
                              java.lang.String text)
Outputs a styled text String given a set of element-level styled text attributes and a styled text in the form of a String text and an iterator of style attributes.

Parameters:
parentAttrs - the element-level styled text attributes
iterator - iterator of styled text attributes
text - the text
Returns:
the String styled text representation

write

public java.lang.String write(JRStyledText styledText,
                              int startIndex,
                              int endIndex)
Outputs the String representation of a styled text chunk.

Parameters:
styledText - the styled text
startIndex - the start index
endIndex - the end index
Returns:
the String styled text representation of the chunk delimited by the start index and the end index
See Also:
write(Map, AttributedCharacterIterator, String)

writeChunk

public void writeChunk(java.lang.StringBuffer sbuffer,
                       java.util.Map parentAttrs,
                       java.util.Map attrs,
                       java.lang.String chunk)


© 2001-2006 JasperSoft Corporation www.jaspersoft.com