public class JRStyledTextParser
extends java.lang.Object
implements org.xml.sax.ErrorHandler
Modifier and Type | Method and Description |
---|---|
void |
error(org.xml.sax.SAXParseException e) |
void |
fatalError(org.xml.sax.SAXParseException e) |
static JRStyledTextParser |
getInstance()
Return a cached instance.
|
static java.util.Locale |
getLocale() |
JRStyledText |
getStyledText(java.util.Map<java.text.AttributedCharacterIterator.Attribute,java.lang.Object> parentAttributes,
java.lang.String text,
boolean isStyledText,
java.util.Locale locale)
Creates a styled text object by either parsing a styled text String or
by wrapping an unstyled String.
|
JRStyledText |
parse(java.util.Map<java.text.AttributedCharacterIterator.Attribute,java.lang.Object> attributes,
java.lang.String text,
java.util.Locale locale) |
static void |
setLocale(java.util.Locale locale) |
void |
warning(org.xml.sax.SAXParseException e) |
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<java.text.AttributedCharacterIterator.Attribute,java.lang.Object> 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<java.text.AttributedCharacterIterator.Attribute,java.lang.Object> parentAttrs,
java.util.Map<java.text.AttributedCharacterIterator.Attribute,java.lang.Object> attrs,
java.lang.String chunk) |
public static JRStyledTextParser getInstance()
public static void setLocale(java.util.Locale locale)
public static java.util.Locale getLocale()
public JRStyledText parse(java.util.Map<java.text.AttributedCharacterIterator.Attribute,java.lang.Object> attributes, java.lang.String text, java.util.Locale locale) throws org.xml.sax.SAXException
org.xml.sax.SAXException
public JRStyledText getStyledText(java.util.Map<java.text.AttributedCharacterIterator.Attribute,java.lang.Object> parentAttributes, java.lang.String text, boolean isStyledText, java.util.Locale locale)
parentAttributes
- the element-level styled text attributestext
- the (either styled or unstyled) textisStyledText
- flag indicating that the text is styledlocale
- the locale for the textpublic java.lang.String write(JRStyledText styledText)
styledText
- the styled text objectpublic java.lang.String write(java.util.Map<java.text.AttributedCharacterIterator.Attribute,java.lang.Object> parentAttrs, java.text.AttributedCharacterIterator iterator, java.lang.String text)
parentAttrs
- the element-level styled text attributesiterator
- iterator of styled text attributestext
- the textpublic java.lang.String write(JRStyledText styledText, int startIndex, int endIndex)
styledText
- the styled textstartIndex
- the start indexendIndex
- the end indexwrite(Map, AttributedCharacterIterator, String)
public void writeChunk(java.lang.StringBuffer sbuffer, java.util.Map<java.text.AttributedCharacterIterator.Attribute,java.lang.Object> parentAttrs, java.util.Map<java.text.AttributedCharacterIterator.Attribute,java.lang.Object> attrs, java.lang.String chunk)
public void error(org.xml.sax.SAXParseException e)
error
in interface org.xml.sax.ErrorHandler
public void fatalError(org.xml.sax.SAXParseException e)
fatalError
in interface org.xml.sax.ErrorHandler
public void warning(org.xml.sax.SAXParseException e)
warning
in interface org.xml.sax.ErrorHandler
© 2001-2010 Jaspersoft Corporation www.jaspersoft.com