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.StringELM_LOCALNAMEXML local name forEPPOrgDisclose.static java.lang.StringELM_NAMEXML root tag forEPPOrgPostalDefinition.
-
Constructor Summary
Constructors Constructor Description EPPOrgAddress()Default constructor forEPPOrgAddress.EPPOrgAddress(java.lang.String aCity, java.lang.String aCountry)Constructor forEPPOrgAddressall 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 forEPPOrgAddressall 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()CloneEPPOrgAddress.voiddecode(org.w3c.dom.Element aElement)Decode theEPPOrgAddressattributes from the aElement DOM Element tree.org.w3c.dom.Elementencode(org.w3c.dom.Document aDocument)Encode a DOM Element tree from the attributes of theEPPOrgAddressinstance.booleanequals(java.lang.Object aObject)implements a deepEPPOrgAddresscompare.java.lang.StringgetCity()Gets the org city.java.lang.StringgetCountry()Gets the org country.java.lang.StringgetNamespace()Returns the XML namespace associated with theEPPCodecComponent.java.lang.StringgetPostalCode()Gets the org postal codejava.lang.StringgetStateProvince()Gets the org state/province.java.util.List<java.lang.String>getStreets()Gets the org street(s).booleanhasStreets()Is there any street lines set?voidsetCity(java.lang.String aCity)Sets the org city.voidsetCountry(java.lang.String aCountry)Sets the org country.voidsetPostalCode(java.lang.String aPostalCode)Sets the org postal codevoidsetStateProvince(java.lang.String aStateProvince)Sets the org state/province.voidsetStreet(java.lang.String aStreet)Sets the org streets with only one line.voidsetStreets(java.lang.String aStreet1, java.lang.String aStreet2)Sets the org street with two street lines.voidsetStreets(java.lang.String aStreet1, java.lang.String aStreet2, java.lang.String aStreet3)Sets the org street with three street lines.voidsetStreets(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.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 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 forEPPOrgAddressall 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 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 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 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.
Stringif defined;nullotherwise.
-
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.
Stringif defined;nullotherwise.
-
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
Stringif defined;nullotherwise.
-
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
Stringif defined;nullotherwise.
-
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 EPPEncodeExceptionEncode 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
public void decode(org.w3c.dom.Element aElement) throws EPPDecodeExceptionDecode 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
public boolean equals(java.lang.Object aObject)
implements a deepEPPOrgAddresscompare.- Overrides:
equalsin classjava.lang.Object- Parameters:
aObject-EPPOrgAddressinstance to compare with- Returns:
trueofaObjectis equal to instance;falseotherwise.
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedExceptionCloneEPPOrgAddress.- Specified by:
clonein interfaceEPPCodecComponent- Overrides:
clonein 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 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.
-
-