|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
xml.cart.CartDocumentHandler
public class CartDocumentHandler
The CartDocumentHandler gets notification in the form of a call-back method. These call-backs are like the Listener model used for event handling. When a new element is encountered, for example, that creates a call-back. The call-backs are handled in the DocumentHandler:
Constructor Summary | |
---|---|
CartDocumentHandler()
|
Method Summary | |
---|---|
void |
addProduct()
addProduct will make an instance of a Product class and add it to the Cart instance. |
void |
characters(char[] buf,
int offset,
int len)
when characters are found, we add them to the string vector for latter use. |
void |
endElement(java.lang.String name)
When we get the tag, then we want to invoke addProduct otherwise, just return: |
Cart |
getCart()
|
void |
ignorableWhitespace(char[] buf,
int offset,
int len)
|
void |
processingInstruction(java.lang.String target,
java.lang.String data)
The processingInstruction is called back when a non XML declaration is made. |
void |
startElement()
The AttributeList is not going to have any attributes in it for our example (i.e. |
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
---|
endDocument, endElement, endPrefixMapping, error, fatalError, notationDecl, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping, unparsedEntityDecl, warning |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CartDocumentHandler()
Method Detail |
---|
public Cart getCart()
public void startElement()
public void endElement(java.lang.String name)
public void addProduct()
public void characters(char[] buf, int offset, int len)
characters
in interface org.xml.sax.ContentHandler
characters
in class org.xml.sax.helpers.DefaultHandler
public void ignorableWhitespace(char[] buf, int offset, int len)
ignorableWhitespace
in interface org.xml.sax.ContentHandler
ignorableWhitespace
in class org.xml.sax.helpers.DefaultHandler
public void processingInstruction(java.lang.String target, java.lang.String data)
processingInstruction
in interface org.xml.sax.ContentHandler
processingInstruction
in class org.xml.sax.helpers.DefaultHandler
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |