Package com.verisign.epp.codec.org
Class EPPOrgAddress
java.lang.Object
com.verisign.epp.codec.org.EPPOrgAddress
- All Implemented Interfaces:
EPPCodecComponent,Serializable,Cloneable
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:
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:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor forEPPOrgAddress.EPPOrgAddress(String aCity, String aCountry) Constructor forEPPOrgAddressall of the required attributes as parameters.EPPOrgAddress(List<String> aStreets, String aCity, String aStateProvince, String aPostalCode, String aCountry) Constructor forEPPOrgAddressall of the attributes as parameters. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a street line to the street.clone()CloneEPPOrgAddress.voidDecode theEPPOrgAddressattributes from the aElement DOM Element tree.Encode a DOM Element tree from the attributes of theEPPOrgAddressinstance.booleanimplements a deepEPPOrgAddresscompare.getCity()Gets the org city.Gets the org country.Returns the XML namespace associated with theEPPCodecComponent.Gets the org postal codeGets the org state/province.Gets the org street(s).booleanIs there any street lines set?voidSets the org city.voidsetCountry(String aCountry) Sets the org country.voidsetPostalCode(String aPostalCode) Sets the org postal codevoidsetStateProvince(String aStateProvince) Sets the org state/province.voidSets the org streets with only one line.voidsetStreets(String aStreet1, String aStreet2) Sets the org street with two street lines.voidsetStreets(String aStreet1, String aStreet2, String aStreet3) Sets the org street with three street lines.voidsetStreets(List<String> aStreets) Sets the org 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 forEPPOrgDisclose.- See Also:
-
ELM_NAME
XML root tag forEPPOrgPostalDefinition.- See Also:
-
-
Constructor Details
-
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
Constructor forEPPOrgAddressall of the required attributes as parameters.- Parameters:
aCity- Org streetaCountry- Org country
-
EPPOrgAddress
public EPPOrgAddress(List<String> aStreets, String aCity, String aStateProvince, String aPostalCode, String aCountry) Constructor forEPPOrgAddressall 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 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 org street(s).- Returns:
- street(s) as a
List<String>of streets (up to maximum three).
-
setStreets
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
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
Sets the org street with two street lines.- Parameters:
aStreet1- First street lineaStreet2- Second street line
-
setStreets
Sets the org street with three street lines.- Parameters:
aStreet1- First street lineaStreet2- Second street lineaStreet3- Third street line
-
getCity
Gets the org city.- Returns:
- city.
Stringif defined;nullotherwise.
-
setCity
Sets the org city.- Parameters:
aCity- org city
-
getStateProvince
Gets the org state/province.- Returns:
- state/province.
Stringif defined;nullotherwise.
-
setStateProvince
Sets the org state/province.- Parameters:
aStateProvince- org state/province
-
getPostalCode
Gets the org postal code- Returns:
- postal code
Stringif defined;nullotherwise.
-
setPostalCode
Sets the org postal code- Parameters:
aPostalCode- org postal code
-
getCountry
Gets the org country.- Returns:
- org country
Stringif defined;nullotherwise.
-
setCountry
Sets the org country.- Parameters:
aCountry- org country
-
encode
Encode a DOM Element tree from the attributes of theEPPOrgAddressinstance.- Specified by:
encodein interfaceEPPCodecComponent- Parameters:
aDocument- DOM Document that is being built. Used as an Element factory.- Returns:
- Root DOM Element representing the
EPPOrgAddressinstance. - Throws:
EPPEncodeException- Unable to encodeEPPOrgAddressinstance.
-
decode
Decode theEPPOrgAddressattributes from the aElement DOM Element tree.- Specified by:
decodein interfaceEPPCodecComponent- Parameters:
aElement- Root DOM Element to decodeEPPOrgAddressfrom.- Throws:
EPPDecodeException- Unable to decode aElement.
-
equals
implements a deepEPPOrgAddresscompare. -
clone
CloneEPPOrgAddress.- Specified by:
clonein interfaceEPPCodecComponent- Overrides:
clonein classObject- Returns:
- clone of
EPPOrgAddress - 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.
-