|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
com.knowgate.hipergate.ShoppingBasket
public class ShoppingBasket
Shopping basket
This class is specially designed for usage as a shopping basket for a website
| Field Summary | |
|---|---|
protected static boolean |
DEFAULT_DYNAMIC_VALIDATION
|
protected static boolean |
DEFAULT_MEMORY_USAGE
|
protected static boolean |
DEFAULT_NAMESPACE_PREFIXES
|
protected static boolean |
DEFAULT_NAMESPACES
|
protected static java.lang.String |
DEFAULT_PARSER_NAME
|
protected static int |
DEFAULT_REPETITION
|
protected static boolean |
DEFAULT_SCHEMA_FULL_CHECKING
|
protected static boolean |
DEFAULT_SCHEMA_VALIDATION
|
protected static boolean |
DEFAULT_TAGGINESS
|
protected static boolean |
DEFAULT_VALIDATION
|
protected static java.lang.String |
DYNAMIC_VALIDATION_FEATURE_ID
|
protected static java.lang.String |
NAMESPACE_PREFIXES_FEATURE_ID
|
protected static java.lang.String |
NAMESPACES_FEATURE_ID
|
protected static java.lang.String |
SCHEMA_FULL_CHECKING_FEATURE_ID
|
protected static java.lang.String |
SCHEMA_VALIDATION_FEATURE_ID
|
protected static java.lang.String |
VALIDATION_FEATURE_ID
|
| Constructor Summary | |
|---|---|
ShoppingBasket()
Default constructor |
|
| Method Summary | |
|---|---|
void |
addLine()
Add empty order line to this basket |
void |
addLine(java.util.Map oLine)
Add order line to this basket Each line has an arbitrary number of named attributes given in the Map passed as parameter |
void |
addLine(java.lang.String sInputStr,
java.lang.String sDelimiter)
Add order line to this basket This method adds a line from a string of the form: "attribute1=value1,attribute2=value2,attribute3=value3" |
void |
characters(char[] ch,
int start,
int length)
Characters. |
void |
clearLine(int nLine)
Clear all attributes for a line |
void |
clearProperties()
Clear all global properties |
protected java.lang.String |
composeError(java.lang.String type,
org.xml.sax.SAXParseException ex)
Compose the error message. |
boolean |
containsProperty(java.lang.String sKey)
Whether or not this shopping basket contains a given global property |
int |
countAddresses()
|
void |
endElement(java.lang.String uri,
java.lang.String local,
java.lang.String qname)
|
void |
error(org.xml.sax.SAXParseException ex)
Error. |
void |
fatalError(org.xml.sax.SAXParseException ex)
Fatal error. |
int |
findLine(java.lang.String sAttrKey,
java.lang.Object oAttrValue)
Get the first line that contains an attribute with a given value |
Address |
getAddress(int nIndex)
Get Address by index The Address index is the value of ix_address column of k_addresses table |
Address |
getAddress(java.lang.String sType)
Get Address by type The Address type is the value of tp_location column of k_addresses table |
Address[] |
getAddresses()
Get Addresses The Address type is the value of tp_location column of k_addresses table |
java.lang.String |
getCustomer()
Get customer identification |
java.util.HashMap |
getLine(int nLine)
Get order line |
java.lang.Object |
getLineAttribute(int nLine,
java.lang.String sKey)
Get attribute of a given line |
java.math.BigDecimal |
getLineBigDecimal(int nLine,
java.lang.String sKey)
Get attribute of a given line casted to java.math.BigDecimal |
int |
getLineCount()
Count of lines on this basket |
java.util.Date |
getLineDate(int nLine,
java.lang.String sKey)
Get attribute of a given line casted to java.util.Date |
java.lang.Integer |
getLineInteger(int nLine,
java.lang.String sKey)
Get attribute of a given line casted to java.lang.Integer |
java.lang.String |
getLineString(int nLine,
java.lang.String sKey)
Get attribute of a given line casted to String |
java.lang.Object |
getProperty(java.lang.String sKey)
Get a global property of this basket |
void |
parse(java.io.File oXMLData,
java.lang.String sEncoding)
|
void |
parse(java.lang.String sXMLData)
|
void |
putAddress(Address oAddr)
Put an Address into the Shopping basket If a previous Address of same type or index is already present then it is silently replaced. |
void |
removeLine(int nLine)
Remove order line from this basket |
void |
removeProperty(java.lang.String sKey)
Remove a single global property |
void |
setCustomer(java.lang.String sIdCustomer)
Set customer identification Customer Id. can be any arbitrary string that uniquely identifies current customer |
void |
setLineAttribute(int nLine,
java.lang.String sKey,
java.lang.Object oAttr)
Set attribute for a given line |
void |
setLineAttributes(int nLine,
java.lang.String sInputStr,
java.lang.String sDelimiter)
Set attributes for a given line |
void |
setProperties(java.util.Map oPropertiesMap)
Set global properties for this basket |
void |
setProperty(java.lang.String sKey,
java.lang.Object oProperty)
Set global property for this basket |
void |
startDocument()
Start document. |
void |
startElement(java.lang.String uri,
java.lang.String local,
java.lang.String raw,
org.xml.sax.Attributes attrs)
|
java.math.BigDecimal |
sum(java.lang.String sAttrKey)
Get sum of all line attributes of a given name |
void |
warning(org.xml.sax.SAXParseException ex)
Warning. |
| Methods inherited from class org.xml.sax.helpers.DefaultHandler |
|---|
endDocument, endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.xml.sax.ContentHandler |
|---|
endDocument, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startPrefixMapping |
| Field Detail |
|---|
protected static final java.lang.String NAMESPACES_FEATURE_ID
protected static final java.lang.String NAMESPACE_PREFIXES_FEATURE_ID
protected static final java.lang.String VALIDATION_FEATURE_ID
protected static final java.lang.String SCHEMA_VALIDATION_FEATURE_ID
protected static final java.lang.String SCHEMA_FULL_CHECKING_FEATURE_ID
protected static final java.lang.String DYNAMIC_VALIDATION_FEATURE_ID
protected static final java.lang.String DEFAULT_PARSER_NAME
protected static final int DEFAULT_REPETITION
protected static final boolean DEFAULT_NAMESPACES
protected static final boolean DEFAULT_NAMESPACE_PREFIXES
protected static final boolean DEFAULT_VALIDATION
protected static final boolean DEFAULT_SCHEMA_VALIDATION
protected static final boolean DEFAULT_SCHEMA_FULL_CHECKING
protected static final boolean DEFAULT_DYNAMIC_VALIDATION
protected static final boolean DEFAULT_MEMORY_USAGE
protected static final boolean DEFAULT_TAGGINESS
| Constructor Detail |
|---|
public ShoppingBasket()
| Method Detail |
|---|
public Address getAddress(int nIndex)
Get Address by index
The Address index is the value of ix_address column of k_addresses table
public Address getAddress(java.lang.String sType)
Get Address by type
The Address type is the value of tp_location column of k_addresses table
public Address[] getAddresses()
Get Addresses
The Address type is the value of tp_location column of k_addresses table
public int countAddresses()
public void putAddress(Address oAddr)
throws java.lang.NullPointerException
Put an Address into the Shopping basket
If a previous Address of same type or index is already present then it is silently replaced.
java.lang.NullPointerExceptionpublic java.lang.String getCustomer()
public void setCustomer(java.lang.String sIdCustomer)
Set customer identification
Customer Id. can be any arbitrary string that uniquely identifies current customer
sIdCustomer - String uniquely identifying the customer owner of this shopping basketpublic java.lang.Object getProperty(java.lang.String sKey)
sKey - String property name
public boolean containsProperty(java.lang.String sKey)
sKey - String property name
public void setProperty(java.lang.String sKey,
java.lang.Object oProperty)
sKey - String property nameoProperty - Objectpublic void setProperties(java.util.Map oPropertiesMap)
oPropertiesMap - Map containing property names as map keys and property values as map valuespublic void clearProperties()
public void removeProperty(java.lang.String sKey)
sKey - String property namepublic void addLine()
public void addLine(java.util.Map oLine)
Add order line to this basket
Each line has an arbitrary number of named attributes given in the Map passed as parameter
oLine - Map with line attributes
public void addLine(java.lang.String sInputStr,
java.lang.String sDelimiter)
Add order line to this basket
This method adds a line from a string of the form: "attribute1=value1,attribute2=value2,attribute3=value3"
sInputStr - StringsDelimiter - String Delimiter to be used between attribute, in the examle above, a commapublic int getLineCount()
public void removeLine(int nLine)
nLine - int Line number [0..getLineCount()-1)]
public void clearLine(int nLine)
throws java.lang.ArrayIndexOutOfBoundsException
nLine - int Line number [0..getLineCount()-1)]
java.lang.ArrayIndexOutOfBoundsException
public java.util.HashMap getLine(int nLine)
throws java.lang.ArrayIndexOutOfBoundsException
nLine - int Line number [0..getLineCount()-1)]
java.lang.ArrayIndexOutOfBoundsException
public java.lang.Object getLineAttribute(int nLine,
java.lang.String sKey)
throws java.lang.ArrayIndexOutOfBoundsException
nLine - int Line number [0..getLineCount()-1)]sKey - String attribute name
java.lang.ArrayIndexOutOfBoundsException
public java.lang.String getLineString(int nLine,
java.lang.String sKey)
throws java.lang.ArrayIndexOutOfBoundsException,
java.lang.ClassCastException
nLine - int Line number [0..getLineCount()-1)]sKey - String attribute name
java.lang.ArrayIndexOutOfBoundsException
java.lang.ClassCastException
public java.math.BigDecimal getLineBigDecimal(int nLine,
java.lang.String sKey)
throws java.lang.ArrayIndexOutOfBoundsException,
java.lang.ClassCastException
nLine - int Line number [0..getLineCount()-1)]sKey - String attribute name
java.lang.ArrayIndexOutOfBoundsException
java.lang.ClassCastException
public java.util.Date getLineDate(int nLine,
java.lang.String sKey)
throws java.lang.ArrayIndexOutOfBoundsException,
java.lang.ClassCastException
nLine - int Line number [0..getLineCount()-1)]sKey - String attribute name
java.lang.ArrayIndexOutOfBoundsException
java.lang.ClassCastException
public java.lang.Integer getLineInteger(int nLine,
java.lang.String sKey)
throws java.lang.ArrayIndexOutOfBoundsException,
java.lang.ClassCastException
nLine - int Line number [0..getLineCount()-1)]sKey - String attribute name
java.lang.ArrayIndexOutOfBoundsException
java.lang.ClassCastException
public void setLineAttribute(int nLine,
java.lang.String sKey,
java.lang.Object oAttr)
throws java.lang.ArrayIndexOutOfBoundsException
nLine - int Line number [0..getLineCount()-1)]sKey - String attribute nameoAttr - Object attribute value
java.lang.ArrayIndexOutOfBoundsException
public void setLineAttributes(int nLine,
java.lang.String sInputStr,
java.lang.String sDelimiter)
throws java.lang.ArrayIndexOutOfBoundsException
nLine - int Line number [0..getLineCount()-1)]sInputStr - String of the form "attr1=value1,attr2=value2,attr3=value3"sDelimiter - String Delimiter between pairs of attribute=value (comma in the previous example)
java.lang.ArrayIndexOutOfBoundsException
public int findLine(java.lang.String sAttrKey,
java.lang.Object oAttrValue)
sKey - String Attribute keyoAttr - Object Attribute value
public java.math.BigDecimal sum(java.lang.String sAttrKey)
throws java.lang.ClassCastException
Get sum of all line attributes of a given name
sAttrKey - String Atrributes common name
java.lang.ClassCastException - Attribute values must be of type BigDecimal
or else a ClassCastException is raised
public void startDocument()
throws org.xml.sax.SAXException
startDocument in interface org.xml.sax.ContentHandlerstartDocument in class org.xml.sax.helpers.DefaultHandlerorg.xml.sax.SAXException
public void characters(char[] ch,
int start,
int length)
throws org.xml.sax.SAXException
characters in interface org.xml.sax.ContentHandlercharacters in class org.xml.sax.helpers.DefaultHandlerorg.xml.sax.SAXException
public void startElement(java.lang.String uri,
java.lang.String local,
java.lang.String raw,
org.xml.sax.Attributes attrs)
throws org.xml.sax.SAXException
startElement in interface org.xml.sax.ContentHandlerstartElement in class org.xml.sax.helpers.DefaultHandlerorg.xml.sax.SAXException
public void endElement(java.lang.String uri,
java.lang.String local,
java.lang.String qname)
throws org.xml.sax.SAXException
endElement in interface org.xml.sax.ContentHandlerendElement in class org.xml.sax.helpers.DefaultHandlerorg.xml.sax.SAXException
public void warning(org.xml.sax.SAXParseException ex)
throws org.xml.sax.SAXException
warning in interface org.xml.sax.ErrorHandlerwarning in class org.xml.sax.helpers.DefaultHandlerorg.xml.sax.SAXException
public void error(org.xml.sax.SAXParseException ex)
throws org.xml.sax.SAXException
error in interface org.xml.sax.ErrorHandlererror in class org.xml.sax.helpers.DefaultHandlerorg.xml.sax.SAXException
public void fatalError(org.xml.sax.SAXParseException ex)
throws org.xml.sax.SAXException
fatalError in interface org.xml.sax.ErrorHandlerfatalError in class org.xml.sax.helpers.DefaultHandlerorg.xml.sax.SAXException
protected java.lang.String composeError(java.lang.String type,
org.xml.sax.SAXParseException ex)
public void parse(java.io.File oXMLData,
java.lang.String sEncoding)
throws java.lang.InstantiationException,
java.lang.IllegalAccessException,
java.lang.ClassNotFoundException,
java.io.IOException,
org.xml.sax.SAXException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.ClassNotFoundException
java.io.IOException
org.xml.sax.SAXException
public void parse(java.lang.String sXMLData)
throws java.lang.InstantiationException,
java.lang.IllegalAccessException,
java.lang.ClassNotFoundException,
java.io.IOException,
org.xml.sax.SAXException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.ClassNotFoundException
java.io.IOException
org.xml.sax.SAXException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||