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.String
ELM_LOCALNAME
XML local name forEPPValidateAddress
.static java.lang.String
ELM_NAME
XML root tag forEPPValidatePostalDefinition
.
-
Constructor Summary
Constructors Constructor Description EPPValidateAddress()
Default constructor forEPPValidateAddress
.EPPValidateAddress(java.lang.String aCity, java.lang.String aCountry)
Constructor forEPPValidateAddress
all 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 forEPPValidateAddress
all of the attributes as parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addStreet(java.lang.String aStreetLine)
Add a street line to the street.java.lang.Object
clone()
CloneEPPValidateAddress
.void
decode(org.w3c.dom.Element aElement)
Decode theEPPValidateAddress
attributes from the aElement DOM Element tree.org.w3c.dom.Element
encode(org.w3c.dom.Document aDocument)
Encode a DOM Element tree from the attributes of theEPPValidateAddress
instance.boolean
equals(java.lang.Object aObject)
implements a deepEPPValidateAddress
compare.java.lang.String
getCity()
Gets the contact city.java.lang.String
getCountry()
Gets the contact country.java.lang.String
getNamespace()
Returns the XML namespace associated with theEPPCodecComponent
.java.lang.String
getPostalCode()
Gets the contact postal codejava.lang.String
getStateProvince()
Gets the contact state/province.java.util.List<java.lang.String>
getStreets()
Gets the contact street(s).boolean
hasStreets()
Is there any street lines set?void
setCity(java.lang.String aCity)
Sets the contact city.void
setCountry(java.lang.String aCountry)
Sets the contact country.void
setPostalCode(java.lang.String aPostalCode)
Sets the contact postal codevoid
setStateProvince(java.lang.String aStateProvince)
Sets the contact state/province.void
setStreet(java.lang.String aStreet)
Sets the contact streets with only one line.void
setStreets(java.lang.String aStreet1, java.lang.String aStreet2)
Sets the contact street with two street lines.void
setStreets(java.lang.String aStreet1, java.lang.String aStreet2, java.lang.String aStreet3)
Sets the contact street with three street lines.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.java.lang.String
toString()
Implementation ofObject.toString
, which will result in an indented XMLString
representation 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 forEPPValidateAddress
all 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 forEPPValidateAddress
all 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:
true
if 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 addaStreetLine
to 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.
String
if defined;null
otherwise.
-
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.
String
if defined;null
otherwise.
-
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
String
if defined;null
otherwise.
-
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
String
if defined;null
otherwise.
-
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 EPPEncodeException
Encode a DOM Element tree from the attributes of theEPPValidateAddress
instance.- Specified by:
encode
in interfaceEPPCodecComponent
- Parameters:
aDocument
- DOM Document that is being built. Used as an Element factory.- Returns:
- Root DOM Element representing the
EPPValidateAddress
instance. - Throws:
EPPEncodeException
- Unable to encodeEPPValidateAddress
instance.
-
decode
public void decode(org.w3c.dom.Element aElement) throws EPPDecodeException
Decode theEPPValidateAddress
attributes from the aElement DOM Element tree.- Specified by:
decode
in interfaceEPPCodecComponent
- Parameters:
aElement
- Root DOM Element to decodeEPPValidateAddress
from.- Throws:
EPPDecodeException
- Unable to decode aElement.
-
equals
public boolean equals(java.lang.Object aObject)
implements a deepEPPValidateAddress
compare.- Overrides:
equals
in classjava.lang.Object
- Parameters:
aObject
-EPPValidateAddress
instance to compare with- Returns:
true
ofaObject
is equal to instance;false
otherwise.
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
CloneEPPValidateAddress
.- Specified by:
clone
in interfaceEPPCodecComponent
- Overrides:
clone
in 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 XMLString
representation of the concreteEPPCodecComponent
.- Overrides:
toString
in classjava.lang.Object
- Returns:
- Indented XML
String
if successful;ERROR
otherwise.
-
getNamespace
public java.lang.String getNamespace()
Returns the XML namespace associated with theEPPCodecComponent
.- Specified by:
getNamespace
in interfaceEPPCodecComponent
- Returns:
- XML namespace for the
EPPCodecComponent
.
-
-