Package net.sf.jasperreports.engine.util
Class JRXmlWriteHelper
- java.lang.Object
-
- net.sf.jasperreports.engine.util.JRXmlWriteHelper
-
public class JRXmlWriteHelper extends Object
- Author:
- Lucian Chirita (lucianc@users.sourceforge.net)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
JRXmlWriteHelper.Attribute
protected static class
JRXmlWriteHelper.StackElement
-
Field Summary
Fields Modifier and Type Field Description protected static String
ESCAPED_CDATA_CLOSE
protected static Pattern
PATTERN_CDATA_CLOSE
static String
XML_NAMESPACE_ATTRIBUTE
static String
XML_SCHEMA_LOCATION_ATTRIBUTE
static String
XML_SCHEMA_NAMESPACE
static String
XML_SCHEMA_NAMESPACE_PREFIX
-
Constructor Summary
Constructors Constructor Description JRXmlWriteHelper(Writer writer)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAttribute(String name, boolean value)
void
addAttribute(String name, double value)
void
addAttribute(String name, double value, double defaultValue)
void
addAttribute(String name, float value)
void
addAttribute(String name, float value, float defaultValue)
void
addAttribute(String name, int value)
void
addAttribute(String name, int value, int defaultValue)
void
addAttribute(String name, Color color)
void
addAttribute(String name, Color value, Color defaultValue)
void
addAttribute(String name, Boolean value, boolean defaultValue)
void
addAttribute(String name, Float value, boolean withMinDecimals)
void
addAttribute(String name, Number value, Number defaultValue)
void
addAttribute(String name, Object value)
void
addAttribute(String name, String value)
void
addAttribute(String name, String value, String defaultValue)
void
addAttribute(String name, NamedEnum value)
void
addAttribute(String name, NamedEnum value, NamedEnum defaultValue)
void
addAttributePositive(String name, int value)
void
addEncodedAttribute(String name, String value)
void
addEncodedAttribute(String name, String value, String defaultValue)
protected void
clearBuffer()
void
closeElement()
void
closeElement(boolean skipIfEmpty)
protected static String
encodeCDATA(String data)
protected XmlNamespace
findContextNamespace(String namespaceURI)
protected void
flushBuffer()
protected char[]
getIndent(int level)
protected XmlNamespace
getParentNamespace()
protected static String
getQualifiedName(String name, String nsPrefix)
protected static String
getQualifiedName(String name, XmlNamespace ns)
Writer
getUnderlyingWriter()
void
startElement(String name)
void
startElement(String name, XmlNamespace namespace)
protected void
writeAttribute(String name, String value)
void
writeCDATA(String data)
void
writeCDATAElement(String name, String data)
void
writeCDATAElement(String name, String data, String attName, Object attValue)
void
writeCDATAElement(String name, String data, String attName, String attValue)
void
writeCDATAElement(String name, XmlNamespace namespace, String data)
void
writeCDATAElement(String name, XmlNamespace namespace, String data, String[] attNames, Object[] attValues)
void
writeCDATAElement(String name, XmlNamespace namespace, String data, String attName, Object attValue)
protected void
writeElementAttributes(JRXmlWriteHelper.StackElement element, int level)
void
writeExpression(String name, JRExpression expression)
void
writeExpression(String name, XmlNamespace namespace, JRExpression expression)
protected void
writeParents(boolean content)
void
writeProlog(String encoding)
void
writePublicDoctype(String rootElement, String description, String dtdLocation)
-
-
-
Field Detail
-
XML_SCHEMA_NAMESPACE
public static final String XML_SCHEMA_NAMESPACE
- See Also:
- Constant Field Values
-
XML_SCHEMA_NAMESPACE_PREFIX
public static final String XML_SCHEMA_NAMESPACE_PREFIX
- See Also:
- Constant Field Values
-
XML_NAMESPACE_ATTRIBUTE
public static final String XML_NAMESPACE_ATTRIBUTE
- See Also:
- Constant Field Values
-
XML_SCHEMA_LOCATION_ATTRIBUTE
public static final String XML_SCHEMA_LOCATION_ATTRIBUTE
- See Also:
- Constant Field Values
-
PATTERN_CDATA_CLOSE
protected static final Pattern PATTERN_CDATA_CLOSE
-
ESCAPED_CDATA_CLOSE
protected static final String ESCAPED_CDATA_CLOSE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
JRXmlWriteHelper
public JRXmlWriteHelper(Writer writer)
-
-
Method Detail
-
writeProlog
public void writeProlog(String encoding) throws IOException
- Throws:
IOException
-
writePublicDoctype
public void writePublicDoctype(String rootElement, String description, String dtdLocation) throws IOException
- Throws:
IOException
-
startElement
public void startElement(String name)
-
startElement
public void startElement(String name, XmlNamespace namespace)
-
getParentNamespace
protected XmlNamespace getParentNamespace()
-
findContextNamespace
protected XmlNamespace findContextNamespace(String namespaceURI)
-
getQualifiedName
protected static String getQualifiedName(String name, XmlNamespace ns)
-
writeParents
protected void writeParents(boolean content) throws IOException
- Throws:
IOException
-
writeCDATA
public void writeCDATA(String data) throws IOException
- Throws:
IOException
-
writeCDATAElement
public void writeCDATAElement(String name, String data) throws IOException
- Throws:
IOException
-
writeCDATAElement
public void writeCDATAElement(String name, XmlNamespace namespace, String data) throws IOException
- Throws:
IOException
-
writeCDATAElement
public void writeCDATAElement(String name, String data, String attName, String attValue) throws IOException
- Throws:
IOException
-
writeCDATAElement
public void writeCDATAElement(String name, String data, String attName, Object attValue) throws IOException
- Throws:
IOException
-
writeCDATAElement
public void writeCDATAElement(String name, XmlNamespace namespace, String data, String attName, Object attValue) throws IOException
- Throws:
IOException
-
writeCDATAElement
public void writeCDATAElement(String name, XmlNamespace namespace, String data, String[] attNames, Object[] attValues) throws IOException
- Throws:
IOException
-
writeElementAttributes
protected void writeElementAttributes(JRXmlWriteHelper.StackElement element, int level) throws IOException
- Throws:
IOException
-
closeElement
public void closeElement() throws IOException
- Throws:
IOException
-
closeElement
public void closeElement(boolean skipIfEmpty) throws IOException
- Throws:
IOException
-
getIndent
protected char[] getIndent(int level)
-
flushBuffer
protected void flushBuffer() throws IOException
- Throws:
IOException
-
clearBuffer
protected void clearBuffer()
-
writeExpression
public void writeExpression(String name, XmlNamespace namespace, JRExpression expression) throws IOException
- Throws:
IOException
-
writeExpression
public void writeExpression(String name, JRExpression expression) throws IOException
- Throws:
IOException
-
addEncodedAttribute
public void addEncodedAttribute(String name, String value, String defaultValue)
-
addAttribute
public void addAttribute(String name, int value)
-
addAttributePositive
public void addAttributePositive(String name, int value)
-
addAttribute
public void addAttribute(String name, float value)
-
addAttribute
public void addAttribute(String name, float value, float defaultValue)
-
addAttribute
public void addAttribute(String name, double value)
-
addAttribute
public void addAttribute(String name, double value, double defaultValue)
-
addAttribute
public void addAttribute(String name, int value, int defaultValue)
-
addAttribute
public void addAttribute(String name, boolean value)
-
getUnderlyingWriter
public Writer getUnderlyingWriter()
-
-