Class EPPValidateAddress
- java.lang.Object
-
- com.verisign.epp.codec.validate.v02.EPPValidateAddress
-
- All Implemented Interfaces:
EPPCodecComponent,java.io.Serializable,java.lang.Cloneable
public class EPPValidateAddress extends java.lang.Object implements EPPCodecComponent
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:
- 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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringELM_LOCALNAMEXML local name forEPPValidateAddress.static java.lang.StringELM_NAMEXML root tag forEPPValidatePostalDefinition.
-
Constructor Summary
Constructors Constructor Description EPPValidateAddress()Default constructor forEPPValidateAddress.EPPValidateAddress(java.lang.String aCity, java.lang.String aCountry)Constructor forEPPValidateAddressall of the required attributes as parameters.EPPValidateAddress(java.util.List<java.lang.String> aStreets, java.lang.String aCity, java.lang.String aStateProvince, java.lang.String aPostalCode, java.lang.String aCountry)Constructor forEPPValidateAddressall of the attributes as parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddStreet(java.lang.String aStreetLine)Add a street line to the street.java.lang.Objectclone()CloneEPPValidateAddress.voiddecode(org.w3c.dom.Element aElement)Decode theEPPValidateAddressattributes from the aElement DOM Element tree.org.w3c.dom.Elementencode(org.w3c.dom.Document aDocument)Encode a DOM Element tree from the attributes of theEPPValidateAddressinstance.booleanequals(java.lang.Object aObject)implements a deepEPPValidateAddresscompare.java.lang.StringgetCity()Gets the contact city.java.lang.StringgetCountry()Gets the contact country.java.lang.StringgetNamespace()Returns the XML namespace associated with theEPPCodecComponent.java.lang.StringgetPostalCode()Gets the contact postal codejava.lang.StringgetStateProvince()Gets the contact state/province.java.util.List<java.lang.String>getStreets()Gets the contact street(s).booleanhasStreets()Is there any street lines set?voidsetCity(java.lang.String aCity)Sets the contact city.voidsetCountry(java.lang.String aCountry)Sets the contact country.voidsetPostalCode(java.lang.String aPostalCode)Sets the contact postal codevoidsetStateProvince(java.lang.String aStateProvince)Sets the contact state/province.voidsetStreet(java.lang.String aStreet)Sets the contact streets with only one line.voidsetStreets(java.lang.String aStreet1, java.lang.String aStreet2)Sets the contact street with two street lines.voidsetStreets(java.lang.String aStreet1, java.lang.String aStreet2, java.lang.String aStreet3)Sets the contact street with three street lines.voidsetStreets(java.util.List<java.lang.String> aStreets)Sets the contact streets attribute with aList>String>, where each element represents a line of the street address.java.lang.StringtoString()Implementation ofObject.toString, which will result in an indented XMLStringrepresentation of the concreteEPPCodecComponent.
-
-
-
Field Detail
-
ELM_LOCALNAME
public static final java.lang.String ELM_LOCALNAME
XML local name forEPPValidateAddress.- See Also:
- Constant Field Values
-
ELM_NAME
public static final java.lang.String ELM_NAME
XML root tag forEPPValidatePostalDefinition.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
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
public EPPValidateAddress(java.lang.String aCity, java.lang.String aCountry)Constructor forEPPValidateAddressall of the required attributes as parameters.- Parameters:
aCity- Contact streetaCountry- Contact country
-
EPPValidateAddress
public EPPValidateAddress(java.util.List<java.lang.String> aStreets, java.lang.String aCity, java.lang.String aStateProvince, java.lang.String aPostalCode, java.lang.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 Detail
-
hasStreets
public boolean hasStreets()
Is there any street lines set?- Returns:
trueif there is at least one street line set.
-
addStreet
public void addStreet(java.lang.String aStreetLine)
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
public java.util.List<java.lang.String> getStreets()
Gets the contact street(s).- Returns:
- street(s) as a
List<String>of streets (up to maximum three).
-
setStreets
public void setStreets(java.util.List<java.lang.String> aStreets)
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
public void setStreet(java.lang.String aStreet)
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
public void setStreets(java.lang.String aStreet1, java.lang.String aStreet2)Sets the contact street with two street lines.- Parameters:
aStreet1- First street lineaStreet2- Second street line
-
setStreets
public void setStreets(java.lang.String aStreet1, java.lang.String aStreet2, java.lang.String aStreet3)Sets the contact street with three street lines.- Parameters:
aStreet1- First street lineaStreet2- Second street lineaStreet3- Third street line
-
getCity
public java.lang.String getCity()
Gets the contact city.- Returns:
- city.
Stringif defined;nullotherwise.
-
setCity
public void setCity(java.lang.String aCity)
Sets the contact city.- Parameters:
aCity- contact city
-
getStateProvince
public java.lang.String getStateProvince()
Gets the contact state/province.- Returns:
- state/province.
Stringif defined;nullotherwise.
-
setStateProvince
public void setStateProvince(java.lang.String aStateProvince)
Sets the contact state/province.- Parameters:
aStateProvince- contact state/province
-
getPostalCode
public java.lang.String getPostalCode()
Gets the contact postal code- Returns:
- postal code
Stringif defined;nullotherwise.
-
setPostalCode
public void setPostalCode(java.lang.String aPostalCode)
Sets the contact postal code- Parameters:
aPostalCode- contact postal code
-
getCountry
public java.lang.String getCountry()
Gets the contact country.- Returns:
- contact country
Stringif defined;nullotherwise.
-
setCountry
public void setCountry(java.lang.String aCountry)
Sets the contact country.- Parameters:
aCountry- contact country
-
encode
public org.w3c.dom.Element encode(org.w3c.dom.Document aDocument) throws EPPEncodeExceptionEncode 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
public void decode(org.w3c.dom.Element aElement) throws EPPDecodeExceptionDecode 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
public boolean equals(java.lang.Object aObject)
implements a deepEPPValidateAddresscompare.- Overrides:
equalsin classjava.lang.Object- Parameters:
aObject-EPPValidateAddressinstance to compare with- Returns:
trueofaObjectis equal to instance;falseotherwise.
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedExceptionCloneEPPValidateAddress.- Specified by:
clonein interfaceEPPCodecComponent- Overrides:
clonein classjava.lang.Object- Returns:
- clone of
EPPValidateAddress - Throws:
java.lang.CloneNotSupportedException- standard Object.clone exception
-
toString
public java.lang.String toString()
Implementation ofObject.toString, which will result in an indented XMLStringrepresentation of the concreteEPPCodecComponent.- Overrides:
toStringin classjava.lang.Object- Returns:
- Indented XML
Stringif successful;ERRORotherwise.
-
getNamespace
public java.lang.String getNamespace()
Returns the XML namespace associated with theEPPCodecComponent.- Specified by:
getNamespacein interfaceEPPCodecComponent- Returns:
- XML namespace for the
EPPCodecComponent.
-
-