psdi.iface.mos

Class StAXUtil

  • java.lang.Object
    • psdi.iface.mos.StAXUtil
  • All Implemented Interfaces:
    MosConstants


    public class StAXUtil
    extends java.lang.Object
    implements MosConstants
    StAX Utility class
    • Field Detail

      • INTEGRATIONLOGGER

        protected static final MXLogger INTEGRATIONLOGGER
      • outputFactory

        protected static javax.xml.stream.XMLOutputFactory outputFactory
    • Constructor Detail

      • StAXUtil

        public StAXUtil()
    • Method Detail

      • initalizeStAX

        public static javax.xml.stream.XMLStreamWriter initalizeStAX(java.io.ByteArrayOutputStream bo)
                                                              throws javax.xml.stream.XMLStreamException
        Initilize StAX parset with ByteArrayOutputStream.
        Parameters:
        bo - Give ByteArrayOutputStream to set to parser
        Returns:
        instance of XMLStreamWriter
        Throws:
        javax.xml.stream.XMLStreamException - XMLStream exception
      • setDefaultNS

        public static void setDefaultNS(javax.xml.stream.XMLStreamWriter writer)
                                 throws javax.xml.stream.XMLStreamException,
                                        java.rmi.RemoteException
        Set default namespaces to the writer.
        Parameters:
        writer - Instance of XMLStreamWriter
        Throws:
        javax.xml.stream.XMLStreamException - XMLStream exception
        java.rmi.RemoteException
      • writeDefaultNS

        public static void writeDefaultNS(javax.xml.stream.XMLStreamWriter writer)
                                   throws javax.xml.stream.XMLStreamException,
                                          java.rmi.RemoteException
        Writes default namespaces to the writer.
        Parameters:
        writer - Instance of XMLStreamWriter
        Throws:
        javax.xml.stream.XMLStreamException - XMLStream exception
        java.rmi.RemoteException
      • setXSINS

        public static void setXSINS(javax.xml.stream.XMLStreamWriter writer)
                             throws javax.xml.stream.XMLStreamException
        Set prefix and namespace parameters to a writer
        Parameters:
        writer - Instance of XMLStreamWriter
        Throws:
        javax.xml.stream.XMLStreamException - XMLStream exception
      • writeXSINS

        public static void writeXSINS(javax.xml.stream.XMLStreamWriter writer)
                               throws javax.xml.stream.XMLStreamException
        Writes prefix and namespace parameters to a writer
        Parameters:
        writer - Instance of XMLStreamWriter
        Throws:
        javax.xml.stream.XMLStreamException - XMLStream exception
      • createHeaderElements

        public static void createHeaderElements(javax.xml.stream.XMLStreamWriter writer,
                                                java.lang.String wrapperName)
                                         throws javax.xml.stream.XMLStreamException,
                                                java.rmi.RemoteException
        Creates header element
        Parameters:
        writer - Instance of XMLStreamWriter
        wrapperName - Wrapper Name
        Throws:
        javax.xml.stream.XMLStreamException - XMLStream exception
        java.rmi.RemoteException
      • setCommonContentAttributes

        public static void setCommonContentAttributes(javax.xml.stream.XMLStreamWriter writer,
                                                      UserInfo userInfo)
                                               throws MXException,
                                                      java.rmi.RemoteException,
                                                      javax.xml.stream.XMLStreamException
        Creates common content
        Parameters:
        writer - Instance of XMLStreamWriter
        user - info User Info object
        Throws:
        javax.xml.stream.XMLStreamException - XMLStream exception
        MXException
        java.rmi.RemoteException
      • setCommonContentAttributes

        public static void setCommonContentAttributes(javax.xml.stream.XMLStreamWriter writer,
                                                      java.lang.String transLanguage)
                                               throws MXException,
                                                      java.rmi.RemoteException,
                                                      javax.xml.stream.XMLStreamException
        Throws:
        MXException
        java.rmi.RemoteException
        javax.xml.stream.XMLStreamException
      • createTailElements

        public static void createTailElements(javax.xml.stream.XMLStreamWriter writer,
                                              boolean hasWrapper)
                                       throws javax.xml.stream.XMLStreamException
        Creates tail element
        Parameters:
        writer - Instance of XMLStreamWriter
        hasWrapper - has Wrapper
        Throws:
        javax.xml.stream.XMLStreamException - XMLStream exception
      • createEmptyResponse

        public static byte[] createEmptyResponse(java.lang.String top,
                                                 UserInfo uinfo)
                                          throws MXException
        Creates tail element
        Parameters:
        writer - Instance of XMLStreamWriter
        hasWrapper - has Wrapper
        Throws:
        javax.xml.stream.XMLStreamException - XMLStream exception
        MXException