net.sf.jasperreports.engine.util

## Class JRXmlWriteHelper

- java.lang.Object
- - net.sf.jasperreports.engine.util.JRXmlWriteHelper

-     public class JRXmlWriteHelper
      extends java.lang.Object

  Version:
    $Id: JRXmlWriteHelper.java 6961 2014-03-07 14:51:41Z lucianc $
  Author:
    Lucian Chirita (lucianc@users.sourceforge.net)

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `protected static class` | `JRXmlWriteHelper.Attribute`
    `protected static class` | `JRXmlWriteHelper.StackElement`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static java.lang.String` | `ESCAPED_CDATA_CLOSE`
    `protected static java.util.regex.Pattern` | `PATTERN_CDATA_CLOSE`
    `static java.lang.String` | `XML_NAMESPACE_ATTRIBUTE`
    `static java.lang.String` | `XML_SCHEMA_LOCATION_ATTRIBUTE`
    `static java.lang.String` | `XML_SCHEMA_NAMESPACE`
    `static java.lang.String` | `XML_SCHEMA_NAMESPACE_PREFIX`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `JRXmlWriteHelper(java.io.Writer writer)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addAttribute(java.lang.String name, boolean value)`
    `void` | `addAttribute(java.lang.String name, boolean value, boolean defaultValue)`
    `void` | `addAttribute(java.lang.String name, byte value, java.util.Map<?,?> xmlValues)` Deprecated. To be removed.
    `void` | `addAttribute(java.lang.String name, byte value, java.util.Map<?,?> xmlValues, byte defaultValue)` Deprecated. To be removed.
    `void` | `addAttribute(java.lang.String name, java.awt.Color color)`
    `void` | `addAttribute(java.lang.String name, java.awt.Color value, java.awt.Color defaultValue)`
    `void` | `addAttribute(java.lang.String name, double value)`
    `void` | `addAttribute(java.lang.String name, double value, double defaultValue)`
    `void` | `addAttribute(java.lang.String name, float value)`
    `void` | `addAttribute(java.lang.String name, java.lang.Float value, boolean withMinDecimals)`
    `void` | `addAttribute(java.lang.String name, float value, float defaultValue)`
    `void` | `addAttribute(java.lang.String name, int value)`
    `void` | `addAttribute(java.lang.String name, int value, int defaultValue)`
    `void` | `addAttribute(java.lang.String name, int value, java.util.Map<?,?> xmlValues)` Deprecated. To be removed.
    `void` | `addAttribute(java.lang.String name, JREnum value)`
    `void` | `addAttribute(java.lang.String name, JREnum value, JREnum defaultValue)`
    `void` | `addAttribute(java.lang.String name, NamedEnum value)`
    `void` | `addAttribute(java.lang.String name, NamedEnum value, NamedEnum defaultValue)`
    `void` | `addAttribute(java.lang.String name, java.lang.Number value, java.lang.Number defaultValue)`
    `void` | `addAttribute(java.lang.String name, java.lang.Object value)`
    `void` | `addAttribute(java.lang.String name, java.lang.Object value, java.util.Map<?,?> xmlValues)` Deprecated. To be removed.
    `void` | `addAttribute(java.lang.String name, java.lang.Object value, java.util.Map<?,?> xmlValues, java.lang.Object defaultValue)` Deprecated. To be removed.
    `void` | `addAttribute(java.lang.String name, java.lang.String value)`
    `void` | `addAttribute(java.lang.String name, java.lang.String value, java.lang.String defaultValue)`
    `void` | `addAttributePositive(java.lang.String name, int value)`
    `void` | `addEncodedAttribute(java.lang.String name, java.lang.String value)`
    `void` | `addEncodedAttribute(java.lang.String name, java.lang.String value, java.lang.String defaultValue)`
    `protected void` | `clearBuffer()`
    `void` | `closeElement()`
    `void` | `closeElement(boolean skipIfEmpty)`
    `protected static java.lang.String` | `encodeCDATA(java.lang.String data)`
    `protected XmlNamespace` | `findContextNamespace(java.lang.String namespaceURI)`
    `protected void` | `flushBuffer()`
    `protected char[]` | `getIndent(int level)`
    `protected XmlNamespace` | `getParentNamespace()`
    `protected static java.lang.String` | `getQualifiedName(java.lang.String name, java.lang.String nsPrefix)`
    `protected static java.lang.String` | `getQualifiedName(java.lang.String name, XmlNamespace ns)`
    `java.io.Writer` | `getUnderlyingWriter()`
    `void` | `startElement(java.lang.String name)`
    `void` | `startElement(java.lang.String name, XmlNamespace namespace)`
    `protected void` | `writeAttribute(java.lang.String name, java.lang.String value)`
    `void` | `writeCDATA(java.lang.String data)`
    `void` | `writeCDATAElement(java.lang.String name, java.lang.String data)`
    `void` | `writeCDATAElement(java.lang.String name, java.lang.String data, java.lang.String attName, java.lang.Object attValue)`
    `void` | `writeCDATAElement(java.lang.String name, java.lang.String data, java.lang.String attName, java.lang.String attValue)`
    `void` | `writeCDATAElement(java.lang.String name, XmlNamespace namespace, java.lang.String data)`
    `void` | `writeCDATAElement(java.lang.String name, XmlNamespace namespace, java.lang.String data, java.lang.String attName, java.lang.Object attValue)`
    `protected void` | `writeElementAttributes(JRXmlWriteHelper.StackElement element, int level)`
    `void` | `writeExpression(java.lang.String name, JRExpression expression)`
    `void` | `writeExpression(java.lang.String name, JRExpression expression, boolean writeClass)` Deprecated. Replaced by `writeExpression(String, JRExpression)`.
    `void` | `writeExpression(java.lang.String name, JRExpression expression, boolean writeClass, java.lang.String defaultClassName)` Deprecated. Replaced by `writeExpression(String, JRExpression)`.
    `void` | `writeExpression(java.lang.String name, XmlNamespace namespace, JRExpression expression)`
    `void` | `writeExpression(java.lang.String name, XmlNamespace namespace, JRExpression expression, boolean writeClass)` Deprecated. Replaced by `writeExpression(String, XmlNamespace, JRExpression)`.
    `void` | `writeExpression(java.lang.String name, XmlNamespace namespace, JRExpression expression, boolean writeClass, java.lang.String defaultClassName)` Deprecated. Replaced by `writeExpression(String, XmlNamespace, JRExpression)`.
    `protected void` | `writeParents(boolean content)`
    `void` | `writeProlog(java.lang.String encoding)`
    `void` | `writePublicDoctype(java.lang.String rootElement, java.lang.String description, java.lang.String dtdLocation)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### XML_SCHEMA_NAMESPACE

          public static final java.lang.String XML_SCHEMA_NAMESPACE

      See Also:
        Constant Field Values

    - #### XML_SCHEMA_NAMESPACE_PREFIX

          public static final java.lang.String XML_SCHEMA_NAMESPACE_PREFIX

      See Also:
        Constant Field Values

    - #### XML_NAMESPACE_ATTRIBUTE

          public static final java.lang.String XML_NAMESPACE_ATTRIBUTE

      See Also:
        Constant Field Values

    - #### XML_SCHEMA_LOCATION_ATTRIBUTE

          public static final java.lang.String XML_SCHEMA_LOCATION_ATTRIBUTE

      See Also:
        Constant Field Values

    - #### PATTERN_CDATA_CLOSE

          protected static final java.util.regex.Pattern PATTERN_CDATA_CLOSE

    - #### ESCAPED_CDATA_CLOSE

          protected static final java.lang.String ESCAPED_CDATA_CLOSE

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### JRXmlWriteHelper

          public JRXmlWriteHelper(java.io.Writer writer)

  - ### Method Detail

    - #### writeProlog

          public void writeProlog(java.lang.String encoding)
                           throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### writePublicDoctype

          public void writePublicDoctype(java.lang.String rootElement,
                                java.lang.String description,
                                java.lang.String dtdLocation)
                                  throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### startElement

          public void startElement(java.lang.String name)

    - #### startElement

          public void startElement(java.lang.String name,
                          XmlNamespace namespace)

    - #### getParentNamespace

          protected XmlNamespace getParentNamespace()

    - #### findContextNamespace

          protected XmlNamespace findContextNamespace(java.lang.String namespaceURI)

    - #### getQualifiedName

          protected static java.lang.String getQualifiedName(java.lang.String name,
                                          XmlNamespace ns)

    - #### getQualifiedName

          protected static java.lang.String getQualifiedName(java.lang.String name,
                                          java.lang.String nsPrefix)

    - #### writeParents

          protected void writeParents(boolean content)
                               throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### writeCDATA

          public void writeCDATA(java.lang.String data)
                          throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### writeCDATAElement

          public void writeCDATAElement(java.lang.String name,
                               java.lang.String data)
                                 throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### writeCDATAElement

          public void writeCDATAElement(java.lang.String name,
                               XmlNamespace namespace,
                               java.lang.String data)
                                 throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### writeCDATAElement

          public void writeCDATAElement(java.lang.String name,
                               java.lang.String data,
                               java.lang.String attName,
                               java.lang.String attValue)
                                 throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### writeCDATAElement

          public void writeCDATAElement(java.lang.String name,
                               java.lang.String data,
                               java.lang.String attName,
                               java.lang.Object attValue)
                                 throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### writeCDATAElement

          public void writeCDATAElement(java.lang.String name,
                               XmlNamespace namespace,
                               java.lang.String data,
                               java.lang.String attName,
                               java.lang.Object attValue)
                                 throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### writeElementAttributes

          protected void writeElementAttributes(JRXmlWriteHelper.StackElement element,
                                    int level)
                                         throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### closeElement

          public void closeElement()
                            throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### closeElement

          public void closeElement(boolean skipIfEmpty)
                            throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### getIndent

          protected char[] getIndent(int level)

    - #### flushBuffer

          protected void flushBuffer()
                              throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### clearBuffer

          protected void clearBuffer()

    - #### writeExpression

          public void writeExpression(java.lang.String name,
                             JRExpression expression,
                             boolean writeClass)
                               throws java.io.IOException

      Deprecated. Replaced by `writeExpression(String, JRExpression)`.
      Throws:
        `java.io.IOException`

    - #### writeExpression

          public void writeExpression(java.lang.String name,
                             XmlNamespace namespace,
                             JRExpression expression)
                               throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### writeExpression

          public void writeExpression(java.lang.String name,
                             JRExpression expression)
                               throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### writeExpression

          public void writeExpression(java.lang.String name,
                             XmlNamespace namespace,
                             JRExpression expression,
                             boolean writeClass)
                               throws java.io.IOException

      Deprecated. Replaced by `writeExpression(String, XmlNamespace, JRExpression)`.
      Throws:
        `java.io.IOException`

    - #### writeExpression

          public void writeExpression(java.lang.String name,
                             JRExpression expression,
                             boolean writeClass,
                             java.lang.String defaultClassName)
                               throws java.io.IOException

      Deprecated. Replaced by `writeExpression(String, JRExpression)`.
      Throws:
        `java.io.IOException`

    - #### writeExpression

          public void writeExpression(java.lang.String name,
                             XmlNamespace namespace,
                             JRExpression expression,
                             boolean writeClass,
                             java.lang.String defaultClassName)
                               throws java.io.IOException

      Deprecated. Replaced by `writeExpression(String, XmlNamespace, JRExpression)`.
      Throws:
        `java.io.IOException`

    - #### writeAttribute

          protected void writeAttribute(java.lang.String name,
                            java.lang.String value)

    - #### addAttribute

          public void addAttribute(java.lang.String name,
                          java.lang.String value)

    - #### addEncodedAttribute

          public void addEncodedAttribute(java.lang.String name,
                                 java.lang.String value)

    - #### addAttribute

          public void addAttribute(java.lang.String name,
                          java.lang.String value,
                          java.lang.String defaultValue)

    - #### addEncodedAttribute

          public void addEncodedAttribute(java.lang.String name,
                                 java.lang.String value,
                                 java.lang.String defaultValue)

    - #### addAttribute

          public void addAttribute(java.lang.String name,
                          java.lang.Object value)

    - #### addAttribute

          public void addAttribute(java.lang.String name,
                          java.lang.Number value,
                          java.lang.Number defaultValue)

    - #### addAttribute

          public void addAttribute(java.lang.String name,
                          java.lang.Float value,
                          boolean withMinDecimals)

    - #### addAttribute

          public void addAttribute(java.lang.String name,
                          JREnum value)

    - #### addAttribute

          public void addAttribute(java.lang.String name,
                          NamedEnum value)

    - #### addAttribute

          public void addAttribute(java.lang.String name,
                          JREnum value,
                          JREnum defaultValue)

    - #### addAttribute

          public void addAttribute(java.lang.String name,
                          NamedEnum value,
                          NamedEnum defaultValue)

    - #### addAttribute

          public void addAttribute(java.lang.String name,
                          int value)

    - #### addAttributePositive

          public void addAttributePositive(java.lang.String name,
                                  int value)

    - #### addAttribute

          public void addAttribute(java.lang.String name,
                          float value)

    - #### addAttribute

          public void addAttribute(java.lang.String name,
                          float value,
                          float defaultValue)

    - #### addAttribute

          public void addAttribute(java.lang.String name,
                          double value)

    - #### addAttribute

          public void addAttribute(java.lang.String name,
                          double value,
                          double defaultValue)

    - #### addAttribute

          public void addAttribute(java.lang.String name,
                          int value,
                          int defaultValue)

    - #### addAttribute

          public void addAttribute(java.lang.String name,
                          boolean value)

    - #### addAttribute

          public void addAttribute(java.lang.String name,
                          boolean value,
                          boolean defaultValue)

    - #### addAttribute

          public void addAttribute(java.lang.String name,
                          java.awt.Color color)

    - #### addAttribute

          public void addAttribute(java.lang.String name,
                          java.awt.Color value,
                          java.awt.Color defaultValue)

    - #### addAttribute

          public void addAttribute(java.lang.String name,
                          byte value,
                          java.util.Map<?,?> xmlValues)

      Deprecated. To be removed.

    - #### addAttribute

          public void addAttribute(java.lang.String name,
                          int value,
                          java.util.Map<?,?> xmlValues)

      Deprecated. To be removed.

    - #### addAttribute

          public void addAttribute(java.lang.String name,
                          byte value,
                          java.util.Map<?,?> xmlValues,
                          byte defaultValue)

      Deprecated. To be removed.

    - #### addAttribute

          public void addAttribute(java.lang.String name,
                          java.lang.Object value,
                          java.util.Map<?,?> xmlValues)

      Deprecated. To be removed.

    - #### addAttribute

          public void addAttribute(java.lang.String name,
                          java.lang.Object value,
                          java.util.Map<?,?> xmlValues,
                          java.lang.Object defaultValue)

      Deprecated. To be removed.

    - #### getUnderlyingWriter

          public java.io.Writer getUnderlyingWriter()

    - #### encodeCDATA

          protected static java.lang.String encodeCDATA(java.lang.String data)

© 2001-2010 Jaspersoft Corporation www.jaspersoft.com