com.jp.protection.priv.pro.parser.text
Class TextOrderParser
java.lang.Object
com.jp.protection.priv.pro.parser.OrderParser
com.jp.protection.priv.pro.parser.text.TextOrderParser
- All Implemented Interfaces:
- java.io.Serializable
public class TextOrderParser
- extends OrderParser
- implements java.io.Serializable
- See Also:
- Serialized Form
Fields inherited from class com.jp.protection.priv.pro.parser.OrderParser |
fOrderParserListenerSupport, fStopped, PROPERTY_CUSTOMER, PROPERTY_CUSTOMER_ADDRESS, PROPERTY_CUSTOMER_CITY, PROPERTY_CUSTOMER_COMPANY, PROPERTY_CUSTOMER_COUNTRY, PROPERTY_CUSTOMER_EMAIL, PROPERTY_CUSTOMER_FIRST_NAME, PROPERTY_CUSTOMER_LAST_NAME, PROPERTY_CUSTOMER_PHONE, PROPERTY_CUSTOMER_STATE, PROPERTY_CUSTOMER_TITLE, PROPERTY_CUSTOMER_ZIP, PROPERTY_LICENSE, PROPERTY_LICENSE_NUMBER, PROPERTY_LICENSE_NUMBER_COPIES, PROPERTY_ORDER, PROPERTY_ORDER_NET_SALES, PROPERTY_ORDER_PAYMENT_TYPE, PROPERTY_ORDER_TOTAL_SALES, PROPERTY_PRODUCT, PROPERTY_PRODUCT_ALIAS |
Methods inherited from class com.jp.protection.priv.pro.parser.OrderParser |
addOrderParserListener, fireError, fireParseFinished, fireParseStarted, firePropertyRead, getCustomerPropertyName, getLicensePropertyName, getProductPropertyName, isCustomerProperty, isLicenseProperty, isProductProperty, isStopped, removeOrderParserListener, stop |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
fSupportedFormatTag
protected java.lang.String fSupportedFormatTag
fPropertyInfoMap
protected java.util.HashMap fPropertyInfoMap
STATE_MAP
static final java.util.Map STATE_MAP
FORMAT_TAG_GENERIC
public static final java.lang.String FORMAT_TAG_GENERIC
- See Also:
- Constant Field Values
TextOrderParser
public TextOrderParser(java.lang.String aSupportedFormatTag)
TextOrderParser
public TextOrderParser()
getSupportedFormatTag
public java.lang.String getSupportedFormatTag()
setSupportedFormatTag
public void setSupportedFormatTag(java.lang.String aSupportedFormatTag)
getPropertyInfoMap
public java.util.HashMap getPropertyInfoMap()
setPropertyInfoMap
public void setPropertyInfoMap(java.util.HashMap aPropertyInfoMap)
addPropertyInfo
public void addPropertyInfo(TextOrderParser.PropertyInfo aPropertyInfo)
getPropertyInfo
public TextOrderParser.PropertyInfo getPropertyInfo(java.lang.String aTag)
isSupportedFormat
public boolean isSupportedFormat(java.io.InputStream anInputStream)
- Description copied from class:
OrderParser
- Tests whether this parser supports format of the passed order
- Specified by:
isSupportedFormat
in class OrderParser
- Parameters:
anInputStream
- input stream containing an order to test
- Returns:
true
if this parser is capable of passed order parsing; false
otherwise.
onPropertyRead
protected void onPropertyRead(java.util.Set aReadPropertySet,
TextOrderParser.PropertyInfo aPropertyInfo,
java.lang.String aValue,
int aLine,
int aColumn)
parse
public void parse(java.io.InputStream anInputStream)
- Description copied from class:
OrderParser
Parses passed order. Actual implementation of the method should:
-
Notify interested parties about process start by calling
fireParseStarted(...)
method;
-
Read order properties from the input stream and notify interested parties
about each property which has been read by calling
firePropertyRead(...)
method. For any errors occurred during
order parsing the fireError(...)
method should be called to let
interested parties log errors. Note it is strongly recommended to support
reading all the properties with names starting with
PROPERTY_PRODUCT_
, PROPERTY_CUSTOMER_
and
PROPERTY_LICENSE_
;
-
Notify interested parties about process finish by calling
fireParseFinished(...)
method;
- Specified by:
parse
in class OrderParser
- Parameters:
anInputStream
- input stream containing an order to parse
fixCountry
protected java.lang.String fixCountry(java.lang.String aTag,
java.lang.String aValue)
fixState
protected java.lang.String fixState(java.lang.String aTag,
java.lang.String aValue)
checkForMandatoryProperties
protected void checkForMandatoryProperties(java.util.Set aReadPropertySet)