com.verisign.epp.codec.contact
Class EPPContactPostalDefinition

java.lang.Object
  extended by com.verisign.epp.codec.contact.EPPContactPostalDefinition
All Implemented Interfaces:
EPPCodecComponent, java.io.Serializable, java.lang.Cloneable

public class EPPContactPostalDefinition
extends java.lang.Object
implements EPPCodecComponent

Represents a contact postal address definition that is used in EPPContactCreateCmd, EPPContactUpdateCmd, and EPPContactInfoResp. The child elements associated with an EPPContactPostalDefinition include:



Version:
$Revision: 1.3 $
Author:
$Author: jim $
See Also:
Serialized Form

Field Summary
static java.lang.String ATTR_TYPE_INT
          Value of the INT in contact postal info type mapping
static java.lang.String ATTR_TYPE_LOC
          Value of the LOC in contact postal info type mapping
static java.lang.String ELM_NAME_POSTAL_INFO
          XML tag name for the org attribute.
 
Constructor Summary
EPPContactPostalDefinition()
          EPPContactPostalDefinition default constructor.
EPPContactPostalDefinition(java.lang.String aType)
          EPPContactPostalDefinition constructor that takes the contact address type as argument.
EPPContactPostalDefinition(java.lang.String aType, EPPContactAddress aAddress)
          EPPContactPostalDefinition constructor that sets the required attributes with the parameters.
EPPContactPostalDefinition(java.lang.String aName, java.lang.String aType, EPPContactAddress aAddress)
          EPPContactPostalDefinition constructor that sets the required attributes with the parameters.
EPPContactPostalDefinition(java.lang.String aName, java.lang.String aOrg, java.lang.String aType, EPPContactAddress aAddress)
          EPPContactPostalDefinition constructor that sets all of the attribute with the parameter values.
 
Method Summary
 java.lang.Object clone()
          Clone EPPContactPostalDefinition.
 void decode(org.w3c.dom.Element aElement)
          Decode the EPPContactPostalDefinition 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 the EPPContactPostalDefinition instance.
 boolean equals(java.lang.Object aObject)
          implements a deep EPPContactPostalDefinition compare.
 EPPContactAddress getAddress()
          Gets the contact address
 java.lang.String getName()
          Gets the contact name
 java.lang.String getOrg()
          Gets the contact organization
 java.lang.String getRootName()
          Get root tag name for contact postal definition.
 java.lang.String getType()
          Get contact address type.
 boolean isValidated()
          Show whether needs to call validateState()
 void setAddress(EPPContactAddress aAddress)
          Sets the contact address
 void setName(java.lang.String aName)
          Sets the contact name.
 void setOrg(java.lang.String aOrg)
          Sets the contact organization
 void setRootName(java.lang.String newRootName)
          Set root tag name for contact postal definition.
 void setType(java.lang.String newType)
          Set contact type.
 void setValidatedFlag(boolean newValidatedFlag)
          Set validated flag.
 java.lang.String toString()
          Implementation of Object.toString, which will result in an indented XML String representation of the concrete EPPCodecComponent.
protected  void validateState()
          Validate the state of the EPPContactPostalDefination instance.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ELM_NAME_POSTAL_INFO

public static final java.lang.String ELM_NAME_POSTAL_INFO
XML tag name for the org attribute.

See Also:
Constant Field Values

ATTR_TYPE_LOC

public static final java.lang.String ATTR_TYPE_LOC
Value of the LOC in contact postal info type mapping

See Also:
Constant Field Values

ATTR_TYPE_INT

public static final java.lang.String ATTR_TYPE_INT
Value of the INT in contact postal info type mapping

See Also:
Constant Field Values
Constructor Detail

EPPContactPostalDefinition

public EPPContactPostalDefinition()
EPPContactPostalDefinition default constructor. Must call required setter methods before invoking encode, which include:



The following optional attributes can be set:


EPPContactPostalDefinition

public EPPContactPostalDefinition(java.lang.String aType)
EPPContactPostalDefinition constructor that takes the contact address type as argument.

Parameters:
aType - address type which should be one of the ATTR_TYPE constants.

EPPContactPostalDefinition

public EPPContactPostalDefinition(java.lang.String aType,
                                  EPPContactAddress aAddress)
EPPContactPostalDefinition constructor that sets the required attributes with the parameters. The following optional attribute can be set:

Parameters:
aType - DOCUMENT ME!
aAddress - contact address

EPPContactPostalDefinition

public EPPContactPostalDefinition(java.lang.String aName,
                                  java.lang.String aType,
                                  EPPContactAddress aAddress)
EPPContactPostalDefinition constructor that sets the required attributes with the parameters. The following optional attribute can be set:

Parameters:
aName - contact name
aType - DOCUMENT ME!
aAddress - contact address

EPPContactPostalDefinition

public EPPContactPostalDefinition(java.lang.String aName,
                                  java.lang.String aOrg,
                                  java.lang.String aType,
                                  EPPContactAddress aAddress)
EPPContactPostalDefinition constructor that sets all of the attribute with the parameter values.

Parameters:
aName - contact name
aOrg - contact organization if defined; null otherwise
aType - DOCUMENT ME!
aAddress - contact address
Method Detail

getOrg

public java.lang.String getOrg()
Gets the contact organization

Returns:
Client organization if defined; null otherwise.

setOrg

public void setOrg(java.lang.String aOrg)
Sets the contact organization

Parameters:
aOrg - Client organization

getAddress

public EPPContactAddress getAddress()
Gets the contact address

Returns:
Contact address if defined; null otherwise.

setAddress

public void setAddress(EPPContactAddress aAddress)
Sets the contact address

Parameters:
aAddress - Contact address

encode

public org.w3c.dom.Element encode(org.w3c.dom.Document aDocument)
                           throws EPPEncodeException
Encode a DOM Element tree from the attributes of the EPPContactPostalDefinition instance.

Specified by:
encode in interface EPPCodecComponent
Parameters:
aDocument - DOM Document that is being built. Used as an Element factory.
Returns:
DOCUMENT ME!
Throws:
EPPEncodeException

decode

public void decode(org.w3c.dom.Element aElement)
            throws EPPDecodeException
Decode the EPPContactPostalDefinition attributes from the aElement DOM Element tree.

Specified by:
decode in interface EPPCodecComponent
Parameters:
aElement - Root DOM Element to decode EPPContactPostalDefinition from.
Throws:
EPPDecodeException - Unable to decode aElement

equals

public boolean equals(java.lang.Object aObject)
implements a deep EPPContactPostalDefinition compare.

Overrides:
equals in class java.lang.Object
Parameters:
aObject - EPPContactPostalDefinition instance to compare with
Returns:
DOCUMENT ME!

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Clone EPPContactPostalDefinition.

Specified by:
clone in interface EPPCodecComponent
Overrides:
clone in class java.lang.Object
Returns:
clone of EPPContactPostalDefinition
Throws:
java.lang.CloneNotSupportedException - standard Object.clone exception

toString

public java.lang.String toString()
Implementation of Object.toString, which will result in an indented XML String representation of the concrete EPPCodecComponent.

Overrides:
toString in class java.lang.Object
Returns:
Indented XML String if successful; ERROR otherwise.

validateState

protected void validateState()
                      throws EPPCodecException
Validate the state of the EPPContactPostalDefination instance. A valid state means that all of the required attributes have been set. If validateState returns without an exception, the state is valid. If the state is not valid, the EPPCodecException will contain a description of the error. throws EPPCodecException State error. This will contain the name of the attribute that is not valid.

Throws:
EPPCodecException - DOCUMENT ME!

getName

public java.lang.String getName()
Gets the contact name

Returns:
Contact Name if defined; null otherwise.

getRootName

public java.lang.String getRootName()
Get root tag name for contact postal definition.

Returns:
String root tag name

setName

public void setName(java.lang.String aName)
Sets the contact name.

Parameters:
aName - Contact Name

setRootName

public void setRootName(java.lang.String newRootName)
Set root tag name for contact postal definition.

Parameters:
newRootName - String

isValidated

public boolean isValidated()
Show whether needs to call validateState()

Returns:
boolean

setValidatedFlag

public void setValidatedFlag(boolean newValidatedFlag)
Set validated flag.

Parameters:
newValidatedFlag - boolean

getType

public java.lang.String getType()
Get contact address type.

Returns:
String Contact type

setType

public void setType(java.lang.String newType)
Set contact type.

Parameters:
newType - String


Copyright ? VeriSign Inc. All Rights Reserved.