Class EPPExtValue

java.lang.Object
com.verisign.epp.codec.gen.EPPExtValue
All Implemented Interfaces:
EPPCodecComponent, Serializable, Cloneable

public class EPPExtValue extends Object implements EPPCodecComponent
elements that can be used to provide additional error diagnostic information, including:
  • A <value> element that identifies a client-provided element (including XML tag and value) that caused a server error condition.
  • A <reason> element containing a human-readable message that describes the reason for the error. The language of the response is identified via an OPTIONAL "lang" attribute. If not specified, the default attribute value MUST be "en" (English).
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The default language of the result message "en".
    static final String
    Default value which is used when there is only a reason and the server can not identify a single client element that caused the error.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor for serialization.
    Allocates a new EPPExtValue with only a reason attributes specified.
    EPPExtValue(String aReason, EPPValue aValue)
    Allocates a new EPPExtValue with both the value and reason attributes specified.
    EPPExtValue(String aReason, String aValue)
    Allocates a new EPPExtValue with both the value and reason attributes specified.
    EPPExtValue(String aReason, String aValue, String aPrefix, String aNamespace)
    Allocates a new EPPExtValue with all attributes specified.
  • Method Summary

    Modifier and Type
    Method
    Description
    Clone EPPExtValue.
    void
    decode(Element aElement)
    decode EPPExtValue from a DOM element tree.
    encode(Document aDocument)
    encode EPPExtValue into a DOM element tree.
    boolean
    equals(Object aObject)
    implements a deep EPPExtValue compare.
    Gets the reason language.
    Returns the XML namespace associated with the EPPCodecComponent.
    Gets the human-readable message that describes the reason for the error.
    Gets the value element associated with the error.
    Gets the value element String associated with the error.
    void
    setLang(String aLang)
    Sets the reason language.
    void
    setReason(String aReason)
    Sets the human-readable message that describes the reason for the error.
    void
    Sets the value associated with the error.
    Implementation of Object.toString, which will result in an indented XML String representation of the concrete EPPCodecComponent.

    Methods inherited from class java.lang.Object

    finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • DEFAULT_LANG

      public static final String DEFAULT_LANG
      The default language of the result message "en".
      See Also:
    • DEFAULT_VALUE

      public static final String DEFAULT_VALUE
      Default value which is used when there is only a reason and the server can not identify a single client element that caused the error.
      See Also:
  • Constructor Details

    • EPPExtValue

      public EPPExtValue()
      Default constructor for serialization. The value and reason attributes must be set before calling encode.
    • EPPExtValue

      public EPPExtValue(String aReason)
      Allocates a new EPPExtValue with only a reason attributes specified. The value will be set to the DEFAULT_VALUE constant, which indicates that no client element is specified. The default XML prefix and XML namespace will be used.
      Parameters:
      aReason - Human-readable message that describes the reason for the error.
    • EPPExtValue

      public EPPExtValue(String aReason, String aValue)
      Allocates a new EPPExtValue with both the value and reason attributes specified. The default XML prefix and XML namespace will be used.
      Parameters:
      aReason - Human-readable message that describes the reason for the error.
      aValue - XML String that identifies a client-provided element (including XML tag and value) that caused a server error. For example, <domain:name>example.com</domain>.
    • EPPExtValue

      public EPPExtValue(String aReason, EPPValue aValue)
      Allocates a new EPPExtValue with both the value and reason attributes specified.
      Parameters:
      aReason - Human-readable message that describes the reason for the error.
      aValue - Value will a value String and XML prefix and namespace.
    • EPPExtValue

      public EPPExtValue(String aReason, String aValue, String aPrefix, String aNamespace)
      Allocates a new EPPExtValue with all attributes specified. This is a convenience constructor in place of using EPPExtValue(String, EPPValue).
      Parameters:
      aReason - Human-readable message that describes the reason for the error.
      aValue - XML String that identifies a client-provided element (including XML tag and value) that caused a server error. For example, <domain:name>example.com</domain>.
      aPrefix - XML Namespace prefix. For example, "domain" or "epp".
      aNamespace - XML Namespace URI. For example, "urn:ietf:params:xml:ns:domain-1.0".
  • Method Details

    • getValue

      public EPPValue getValue()
      Gets the value element associated with the error.
      Returns:
      The value object that includes the XML value with prefix and namespace.
    • setValue

      public void setValue(EPPValue aValue)
      Sets the value associated with the error.
      Parameters:
      aValue - The value object that includes the XML value with prefix and namespace.
    • getValueStr

      public String getValueStr()
      Gets the value element String associated with the error.
      Returns:
      Contained EPPValue String value if defined; null otherwise.
    • getReason

      public String getReason()
      Gets the human-readable message that describes the reason for the error. The language defaults to DEFAULT_LANG, but the value can be retrieved with the getLang method.
      Returns:
      the human-readable message that describes the reason for the error.
    • setReason

      public void setReason(String aReason)
      Sets the human-readable message that describes the reason for the error. The language defaults to DEFAULT_LANG, but can be set with the setLang method.
      Parameters:
      aReason - Human-readable message that describes the reason for the error.
    • getLang

      public String getLang()
      Gets the reason language. The Language must be structured as documented in [RFC1766].
      Returns:
      Language of the reason.
    • setLang

      public void setLang(String aLang)
      Sets the reason language. The Language must be structured as documented in [RFC1766].
      Parameters:
      aLang - Language of the reason.
    • encode

      public Element encode(Document aDocument) throws EPPEncodeException
      encode EPPExtValue into a DOM element tree.
      Specified by:
      encode in interface EPPCodecComponent
      Parameters:
      aDocument - DOCUMENT ME!
      Returns:
      <extValue> root element tree.
      Throws:
      EPPEncodeException - Error encoding the DOM element tree.
    • decode

      public void decode(Element aElement) throws EPPDecodeException
      decode EPPExtValue from a DOM element tree. The aElement argument needs to be the "extValue" element.
      Specified by:
      decode in interface EPPCodecComponent
      Parameters:
      aElement - The "extValue" XML element.
      Throws:
      EPPDecodeException - Error decoding the DOM element tree.
    • equals

      public boolean equals(Object aObject)
      implements a deep EPPExtValue compare.
      Overrides:
      equals in class Object
      Parameters:
      aObject - EPPExtValue instance to compare with
      Returns:
      DOCUMENT ME!
    • clone

      public Object clone() throws CloneNotSupportedException
      Clone EPPExtValue.
      Specified by:
      clone in interface EPPCodecComponent
      Overrides:
      clone in class Object
      Returns:
      Deep copy clone of EPPExtValue
      Throws:
      CloneNotSupportedException - standard Object.clone exception
    • toString

      public String toString()
      Implementation of Object.toString, which will result in an indented XML String representation of the concrete EPPCodecComponent.
      Overrides:
      toString in class Object
      Returns:
      Indented XML String if successful; ERROR otherwise.
    • getNamespace

      public String getNamespace()
      Returns the XML namespace associated with the EPPCodecComponent.
      Specified by:
      getNamespace in interface EPPCodecComponent
      Returns:
      XML namespace for the EPPCodecComponent.