Overview | Package | Class | Tree | Deprecated | Index | Help
| Sun Adapter for TCP/IP HL7
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.stc.connector.tcpip.hl7.util
Class HL7XmlUtil

    java.lang.Object
      com.stc.connector.tcpip.hl7.util.HL7XmlUtil

    public class HL7XmlUtil

extends java.lang.Object

This is the utility class to handle XML data.

Author:
  Raghunadh Teegavarapu

Constructor Summary
`HL7XmlUtil()`

Method Summary
`static org.w3c.dom.Document` | `createDocument(boolean namespaceAware)` Creates a Document object
`static org.w3c.dom.Document` | `createDocument(boolean namespaceAware, org.xml.sax.InputSource source)` Creates a Document object with InputSource.
`static org.w3c.dom.Document` | `createDocumentFromXML(boolean namespaceAware, java.lang.String xml)` Creates a Document object with String based XML data
`static com.sun.encoder.EncoderFactory` | `getEncoderFactory()` get encoder factory.
`static com.sun.encoder.EncoderType` | `getEncoderType()` get encoder type.
`static java.lang.String` | `getMessageID(org.w3c.dom.Document doc)` Traverse Document node to get message ID.
`static java.lang.String` | `getText(org.w3c.dom.Node node)` Gets the text attribute of a DOM node
`static java.lang.String` | `getVersionID(org.w3c.dom.Document doc)` Traverse Document node to get version ID.
`static byte[]` | `transformToBytes(org.w3c.dom.Node node, java.lang.String encoding, boolean omitXMLDeclaration)` Serializes DOM node to an array of bytes.
`static byte[]` | `transformToBytes(org.w3c.dom.Node node, java.lang.String encoding, boolean omitXMLDeclaration, java.lang.String method)` Serializes DOM node to an array of bytes.
`static byte[]` | `transformToBytes(javax.xml.transform.Source source, java.lang.String encoding, boolean omitXMLDeclaration)` Serializes Source to an array of bytes.
`static javax.xml.transform.dom.DOMResult` | `transformToDOMResult(javax.xml.transform.Transformer trans, javax.xml.transform.Source source)`
`static java.lang.String` | `transformToString(org.w3c.dom.Node node, java.lang.String encoding, boolean omitXMLDeclaration)` Serializes DOM node to String.
`static java.lang.String` | `transformToString(org.w3c.dom.Node node, java.lang.String encoding, boolean omitXMLDeclaration, java.lang.String method)` Serializes DOM node to an array of bytes.
`static java.lang.String` | `transformToString(javax.xml.transform.Source source, java.lang.String encoding, boolean omitXMLDeclaration)` Serializes Source to String.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### HL7XmlUtil

    public HL7XmlUtil()

Method Detail

### createDocument

    public static org.w3c.dom.Document createDocument(boolean namespaceAware)
                                               throws java.lang.Exception

  Creates a Document object

  Parameters:
    `namespaceAware` - namespaceAware flag
  Returns:
    Document object
  Throws:
    `exception` - upon error
    `java.lang.Exception`

### createDocument

    public static org.w3c.dom.Document createDocument(boolean namespaceAware,
                                                      org.xml.sax.InputSource source)
                                               throws org.xml.sax.SAXException,
                                                      java.io.IOException,
                                                      java.lang.Exception

  Creates a Document object with InputSource.

  Parameters:
    `namespaceAware` - namespaceAware flag
    `source` - InputSource object
  Returns:
    Document object
  Throws:
    `exception` - upon error
    `org.xml.sax.SAXException`
    `java.io.IOException`
    `java.lang.Exception`

### createDocumentFromXML

    public static org.w3c.dom.Document createDocumentFromXML(boolean namespaceAware,
                                                             java.lang.String xml)
                                                      throws org.xml.sax.SAXException,
                                                             java.io.IOException,
                                                             java.lang.Exception

  Creates a Document object with String based XML data

  Parameters:
    `namespaceAware` - namespaceAware flag
    `xml` - XML data
  Returns:
    Document object
  Throws:
    `exception` - upon error
    `org.xml.sax.SAXException`
    `java.io.IOException`
    `java.lang.Exception`

### getText

    public static java.lang.String getText(org.w3c.dom.Node node)

  Gets the text attribute of a DOM node

  Parameters:
    `node` - Description of the Parameter
  Returns:
    The text value

### transformToBytes

    public static byte[] transformToBytes(org.w3c.dom.Node node,
                                          java.lang.String encoding,
                                          boolean omitXMLDeclaration)
                                   throws java.lang.Exception

  Serializes DOM node to an array of bytes.

  Parameters:
    `node` - DOM node
    `encoding` - encoding style
    `omitXMLDeclaration` - omitXMLDeclaration flag
  Returns:
    byte array representation of the DOM node
  Throws:
    `exception` - upon error
    `java.lang.Exception`

### transformToString

    public static java.lang.String transformToString(org.w3c.dom.Node node,
                                                     java.lang.String encoding,
                                                     boolean omitXMLDeclaration)
                                              throws java.lang.Exception

  Serializes DOM node to String.

  Parameters:
    `node` - DOM node
    `encoding` - encoding style
    `omitXMLDeclaration` - omitXMLDeclaration flag
  Returns:
    String representation of the DOM node
  Throws:
    `exception` - upon error
    `java.lang.Exception`

### transformToString

    public static java.lang.String transformToString(javax.xml.transform.Source source,
                                                     java.lang.String encoding,
                                                     boolean omitXMLDeclaration)
                                              throws java.lang.Exception

  Serializes Source to String.

  Parameters:
    `Source` - source
    `encoding` - encoding style
    `omitXMLDeclaration` - omitXMLDeclaration flag
  Returns:
    String representation of the Source
  Throws:
    `exception` - upon error
    `java.lang.Exception`

### transformToBytes

    public static byte[] transformToBytes(javax.xml.transform.Source source,
                                          java.lang.String encoding,
                                          boolean omitXMLDeclaration)
                                   throws java.lang.Exception

  Serializes Source to an array of bytes.

  Parameters:
    `Source` - source
    `encoding` - encoding style
    `omitXMLDeclaration` - omitXMLDeclaration flag
  Returns:
    byte array representation of the source
  Throws:
    `exception` - upon error
    `java.lang.Exception`

### transformToBytes

    public static byte[] transformToBytes(org.w3c.dom.Node node,
                                          java.lang.String encoding,
                                          boolean omitXMLDeclaration,
                                          java.lang.String method)
                                   throws java.lang.Exception

  Serializes DOM node to an array of bytes.

  Parameters:
    `node` - DOM node
    `encoding` - encoding style
    `method` - method to write the result
    `omitXMLDeclaration` - omitXMLDeclaration flag
  Returns:
    byte array representation of the DOM node
  Throws:
    `exception` - upon error
    `java.lang.Exception`

### transformToString

    public static java.lang.String transformToString(org.w3c.dom.Node node,
                                                     java.lang.String encoding,
                                                     boolean omitXMLDeclaration,
                                                     java.lang.String method)
                                              throws java.lang.Exception

  Serializes DOM node to an array of bytes.

  Parameters:
    `node` - DOM node
    `encoding` - encoding style
    `method` - method to write the result
    `omitXMLDeclaration` - omitXMLDeclaration flag
  Returns:
    String representation of the DOM node
  Throws:
    `exception` - upon error
    `java.lang.Exception`

### transformToDOMResult

    public static javax.xml.transform.dom.DOMResult transformToDOMResult(javax.xml.transform.Transformer trans,
                                                                         javax.xml.transform.Source source)
                                                                  throws java.lang.Exception

  Throws:
    `java.lang.Exception`

### getVersionID

    public static java.lang.String getVersionID(org.w3c.dom.Document doc)

  Traverse Document node to get version ID.

  Parameters:
    `Document` - doc
  Returns:
    String representation of the version ID

### getMessageID

    public static java.lang.String getMessageID(org.w3c.dom.Document doc)

  Traverse Document node to get message ID.

  Parameters:
    `Document` - doc
  Returns:
    String representation of the version ID

### getEncoderFactory

    public static com.sun.encoder.EncoderFactory getEncoderFactory()
                                                            throws java.lang.Exception

  get encoder factory.

  Returns:
    EncoderFactory factory
  Throws:
    `java.lang.Exception`

### getEncoderType

    public static com.sun.encoder.EncoderType getEncoderType()
                                                      throws java.lang.Exception

  get encoder type.

  Returns:
    EncoderType type
  Throws:
    `java.lang.Exception`

Overview | Package | Class | Tree | Deprecated | Index | Help
| Sun Adapter for TCP/IP HL7
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD