OpMath

com.opmath.test.dmldoc
Class Address

java.lang.Object
  |
  +--com.opmath.test.dmldoc.Address

public class Address
extends Object

The form object for the address form. This class provides a server-side represenation of the address form, as completed by each user. 'Form Object' is a prototypical pattern.

Copyright: (c) 2002 The Open Math Company Limited

The Terms of Distribution of this software are stipulated in the javadoc Overview for this project.

Since:
J2SE 1.3.1, Java Servlet 2.3
Version:
expdmldoc-v011
Author:
Bruno Beloff bruno.beloff@opmath.com

Constructor Summary
Address(HttpServletRequest req)
          Constructs a new address form object for a given HTTP request.
 
Method Summary
 String getAddr1()
          Returns the address line 1 field ('addr1') for the address form.
 String getAddr2()
          Returns the address line 2 field ('addr2') for the address form.
 String getCountry()
          Returns the post country field ('country') for the address form.
 String getFamily()
          Returns the family name field ('family') for the address form.
 String getFunc()
          Returns the address use field ('func') for the address form.
 String getGiven()
          Returns the given name field ('given') for the address form.
 String getPostcode()
          Returns the post code / ZIP field ('postcode') for the address form.
 String getRegion()
          Returns the region field ('region') for the address form.
 String getSal()
          Returns the salutation field ('sal') for the address form.
 String getTown()
          Returns the town field ('town') for the address form.
 boolean isValid()
          Returns true iff all of the obligatory fields of the form contain some text.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Address

public Address(HttpServletRequest req)

Constructs a new address form object for a given HTTP request. This address form object allows read access to all fields, and indicates the validity of the form data.

Parameters:
req - a com.opmath.util.http.HttpServletRequest containing the field name / value pairs.
Method Detail

getSal

public String getSal()

Returns the salutation field ('sal') for the address form. If the field was not supplied, or had no value, then the empty String "" is returned. This is not treated as an obligatory field.

Returns:
a String containing the value of the 'sal' field value.

getGiven

public String getGiven()

Returns the given name field ('given') for the address form. If the field was not supplied, or had no value, then the empty String "" is returned. This is treated as an obligatory field.

Returns:
a String containing the value of the 'given' field value.

getFamily

public String getFamily()

Returns the family name field ('family') for the address form. If the field was not supplied, or had no value, then the empty String "" is returned. This is treated as an obligatory field.

Returns:
a String containing the value of the 'family' field value.

getAddr1

public String getAddr1()

Returns the address line 1 field ('addr1') for the address form. If the field was not supplied, or had no value, then the empty String "" is returned. This is treated as an obligatory field.

Returns:
a String containing the value of the 'addr1' field value.

getAddr2

public String getAddr2()

Returns the address line 2 field ('addr2') for the address form. If the field was not supplied, or had no value, then the empty String "" is returned. This is not treated as an obligatory field.

Returns:
a String containing the value of the 'addr2' field value.

getTown

public String getTown()

Returns the town field ('town') for the address form. If the field was not supplied, or had no value, then the empty String "" is returned. This is treated as an obligatory field.

Returns:
a String containing the value of the 'town' field value.

getRegion

public String getRegion()

Returns the region field ('region') for the address form. If the field was not supplied, or had no value, then the empty String "" is returned. This is treated as an obligatory field.

Returns:
a String containing the value of the 'region' field value.

getPostcode

public String getPostcode()

Returns the post code / ZIP field ('postcode') for the address form. If the field was not supplied, or had no value, then the empty String "" is returned. This is treated as an obligatory field.

Returns:
a String containing the value of the 'postcode' field value.

getCountry

public String getCountry()

Returns the post country field ('country') for the address form. If the field was not supplied, or had no value, then the empty String "" is returned. This is treated as an obligatory field.

Returns:
a String containing the value of the 'country' field value.

getFunc

public String getFunc()

Returns the address use field ('func') for the address form. If the field was not supplied, or had no value, then the empty String "" is returned. This is treated as an obligatory field.

Returns:
a String containing the value of the 'func' field value.

isValid

public boolean isValid()

Returns true iff all of the obligatory fields of the form contain some text.

Returns:
a boolean indicating the validity of the form.

OpMath

Submit a bug or feature to Open Math
Copyright © 2002 Open Math Company Limited, Brighton, UK