public class JRStyledTextParser extends Object implements ErrorHandler
Modifier and Type | Class and Description |
---|---|
protected class |
JRStyledTextParser.XmlStyledTextListWriter |
Modifier and Type | Method and Description |
---|---|
void |
error(SAXParseException e) |
void |
fatalError(SAXParseException e) |
static JRStyledTextParser |
getInstance()
Return a cached instance.
|
static Locale |
getLocale() |
JRStyledText |
getStyledText(Map<AttributedCharacterIterator.Attribute,Object> parentAttributes,
String text,
boolean isStyledText,
Locale locale)
Creates a styled text object by either parsing a styled text String or
by wrapping an unstyled String.
|
JRStyledText |
parse(Map<AttributedCharacterIterator.Attribute,Object> attributes,
String text,
Locale locale) |
static void |
setLocale(Locale locale) |
void |
warning(SAXParseException e) |
String |
write(JRStyledText styledText)
Outputs a styled text String given a styled text instance.
|
String |
write(JRStyledText styledText,
int startIndex,
int endIndex)
Outputs the String representation of a styled text chunk.
|
String |
write(Map<AttributedCharacterIterator.Attribute,Object> parentAttrs,
AttributedCharacterIterator iterator,
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(StyledTextWriteContext context,
StringBuilder sb,
Map<AttributedCharacterIterator.Attribute,Object> parentAttrs,
Map<AttributedCharacterIterator.Attribute,Object> attrs,
String chunk) |
public static JRStyledTextParser getInstance()
public static void setLocale(Locale locale)
public static Locale getLocale()
public JRStyledText parse(Map<AttributedCharacterIterator.Attribute,Object> attributes, String text, Locale locale) throws SAXException
SAXException
public JRStyledText getStyledText(Map<AttributedCharacterIterator.Attribute,Object> parentAttributes, String text, boolean isStyledText, 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 String write(JRStyledText styledText)
styledText
- the styled text objectpublic String write(Map<AttributedCharacterIterator.Attribute,Object> parentAttrs, AttributedCharacterIterator iterator, String text)
parentAttrs
- the element-level styled text attributesiterator
- iterator of styled text attributestext
- the textpublic String write(JRStyledText styledText, int startIndex, int endIndex)
styledText
- the styled textstartIndex
- the start indexendIndex
- the end indexwrite(Map, AttributedCharacterIterator, String)
public void writeChunk(StyledTextWriteContext context, StringBuilder sb, Map<AttributedCharacterIterator.Attribute,Object> parentAttrs, Map<AttributedCharacterIterator.Attribute,Object> attrs, String chunk)
public void error(SAXParseException e)
error
in interface ErrorHandler
public void fatalError(SAXParseException e)
fatalError
in interface ErrorHandler
public void warning(SAXParseException e)
warning
in interface ErrorHandler
Copyright © 2023 Cloud Software Group, Inc.. All rights reserved.