Google Data APIs Client Library (1.41.1)



com.google.gdata.util
Class ErrorDomain

java.lang.Object
  extended by com.google.gdata.util.ErrorDomain
Direct Known Subclasses:
CoreErrorDomain

public abstract class ErrorDomain
extends java.lang.Object

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:

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")
       .withInternalReason("Bar is not working yet");
 
   public final ErrorCode unsupported = new ErrorCode("unsupported")
       .withInternalReason("Requested key is not supported");
 
   public final ErrorCode invalid = new ErrorCode("invalidValue")
       .withInternalReason("Invalid value for attribute")
       .withExtendedHelp("http://www.google.com/foo/validAttributes.html");
 
 }
 

Note that all with methods return a mutated copy.


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 eror domain 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

ErrorDomain

protected ErrorDomain(java.lang.String domainName)
Constructs an ErrorDomain with a specified name. This can be called only from the constructor of a subclass. The value will appear as the content of the domain element in the XML error format.


ErrorDomain

protected ErrorDomain()
Constructs an ErrorDomain with a default eror domain name. Use ErrorDomain(String) to set a different domain name.

Method Detail

getDomainName

public java.lang.String getDomainName()
Returns the name associated with this ErrorDomain..