|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.sourceforge.saxadapter.examples.commerce.XCBLResponseWriter
This class creates an XCBL OrderResponse document from the corresponding Order document presented in the form of a SAX event stream
Inner Class Summary | |
(package private) class |
XCBLResponseWriter.BuyerPartyTagHandler
This class buffers the BuyerParty info since it appears in a different order in the response than in the Order |
(package private) class |
XCBLResponseWriter.IgnoreTagHandler
This handler causes the OrderParty tag to be ignored, but not its child tags, which are the BuyerParety and SellerParty tags, that need to be in the response |
(package private) class |
XCBLResponseWriter.ItemDetailTagHandler
This class writes out the original line item info along with a hard-coded approval response |
(package private) class |
XCBLResponseWriter.OrderDateHandler
This handler writes out the response type after the date |
(package private) class |
XCBLResponseWriter.OrderHeaderTagHandler
This handler adds the response type and response code values to the incoming order header info |
(package private) class |
XCBLResponseWriter.OrderResponseHandler
This handlers takes care of adding the appropriate response references |
(package private) class |
XCBLResponseWriter.OrderSummaryTagHandler
This class formats the correct OrderReponse summary section |
(package private) class |
XCBLResponseWriter.SellerPartyTagHandler
This handler writes out the Seller info and then the buffered buyer info so that they are in the correct (but reversed) order in the response |
Field Summary | |
(package private) SAXAdapter |
m_adapter
|
Constructor Summary | |
XCBLResponseWriter(SAXAdapter argAdapter)
|
Method Summary | |
java.lang.StringBuffer |
formatDate()
This method returns a Date formatted according to the XCBL spec |
java.lang.String |
getMappedTagName(java.lang.String argTagName)
Returns the name change that applies to tags that are copied to the response with a simple name change |
java.lang.StringBuffer |
getNextOrderNumber()
This method returns a unique order number for each new order This implementation is overly simplistic and resets to zero each time the writer is instantiated |
void |
onEndTag(java.lang.String argTagNamespace,
java.lang.String argLocalTagName,
java.lang.String argQName,
java.util.Map argContext,
NamespaceContext argNamespaceContext)
Called by the SAXAdapter when an end tag, for which this
callback interface has been registered, has been encountered. |
void |
onStartTag(java.lang.String argTagNamespace,
java.lang.String argLocalTagName,
java.lang.String argQName,
org.xml.sax.Attributes argAttributes,
java.lang.StringBuffer argText,
java.util.Map argContext,
NamespaceContext argNamespaceContext)
Called by the SAXAdapter when a start tag, for which this
callback interface has been registered, has been encountered. |
void |
setWriter(java.io.Writer argOut)
Sets the writer to be used to construct the response |
Methods inherited from class java.lang.Object |
|
Field Detail |
SAXAdapter m_adapter
Constructor Detail |
public XCBLResponseWriter(SAXAdapter argAdapter)
Method Detail |
public java.lang.StringBuffer getNextOrderNumber()
public java.lang.StringBuffer formatDate()
public void setWriter(java.io.Writer argOut)
argOut
- the Writer to which to write the responsepublic java.lang.String getMappedTagName(java.lang.String argTagName)
argTagName
- the name of the original order tagpublic void onStartTag(java.lang.String argTagNamespace, java.lang.String argLocalTagName, java.lang.String argQName, org.xml.sax.Attributes argAttributes, java.lang.StringBuffer argText, java.util.Map argContext, NamespaceContext argNamespaceContext) throws org.xml.sax.SAXException
SAXTagHandler
SAXAdapter
when a start tag, for which this
callback interface has been registered, has been encountered.onStartTag
in interface SAXTagHandler
net.sourceforge.saxadapter.SAXTagHandler
argTagNamespace
- namespace URI of tagargLocalTagName
- unqualified tag nameargQName
- qualified name of tagargAttributes
- tag attributesargText
- a StringBuffer that contains the text between the start
and end tags.argContext
- the Map that represents parsing context.
This context must be understood by each handlerargNamespaceContext
- an interface that allows the handler to access
namespace data associated with the current parsing stateorg.xml.sax.SAXException
- public void onEndTag(java.lang.String argTagNamespace, java.lang.String argLocalTagName, java.lang.String argQName, java.util.Map argContext, NamespaceContext argNamespaceContext) throws org.xml.sax.SAXException
SAXTagHandler
SAXAdapter
when an end tag, for which this
callback interface has been registered, has been encountered.onEndTag
in interface SAXTagHandler
net.sourceforge.saxadapter.SAXTagHandler
argTagNamespace
- namespace URI of tagargLocalTagName
- unqualified tag nameargQName
- qualified tag nameargContext
- the Map that represents parsing context. This context must
be understood by each handlerargNamespaceContext
- an interface that allows the handler to access
namespace data associated with the current parsing stateorg.xml.sax.SAXException
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |