|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.api.gbase.client.ServiceErrors
public class ServiceErrors
Extracts and organizes error messages from a
ServiceException
or from a
BatchStatus
.
This object parses the body of a ServiceException
or the content of a BatchStatus
and gives programmatic access to the error messages embedded in the body
of the exception.
Constructor Summary | |
---|---|
ServiceErrors()
Empty constructor. |
|
ServiceErrors(BatchStatus status)
Creates a ServiceErrors object corresponding to the errors contained in BatchStatus . |
|
ServiceErrors(ServiceException e)
Creates a ServiceErrors object corresponding to the errors contained in a ServiceException . |
Method Summary | |
---|---|
void |
addError(ServiceError error)
Registers a new error. |
void |
addErrors(BatchStatus status)
Extracts errors from a BatchStatus . |
void |
addErrors(ServiceException e)
Extracts errors from a ServiceException . |
java.util.List<? extends ServiceError> |
getAllErrors()
Gets all errors. |
java.util.Collection<? extends ServiceError> |
getDataErrors()
Gets data errors, which apply to the item content, often to one field in particular. |
java.util.Set<? extends java.lang.String> |
getErrorFields()
Gets the set of all fields that have errors. |
java.util.List<? extends ServiceError> |
getFieldErrors(java.lang.String field)
Gets all errors for one specific field. |
java.util.List<? extends ServiceError> |
getRequestErrors()
Gets non-data errors, which apply to the whole request. |
java.lang.String |
toString()
Returns a convenient text representation, for debugging. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ServiceErrors(ServiceException e)
ServiceException
.
e
- public ServiceErrors(BatchStatus status)
BatchStatus
.
status
- public ServiceErrors()
Method Detail |
---|
public java.lang.String toString()
toString
in class java.lang.Object
public void addErrors(ServiceException e)
ServiceException
.
e
- the ServiceException to be parsedpublic void addErrors(BatchStatus status)
BatchStatus
.
status
- the BatchStatus to be parsedpublic void addError(ServiceError error)
error
- public java.util.List<? extends ServiceError> getAllErrors()
public java.util.List<? extends ServiceError> getRequestErrors()
public java.util.Collection<? extends ServiceError> getDataErrors()
public java.util.Set<? extends java.lang.String> getErrorFields()
public java.util.List<? extends ServiceError> getFieldErrors(java.lang.String field)
field
- field name, which usually comes from
getErrorFields()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |