com.americancoders.ebXML
Class ebXMLHeaderParser

java.lang.Object
  |
  +--org.xml.sax.helpers.DefaultHandler
        |
        +--com.americancoders.ebXML.ebXMLHeaderParser

public class ebXMLHeaderParser
extends org.xml.sax.helpers.DefaultHandler

class to parse an ebXMLHeader.
stores all objects as defined in ebXMLHeader
requires xerces SAX parser From the apache group

package built from ebXML Messaging Service Specification
ebXML Transport, Routing & Packaging
Version 0.21d
16 October 2000
Note this specification is in development and is subject to change
This module, both source code and documentation, is in the Public Domain, and comes with NO WARRANTY.
This program is free software; you can redistribute it and/or modify it under the terms of the Mozilla Public License as published by the Mozilla Software Foundation http://www.mozilla.org/MPL
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Mozilla Public License for more details.

See Also:

Field Summary
protected  int _iElement
           
protected  int _iLine
           
protected  ValueType action
           
private  java.io.CharArrayWriter contents
           
protected  ValueTypeContext conversationId
           
protected  java.lang.Object currentObject
           
protected  ValueType documentDescription
           
protected  ValueType documentId
           
protected  ValueType documentLabel
           
protected  DocumentReference documentReference
           
protected  ebXMLHeader ebXMLHeader
           
protected  ValueType errorURI
           
protected  From from
           
protected  Header header
           
protected  Manifest manifest
           
protected  MessageData messageData
           
protected  ValueType messageId
           
protected  java.util.Stack objectStack
           
protected  org.apache.xerces.parsers.SAXParser parser
           
protected  ValueTypeContext partyId
           
protected  ValueType receiverURI
           
protected  ValueType refToMessageId
           
protected  ReliableMessagingInfo reliableMessagingInfo
           
protected  RoutingHeader routingHeader
           
protected  ValueType senderURI
           
protected  java.lang.String sequenceNumber
           
protected  ValueType serviceInterface
           
protected  ValueType timeStamp
           
protected  To to
           
protected  ValueTypeContext tPAId
           
protected  TPAInfo tPAInfo
           
 
Constructor Summary
ebXMLHeaderParser()
          construct the parser object from xerces -exception SAXEception is caught for setting features -exception generic Java exceptions are caught and stack is dumped to System.out
 
Method Summary
 void characters(char[] ch, int start, int length)
          Method declaration
 void endElement(java.lang.String uri, java.lang.String localName, java.lang.String rawName)
          Method called by the SAX parser at the
 void error(org.xml.sax.SAXParseException e)
          catches error SAXParseExceptions this code causes exception to continue
 void fatalError(org.xml.sax.SAXParseException e)
          catches fatal SAXParseExceptions this code causes exception to continue
 ebXMLHeader getebXMLHeader()
          method to get the ebXMLHeader that was parsed.
 void ignorableWhitespace(char[] ch, int start, int length)
          override the SAX2 ignorableWhitespace method to keep track of line numbers
static void main(java.lang.String[] args)
          test routine pass one arg - filename of file containing xml document
 void parse(java.io.File xmlFile)
          method parse a file
 void parse(org.xml.sax.InputSource is)
          method parse an InputSource
 void parse(java.lang.String xmlString)
          method parse a XML String
 void startElement(java.lang.String uri, java.lang.String localName, java.lang.String rawName, org.xml.sax.Attributes attributes)
          method called for each xml element found.
 void warning(org.xml.sax.SAXParseException e)
          catches warning SAXParseExceptions this code sends exception to stdio and allows public classto continue
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

_iElement

protected int _iElement

_iLine

protected int _iLine

objectStack

protected java.util.Stack objectStack

currentObject

protected java.lang.Object currentObject

parser

protected org.apache.xerces.parsers.SAXParser parser

contents

private java.io.CharArrayWriter contents

ebXMLHeader

protected ebXMLHeader ebXMLHeader

manifest

protected Manifest manifest

documentReference

protected DocumentReference documentReference

documentDescription

protected ValueType documentDescription

documentLabel

protected ValueType documentLabel

documentId

protected ValueType documentId

header

protected Header header

tPAInfo

protected TPAInfo tPAInfo

serviceInterface

protected ValueType serviceInterface

action

protected ValueType action

tPAId

protected ValueTypeContext tPAId

conversationId

protected ValueTypeContext conversationId

messageData

protected MessageData messageData

refToMessageId

protected ValueType refToMessageId

timeStamp

protected ValueType timeStamp

messageId

protected ValueType messageId

from

protected From from

to

protected To to

partyId

protected ValueTypeContext partyId

reliableMessagingInfo

protected ReliableMessagingInfo reliableMessagingInfo

routingHeader

protected RoutingHeader routingHeader

senderURI

protected ValueType senderURI

receiverURI

protected ValueType receiverURI

errorURI

protected ValueType errorURI

sequenceNumber

protected java.lang.String sequenceNumber
Constructor Detail

ebXMLHeaderParser

public ebXMLHeaderParser()
construct the parser object from xerces -exception SAXEception is caught for setting features -exception generic Java exceptions are caught and stack is dumped to System.out
Method Detail

main

public static void main(java.lang.String[] args)
test routine pass one arg - filename of file containing xml document

parse

public void parse(java.lang.String xmlString)
method parse a XML String
Parameters:
String - contains XML text -exception generic Java exceptions are caught and stack is dumped to System.out

parse

public void parse(org.xml.sax.InputSource is)
method parse an InputSource
Parameters:
InputSource - -exception generic Java exceptions are caught and stack is dumped to System.out

parse

public void parse(java.io.File xmlFile)
method parse a file
Parameters:
Java.io.File - file containing XML text -exception generic Java exceptions are caught and stack is dumped to System.out

getebXMLHeader

public ebXMLHeader getebXMLHeader()
method to get the ebXMLHeader that was parsed.
you will need to get the ebXMLHeader to get access to the child objects
Returns:
ebXHMLheader

startElement

public void startElement(java.lang.String uri,
                         java.lang.String localName,
                         java.lang.String rawName,
                         org.xml.sax.Attributes attributes)
                  throws org.xml.sax.SAXException
method called for each xml element found.
process logic
Overrides:
startElement in class org.xml.sax.helpers.DefaultHandler
Parameters:
String - data element name
AttributeList - attributes associated with data element

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws org.xml.sax.SAXException
Method declaration
Overrides:
characters in class org.xml.sax.helpers.DefaultHandler
Parameters:
ch -  
start -  
length -  

endElement

public void endElement(java.lang.String uri,
                       java.lang.String localName,
                       java.lang.String rawName)
                throws org.xml.sax.SAXException
Method called by the SAX parser at the
Overrides:
endElement in class org.xml.sax.helpers.DefaultHandler
Parameters:
String - name of element found
Throws:
org.xml.sax.SAXException -  

ignorableWhitespace

public void ignorableWhitespace(char[] ch,
                                int start,
                                int length)
override the SAX2 ignorableWhitespace method to keep track of line numbers
Overrides:
ignorableWhitespace in class org.xml.sax.helpers.DefaultHandler

warning

public void warning(org.xml.sax.SAXParseException e)
             throws org.xml.sax.SAXException
catches warning SAXParseExceptions this code sends exception to stdio and allows public classto continue
Overrides:
warning in class org.xml.sax.helpers.DefaultHandler

error

public void error(org.xml.sax.SAXParseException e)
           throws org.xml.sax.SAXException
catches error SAXParseExceptions this code causes exception to continue
Overrides:
error in class org.xml.sax.helpers.DefaultHandler

fatalError

public void fatalError(org.xml.sax.SAXParseException e)
                throws org.xml.sax.SAXException
catches fatal SAXParseExceptions this code causes exception to continue
Overrides:
fatalError in class org.xml.sax.helpers.DefaultHandler