Class EPPValidateAddress
java.lang.Object
com.verisign.epp.codec.validate.v02.EPPValidateAddress
- All Implemented Interfaces:
EPPCodecComponent,Serializable,Cloneable
Represents a contact address. Every contact has associated postal address
information. A postal address contains OPTIONAL street information, city
information, OPTIONAL state/province information, an OPTIONAL postal code,
and a country identifier as described in [ISO11180]. Address information MAY
be provided in both a subset of UTF-8 [RFC2279] that can be represented in
7-bit ASCII [US-ASCII] and unrestricted UTF-8. A contact address is defined
as the following:
A <validate:addr> element that contains address information associated with the contact. A <validate:addr> element contains the following child elements:
A <validate:addr> element that contains address information associated with the contact. A <validate:addr> element contains the following child elements:
- OPTIONAL <validate:street> elements (up to a maximum of three) that
contain the contact's street address. Use
getStreets()andsetStreets(List)to get and set the elements. - A <validate:city> element that contains the contact's city. Use
getCity()andsetCity(String)to get and set the element. - A <validate:sp> element that contains the contact's state or
province. This element is OPTIONAL for addressing schemes that do not require
a state or province name. Use
getStateProvince()andsetStateProvince(String)to get and set the element. - An OPTIONAL <validate:pc> element that contains the contact's
postal code. Use
getPostalCode()andsetPostalCode(String)to get and set the element. - A <validate:cc> element that contains the two-character identifier
representing with the contact's country. Use
getCountry()andsetCountry(String)to get and set the element.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor forEPPValidateAddress.EPPValidateAddress(String aCity, String aCountry) Constructor forEPPValidateAddressall of the required attributes as parameters.EPPValidateAddress(List<String> aStreets, String aCity, String aStateProvince, String aPostalCode, String aCountry) Constructor forEPPValidateAddressall of the attributes as parameters. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a street line to the street.clone()CloneEPPValidateAddress.voidDecode theEPPValidateAddressattributes from the aElement DOM Element tree.Encode a DOM Element tree from the attributes of theEPPValidateAddressinstance.booleanimplements a deepEPPValidateAddresscompare.getCity()Gets the contact city.Gets the contact country.Returns the XML namespace associated with theEPPCodecComponent.Gets the contact postal codeGets the contact state/province.Gets the contact street(s).booleanIs there any street lines set?voidSets the contact city.voidsetCountry(String aCountry) Sets the contact country.voidsetPostalCode(String aPostalCode) Sets the contact postal codevoidsetStateProvince(String aStateProvince) Sets the contact state/province.voidSets the contact streets with only one line.voidsetStreets(String aStreet1, String aStreet2) Sets the contact street with two street lines.voidsetStreets(String aStreet1, String aStreet2, String aStreet3) Sets the contact street with three street lines.voidsetStreets(List<String> aStreets) Sets the contact streets attribute with aList>String>, where each element represents a line of the street address.toString()Implementation ofObject.toString, which will result in an indented XMLStringrepresentation of the concreteEPPCodecComponent.
-
Field Details
-
ELM_LOCALNAME
XML local name forEPPValidateAddress.- See Also:
-
ELM_NAME
XML root tag forEPPValidatePostalDefinition.- See Also:
-
-
Constructor Details
-
EPPValidateAddress
public EPPValidateAddress()Default constructor forEPPValidateAddress. All the the attributes default tonull. Must call required setter methods before invokingencode(Document), which include:
- City -
setCity(String) - Country -
setCountry(String)
- City -
-
EPPValidateAddress
Constructor forEPPValidateAddressall of the required attributes as parameters.- Parameters:
aCity- Contact streetaCountry- Contact country
-
EPPValidateAddress
public EPPValidateAddress(List<String> aStreets, String aCity, String aStateProvince, String aPostalCode, String aCountry) Constructor forEPPValidateAddressall of the attributes as parameters.- Parameters:
aStreets-List<String>collection of streets (up to maximum three)aCity- Contact streetaStateProvince- Contact state/provinceaPostalCode- Contact postal codeaCountry- Contact country
-
-
Method Details
-
hasStreets
public boolean hasStreets()Is there any street lines set?- Returns:
trueif there is at least one street line set.
-
addStreet
Add a street line to the street. This will addaStreetLineto the list of street lines.- Parameters:
aStreetLine- Street line to add to the street
-
getStreets
Gets the contact street(s).- Returns:
- street(s) as a
List<String>of streets (up to maximum three).
-
setStreets
Sets the contact streets attribute with aList>String>, where each element represents a line of the street address.- Parameters:
aStreets- Up to 3 street elements
-
setStreet
Sets the contact streets with only one line. Only a one elementList<String>will be returned on a call togetStreets()after calling this method.- Parameters:
aStreet- Contact street.
-
setStreets
Sets the contact street with two street lines.- Parameters:
aStreet1- First street lineaStreet2- Second street line
-
setStreets
Sets the contact street with three street lines.- Parameters:
aStreet1- First street lineaStreet2- Second street lineaStreet3- Third street line
-
getCity
Gets the contact city.- Returns:
- city.
Stringif defined;nullotherwise.
-
setCity
Sets the contact city.- Parameters:
aCity- contact city
-
getStateProvince
Gets the contact state/province.- Returns:
- state/province.
Stringif defined;nullotherwise.
-
setStateProvince
Sets the contact state/province.- Parameters:
aStateProvince- contact state/province
-
getPostalCode
Gets the contact postal code- Returns:
- postal code
Stringif defined;nullotherwise.
-
setPostalCode
Sets the contact postal code- Parameters:
aPostalCode- contact postal code
-
getCountry
Gets the contact country.- Returns:
- contact country
Stringif defined;nullotherwise.
-
setCountry
Sets the contact country.- Parameters:
aCountry- contact country
-
encode
Encode a DOM Element tree from the attributes of theEPPValidateAddressinstance.- Specified by:
encodein interfaceEPPCodecComponent- Parameters:
aDocument- DOM Document that is being built. Used as an Element factory.- Returns:
- Root DOM Element representing the
EPPValidateAddressinstance. - Throws:
EPPEncodeException- Unable to encodeEPPValidateAddressinstance.
-
decode
Decode theEPPValidateAddressattributes from the aElement DOM Element tree.- Specified by:
decodein interfaceEPPCodecComponent- Parameters:
aElement- Root DOM Element to decodeEPPValidateAddressfrom.- Throws:
EPPDecodeException- Unable to decode aElement.
-
equals
implements a deepEPPValidateAddresscompare. -
clone
CloneEPPValidateAddress.- Specified by:
clonein interfaceEPPCodecComponent- Overrides:
clonein classObject- Returns:
- clone of
EPPValidateAddress - Throws:
CloneNotSupportedException- standard Object.clone exception
-
toString
Implementation ofObject.toString, which will result in an indented XMLStringrepresentation of the concreteEPPCodecComponent. -
getNamespace
Returns the XML namespace associated with theEPPCodecComponent.- Specified by:
getNamespacein interfaceEPPCodecComponent- Returns:
- XML namespace for the
EPPCodecComponent.
-