Class XmlPayloadTranslatorImpl

    • Field Detail

      • ELEMENT_NAME_COLUMN

        protected static final java.lang.String ELEMENT_NAME_COLUMN
        See Also:
        Constant Field Values
      • ELEMENT_NAME_ROW

        protected static final java.lang.String ELEMENT_NAME_ROW
        See Also:
        Constant Field Values
      • ELEMENT_NAME_RESULTS

        protected static final java.lang.String ELEMENT_NAME_RESULTS
        See Also:
        Constant Field Values
    • Constructor Detail

      • XmlPayloadTranslatorImpl

        public XmlPayloadTranslatorImpl()
    • Method Detail

      • init

        public void init()
                  throws CoreException
        Description copied from interface: ComponentLifecycle
        Initialises the component.

        Component initialisation includes config verification, creation of connections etc.

        Throws:
        CoreException - wrapping any underlying Exceptions
      • close

        public void close()
        Description copied from interface: ComponentLifecycle
        Closes the component.

        A closed component should release any connections it uses, etc. and clean up completely. Throwing a RuntimeException may cause unintended consequences

      • isXmlColumn

        protected boolean isXmlColumn​(java.lang.String name)
      • createTextNode

        protected org.w3c.dom.Node createTextNode​(org.w3c.dom.Document doc,
                                                  java.lang.String value,
                                                  boolean isCDATA)
      • createInputSource

        protected static org.xml.sax.InputSource createInputSource​(java.lang.String value)
      • getXmlColumnPrefix

        public java.lang.String getXmlColumnPrefix()
        Returns:
        the prefix used to identify columns that should be returned as XML as opposed to text
      • setXmlColumnPrefix

        public void setXmlColumnPrefix​(java.lang.String s)
        Sets the prefix that is used to identify columns that should be treated as XML rather than text.
        Parameters:
        s - the prefix; note that this will be a case sensitive match, so if the behaviour of the database / JDBC driver is to make all columns / labels uppercase, then make sure you use the right case.
      • getXmlColumnRegexp

        public java.lang.String getXmlColumnRegexp()
      • setXmlColumnRegexp

        public void setXmlColumnRegexp​(java.lang.String s)
        Set a regular expression that will be used to check if a column should be treated as XML rather than text.
        Parameters:
        s - the regular expression to match that indicates the column is XML, setXmlColumnPrefix(String) is always checked first.
        See Also:
        setXmlColumnPrefix(String)
      • getOutputMessageEncoding

        public java.lang.String getOutputMessageEncoding()
      • setOutputMessageEncoding

        public void setOutputMessageEncoding​(java.lang.String encoding)
        Set the encoding for the resulting XML document.

        If not specified the following rules will be applied:

        1. If the AdaptrisMessage.getCharEncoding() is non-null then that will be used.
        2. UTF-8

        As a result; the character encoding on the message is always set using AdaptrisMessage.setCharEncoding(String).

        Parameters:
        encoding - the character
      • getCdataColumnRegexp

        public java.lang.String getCdataColumnRegexp()
      • setCdataColumnRegexp

        public void setCdataColumnRegexp​(java.lang.String s)
        Set the regular expression that will be used to check if a column should be wrapped in a CDATA element.
        Parameters:
        s - the regular expression to match that indicates the column should be wrapped in a CDATA element.
      • getStripIllegalXmlChars

        public java.lang.Boolean getStripIllegalXmlChars()
      • setStripIllegalXmlChars

        public void setStripIllegalXmlChars​(java.lang.Boolean s)
        Specify whether or not to strip illegal XML characters from all the data before converting to XML.

        The following regular expression is used to strip out all invalid XML 1.0 characters : "[^ \r\n -퟿-�𐀀-􏿿]". Note that not stripping Illegal XML characters can still mean that you get output that looks like XML, but you will not be able to subsequently process it as a DOM object.

        Parameters:
        s - true to enable stripping, default is null (false)
      • stripIllegalXmlChars

        protected boolean stripIllegalXmlChars()