|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.gdata.util.ErrorDomain
public abstract class ErrorDomain
This is the parent class of all error domain classes. Error domain classes package up a group of related error codes (and associated information) into an error domain with a unique name, by default the fully qualified name of the class. Create an error domain as follows:
public static final
variable named ERR
with the same type as the subclass; initialize it to an
instance of the subclass. (This is eager singleton
initialization.)
super("foo")
in the constructor.
public final ErrorCode
fields
thus: public final ErrorCode
foo = new ErrorCode("foo")
(Note: not ).
setInternalReason
, setExtendedHelp
, or setSendReport
.
Here's a complete example:
public class FooErrorDomain extends ErrorDomain { private FooErrorDomain() { super("Foo"); } public static final FooErrorDomain ERR = new FooErrorDomain(); public final ErrorCode bar = new ErrorCode("brokenBar") .setInternalReason("Bar is not working yet"); public final ErrorCode unsupported = new ErrorCode("unsupported") .setInternalReason("Requested key is not supported"); public final ErrorCode invalid = new ErrorCode("invalidValue") .setInternalReason("Invalid value for attribute") .setExtendedHelp("http://www.google.com/foo/validAttributes.html"); }
Note that all setters return this
.
Nested Class Summary | |
---|---|
class |
ErrorDomain.ErrorCode
ErrorCode objects represent an error code within an error domain. |
Constructor Summary | |
---|---|
protected |
ErrorDomain()
Constructs an ErrorDomain with a default name. |
protected |
ErrorDomain(java.lang.String domainName)
Constructs an ErrorDomain with a specified name. |
Method Summary | |
---|---|
java.lang.String |
getDomainName()
Returns the name associated with this ErrorDomain.. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected ErrorDomain(java.lang.String domainName)
domain
element in the XML error format.
protected ErrorDomain()
Method Detail |
---|
public java.lang.String getDomainName()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |