Package com.verisign.epp.codec.org
Class EPPOrgAddress
- java.lang.Object
-
- com.verisign.epp.codec.org.EPPOrgAddress
-
- All Implemented Interfaces:
EPPCodecComponent
,java.io.Serializable
,java.lang.Cloneable
public class EPPOrgAddress extends java.lang.Object implements EPPCodecComponent
Represents a org address. Every org 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 org address is defined as the following:
A <org:addr> element that contains address information associated with the org. A <org:addr> element contains the following child elements:
- OPTIONAL <org:street> elements (up to a maximum of three) that
contain the org's street address. Use
getStreets()
andsetStreets(List)
to get and set the elements. - A <org:city> element that contains the org's city. Use
getCity()
andsetCity(String)
to get and set the element. - A <org:sp> element that contains the org'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 <org:pc> element that contains the org's postal code.
Use
getPostalCode()
andsetPostalCode(String)
to get and set the element. - A <org:cc> element that contains the two-character identifier
representing with the org'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 forEPPOrgDisclose
.static java.lang.String
ELM_NAME
XML root tag forEPPOrgPostalDefinition
.
-
Constructor Summary
Constructors Constructor Description EPPOrgAddress()
Default constructor forEPPOrgAddress
.EPPOrgAddress(java.lang.String aCity, java.lang.String aCountry)
Constructor forEPPOrgAddress
all of the required attributes as parameters.EPPOrgAddress(java.util.List<java.lang.String> aStreets, java.lang.String aCity, java.lang.String aStateProvince, java.lang.String aPostalCode, java.lang.String aCountry)
Constructor forEPPOrgAddress
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()
CloneEPPOrgAddress
.void
decode(org.w3c.dom.Element aElement)
Decode theEPPOrgAddress
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 theEPPOrgAddress
instance.boolean
equals(java.lang.Object aObject)
implements a deepEPPOrgAddress
compare.java.lang.String
getCity()
Gets the org city.java.lang.String
getCountry()
Gets the org country.java.lang.String
getNamespace()
Returns the XML namespace associated with theEPPCodecComponent
.java.lang.String
getPostalCode()
Gets the org postal codejava.lang.String
getStateProvince()
Gets the org state/province.java.util.List<java.lang.String>
getStreets()
Gets the org street(s).boolean
hasStreets()
Is there any street lines set?void
setCity(java.lang.String aCity)
Sets the org city.void
setCountry(java.lang.String aCountry)
Sets the org country.void
setPostalCode(java.lang.String aPostalCode)
Sets the org postal codevoid
setStateProvince(java.lang.String aStateProvince)
Sets the org state/province.void
setStreet(java.lang.String aStreet)
Sets the org streets with only one line.void
setStreets(java.lang.String aStreet1, java.lang.String aStreet2)
Sets the org street with two street lines.void
setStreets(java.lang.String aStreet1, java.lang.String aStreet2, java.lang.String aStreet3)
Sets the org street with three street lines.void
setStreets(java.util.List<java.lang.String> aStreets)
Sets the org 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 forEPPOrgDisclose
.- See Also:
- Constant Field Values
-
ELM_NAME
public static final java.lang.String ELM_NAME
XML root tag forEPPOrgPostalDefinition
.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
EPPOrgAddress
public EPPOrgAddress()
Default constructor forEPPOrgAddress
. All the the attributes default tonull
. Must call required setter methods before invokingencode(Document)
, which include:
- City -
setCity(String)
- Country -
setCountry(String)
- City -
-
EPPOrgAddress
public EPPOrgAddress(java.lang.String aCity, java.lang.String aCountry)
Constructor forEPPOrgAddress
all of the required attributes as parameters.- Parameters:
aCity
- Org streetaCountry
- Org country
-
EPPOrgAddress
public EPPOrgAddress(java.util.List<java.lang.String> aStreets, java.lang.String aCity, java.lang.String aStateProvince, java.lang.String aPostalCode, java.lang.String aCountry)
Constructor forEPPOrgAddress
all of the attributes as parameters.- Parameters:
aStreets
-List<String>
collection of streets (up to maximum three)aCity
- Org streetaStateProvince
- Org state/provinceaPostalCode
- Org postal codeaCountry
- Org 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 org 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 org 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 org streets with only one line. Only a one elementList<String>
will be returned on a call togetStreets()
after calling this method.- Parameters:
aStreet
- Org street.
-
setStreets
public void setStreets(java.lang.String aStreet1, java.lang.String aStreet2)
Sets the org 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 org street with three street lines.- Parameters:
aStreet1
- First street lineaStreet2
- Second street lineaStreet3
- Third street line
-
getCity
public java.lang.String getCity()
Gets the org city.- Returns:
- city.
String
if defined;null
otherwise.
-
setCity
public void setCity(java.lang.String aCity)
Sets the org city.- Parameters:
aCity
- org city
-
getStateProvince
public java.lang.String getStateProvince()
Gets the org state/province.- Returns:
- state/province.
String
if defined;null
otherwise.
-
setStateProvince
public void setStateProvince(java.lang.String aStateProvince)
Sets the org state/province.- Parameters:
aStateProvince
- org state/province
-
getPostalCode
public java.lang.String getPostalCode()
Gets the org postal code- Returns:
- postal code
String
if defined;null
otherwise.
-
setPostalCode
public void setPostalCode(java.lang.String aPostalCode)
Sets the org postal code- Parameters:
aPostalCode
- org postal code
-
getCountry
public java.lang.String getCountry()
Gets the org country.- Returns:
- org country
String
if defined;null
otherwise.
-
setCountry
public void setCountry(java.lang.String aCountry)
Sets the org country.- Parameters:
aCountry
- org country
-
encode
public org.w3c.dom.Element encode(org.w3c.dom.Document aDocument) throws EPPEncodeException
Encode a DOM Element tree from the attributes of theEPPOrgAddress
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
EPPOrgAddress
instance. - Throws:
EPPEncodeException
- Unable to encodeEPPOrgAddress
instance.
-
decode
public void decode(org.w3c.dom.Element aElement) throws EPPDecodeException
Decode theEPPOrgAddress
attributes from the aElement DOM Element tree.- Specified by:
decode
in interfaceEPPCodecComponent
- Parameters:
aElement
- Root DOM Element to decodeEPPOrgAddress
from.- Throws:
EPPDecodeException
- Unable to decode aElement.
-
equals
public boolean equals(java.lang.Object aObject)
implements a deepEPPOrgAddress
compare.- Overrides:
equals
in classjava.lang.Object
- Parameters:
aObject
-EPPOrgAddress
instance to compare with- Returns:
true
ofaObject
is equal to instance;false
otherwise.
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
CloneEPPOrgAddress
.- Specified by:
clone
in interfaceEPPCodecComponent
- Overrides:
clone
in classjava.lang.Object
- Returns:
- clone of
EPPOrgAddress
- 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
.
-
-