Package com.verisign.epp.codec.gen
Class EPPExtValue
- java.lang.Object
-
- com.verisign.epp.codec.gen.EPPExtValue
-
- All Implemented Interfaces:
EPPCodecComponent
,java.io.Serializable
,java.lang.Cloneable
public class EPPExtValue extends java.lang.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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEFAULT_LANG
The default language of the result message "en".static java.lang.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.
-
Constructor Summary
Constructors Constructor Description EPPExtValue()
Default constructor for serialization.EPPExtValue(java.lang.String aReason)
Allocates a newEPPExtValue
with only areason
attributes specified.EPPExtValue(java.lang.String aReason, EPPValue aValue)
Allocates a newEPPExtValue
with both thevalue
andreason
attributes specified.EPPExtValue(java.lang.String aReason, java.lang.String aValue)
Allocates a newEPPExtValue
with both thevalue
andreason
attributes specified.EPPExtValue(java.lang.String aReason, java.lang.String aValue, java.lang.String aPrefix, java.lang.String aNamespace)
Allocates a newEPPExtValue
with all attributes specified.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
clone()
CloneEPPExtValue
.void
decode(org.w3c.dom.Element aElement)
decodeEPPExtValue
from a DOM element tree.org.w3c.dom.Element
encode(org.w3c.dom.Document aDocument)
encodeEPPExtValue
into a DOM element tree.boolean
equals(java.lang.Object aObject)
implements a deepEPPExtValue
compare.java.lang.String
getLang()
Gets the reason language.java.lang.String
getNamespace()
Returns the XML namespace associated with theEPPCodecComponent
.java.lang.String
getReason()
Gets the human-readable message that describes the reason for the error.EPPValue
getValue()
Gets the value element associated with the error.java.lang.String
getValueStr()
Gets the value elementString
associated with the error.void
setLang(java.lang.String aLang)
Sets the reason language.void
setReason(java.lang.String aReason)
Sets the human-readable message that describes the reason for the error.void
setValue(EPPValue aValue)
Sets the value associated with the error.java.lang.String
toString()
Implementation ofObject.toString
, which will result in an indented XMLString
representation of the concreteEPPCodecComponent
.
-
-
-
Field Detail
-
DEFAULT_LANG
public static final java.lang.String DEFAULT_LANG
The default language of the result message "en".- See Also:
- Constant Field Values
-
DEFAULT_VALUE
public static final java.lang.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:
- Constant Field Values
-
-
Constructor Detail
-
EPPExtValue
public EPPExtValue()
Default constructor for serialization. Thevalue
andreason
attributes must be set before callingencode
.
-
EPPExtValue
public EPPExtValue(java.lang.String aReason)
Allocates a newEPPExtValue
with only areason
attributes specified. The value will be set to theDEFAULT_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(java.lang.String aReason, java.lang.String aValue)
Allocates a newEPPExtValue
with both thevalue
andreason
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
- XMLString
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(java.lang.String aReason, EPPValue aValue)
Allocates a newEPPExtValue
with both thevalue
andreason
attributes specified.- Parameters:
aReason
- Human-readable message that describes the reason for the error.aValue
- Value will a valueString
and XML prefix and namespace.
-
EPPExtValue
public EPPExtValue(java.lang.String aReason, java.lang.String aValue, java.lang.String aPrefix, java.lang.String aNamespace)
Allocates a newEPPExtValue
with all attributes specified. This is a convenience constructor in place of usingEPPExtValue(String, EPPValue)
.- Parameters:
aReason
- Human-readable message that describes the reason for the error.aValue
- XMLString
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 Detail
-
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 java.lang.String getValueStr()
Gets the value elementString
associated with the error.- Returns:
- Contained
EPPValue String
value if defined;null
otherwise.
-
getReason
public java.lang.String getReason()
Gets the human-readable message that describes the reason for the error. The language defaults toDEFAULT_LANG
, but the value can be retrieved with thegetLang
method.- Returns:
- the human-readable message that describes the reason for the error.
-
setReason
public void setReason(java.lang.String aReason)
Sets the human-readable message that describes the reason for the error. The language defaults toDEFAULT_LANG
, but can be set with thesetLang
method.- Parameters:
aReason
- Human-readable message that describes the reason for the error.
-
getLang
public java.lang.String getLang()
Gets the reason language. The Language must be structured as documented in [RFC1766].- Returns:
- Language of the reason.
-
setLang
public void setLang(java.lang.String aLang)
Sets the reason language. The Language must be structured as documented in [RFC1766].- Parameters:
aLang
- Language of the reason.
-
encode
public org.w3c.dom.Element encode(org.w3c.dom.Document aDocument) throws EPPEncodeException
encodeEPPExtValue
into a DOM element tree.- Specified by:
encode
in interfaceEPPCodecComponent
- Parameters:
aDocument
- DOCUMENT ME!- Returns:
- <extValue> root element tree.
- Throws:
EPPEncodeException
- Error encoding the DOM element tree.
-
decode
public void decode(org.w3c.dom.Element aElement) throws EPPDecodeException
decodeEPPExtValue
from a DOM element tree. TheaElement
argument needs to be the "extValue" element.- Specified by:
decode
in interfaceEPPCodecComponent
- Parameters:
aElement
- The "extValue" XML element.- Throws:
EPPDecodeException
- Error decoding the DOM element tree.
-
equals
public boolean equals(java.lang.Object aObject)
implements a deepEPPExtValue
compare.- Overrides:
equals
in classjava.lang.Object
- Parameters:
aObject
-EPPExtValue
instance to compare with- Returns:
- DOCUMENT ME!
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
CloneEPPExtValue
.- Specified by:
clone
in interfaceEPPCodecComponent
- Overrides:
clone
in classjava.lang.Object
- Returns:
- Deep copy clone of
EPPExtValue
- 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
.
-
-