|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface BusinessObjectUtils
Interface for a utility object containing various methods used by
BusinessProcessors in performing business logic.
Each BusinessProcessors is able to retrieve an instance of
BusinessObjectUtils by calling its utils method.
The default "businessObjectUtilsImplementer" is
BusinessObjectUtilsImpl.
| Method Summary | |
|---|---|
java.util.Map |
buildOrderItemAttributeMap(OrderItem oi)
From a given OrderItem, returns a Map of each of the OrderItemAttributes under it, keyed by the attributeCode. |
boolean |
doesOrderItemHaveAttributeCode(OrderItem oi,
java.lang.String attributeCode)
Tests to see if a given order item has an OrderItemAttribute under it with the given attributeCode. |
java.lang.String |
formatDateTime(java.util.Date dateTime)
Formats a Date object into a string suitable for storage in the database. |
java.lang.String |
formatPrice(double rawPrice,
java.lang.String currencyCode,
java.util.Locale locale)
Formats a double into a string suitable for displaying the double as a price. |
java.lang.String |
formatPrice(java.lang.Double rawPrice,
java.lang.String currencyCode,
java.util.Locale locale)
Formats a Double into a string suitable for displaying the double as a price, or a price representing 0 if the Double is null. |
java.util.Collection |
getMapsFromBeans(java.util.Collection beans)
Given a collection of bean objects returns a collection of Maps describing each bean's properties. |
org.w3c.dom.Document |
parse(java.io.InputStream xmlStream,
boolean ignoreWhitespace)
Returns a DOM Level2 document that represents the given document. |
java.util.Date |
parseDateTime(java.lang.String dateTime)
Parses a string (typically taken from a database query) into a Date object. |
org.w3c.dom.Node |
parsePartialDocument(java.lang.String xml)
Parses a section of XML and returns the first Element node found |
java.util.Map |
parseResponseData(java.lang.String response)
Parses a query string of name value pairs into a Map. |
java.lang.String |
prepareRequestData(java.util.Map params,
boolean urlEncode)
Prepares a string, which may optionally be url-encoded, for use with an HTTP request, given a map of the request's parameters. |
java.lang.Double |
roundForMoney(double value)
Rounds money values in general |
java.lang.Double |
roundForMoney(java.lang.Double value)
Rounds money values in general |
java.lang.String |
sendHTTPPost(java.lang.String urlString,
java.lang.String postData,
boolean followRedirect)
Sends an HTTP request using the POST method to a given URL. |
boolean |
stringArrayValuesGreaterThan(java.lang.String[] paramValues,
int value)
Determines if at least one element in a string array is greater than a given value. |
| Method Detail |
|---|
java.lang.String formatDateTime(java.util.Date dateTime)
dateTime -
java.util.Date parseDateTime(java.lang.String dateTime)
dateTime -
java.lang.String formatPrice(java.lang.Double rawPrice,
java.lang.String currencyCode,
java.util.Locale locale)
rawPrice - currencyCode - locale -
java.lang.String formatPrice(double rawPrice,
java.lang.String currencyCode,
java.util.Locale locale)
rawPrice - currencyCode - locale -
java.lang.String prepareRequestData(java.util.Map params,
boolean urlEncode)
throws java.lang.Exception
params - A Map of key-value String pairs representing the parameters of
the request.urlEncode - If true, the keys and values in the string will be
url-encoded.
java.lang.Exception
java.util.Map parseResponseData(java.lang.String response)
throws java.lang.Exception
response - A String key-value pairs in the form of a URL query string
java.lang.Exception
java.lang.String sendHTTPPost(java.lang.String urlString,
java.lang.String postData,
boolean followRedirect)
throws java.lang.Exception
urlString - The URL to send the request to.postData - A String representing a valid URL-encoded query string.followRedirect - A boolean indicating whether redirects should be followed.
java.lang.Exceptionjava.util.Collection getMapsFromBeans(java.util.Collection beans)
Maps describing each bean's properties.
beans -
Collection of Maps describing the
beans.
org.w3c.dom.Document parse(java.io.InputStream xmlStream,
boolean ignoreWhitespace)
throws javax.xml.parsers.ParserConfigurationException,
org.xml.sax.SAXException,
java.io.IOException
xmlStream - An InputStream that is the source of the XML dataignoreWhitespace - This is passed through to the DocumentBuilder.
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.io.IOException
org.w3c.dom.Node parsePartialDocument(java.lang.String xml)
throws javax.xml.parsers.ParserConfigurationException,
org.xml.sax.SAXException,
java.io.IOException
xml - The XML to be parsed in String form
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.io.IOException
boolean stringArrayValuesGreaterThan(java.lang.String[] paramValues,
int value)
paramValues - The string array being tested.value - The value for the string array's elements to be tested
against.
true if at least one element in a string array is
greater than a given value. false if not.java.lang.Double roundForMoney(java.lang.Double value)
value - The value to be rounded.
java.lang.Double roundForMoney(double value)
value - The value to be rounded.
java.util.Map buildOrderItemAttributeMap(OrderItem oi)
oi -
boolean doesOrderItemHaveAttributeCode(OrderItem oi,
java.lang.String attributeCode)
oi - The order itemattributeCode - The attribute code
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||