org.apache.abdera.protocol.error
Class Error
java.lang.Object
org.apache.abdera.model.ElementWrapper
org.apache.abdera.model.ExtensibleElementWrapper
org.apache.abdera.protocol.error.Error
- All Implemented Interfaces:
- Cloneable, Iterable<Element>, Base, Element, ExtensibleElement
public class Error
- extends ExtensibleElementWrapper
Abdera protocol error element. The Abdera error document provides a simple structure for reporting errors back to
Abdera clients.
Method Summary |
static Error |
create(Abdera abdera,
int code,
String message)
Create a new Error object |
static Error |
create(Abdera abdera,
int code,
String message,
Throwable t)
|
static void |
create(StreamWriter sw,
int code,
String message,
Throwable t)
|
int |
getCode()
The code should typically match the HTTP status code; however, certain application scenarios may require the use
of a different code |
String |
getMessage()
Human-readable, language-sensitive description of the error |
Error |
setCode(int code)
The code should typically match the HTTP status code; however, certain application scenarios may require the use
of a different code |
Error |
setMessage(String message)
Human-readable, language-sensitive description of the error |
void |
throwException()
Will throw a ProtocolException that wraps this element. |
Methods inherited from class org.apache.abdera.model.ExtensibleElementWrapper |
addExtension, addExtension, addExtension, addExtension, addExtension, addSimpleExtension, addSimpleExtension, getExtension, getExtension, getExtensions, getExtensions, getExtensions, getExtInternal, getMustPreserveWhitespace, getSimpleExtension, getSimpleExtension, setMustPreserveWhitespace |
Methods inherited from class org.apache.abdera.model.ElementWrapper |
addComment, clone, complete, declareNS, discard, equals, getAttributes, getAttributeValue, getAttributeValue, getBaseUri, getDefaultWriterOptions, getDocument, getElements, getExtensionAttributes, getFactory, getFirstChild, getFirstChild, getInternal, getLanguage, getLanguageTag, getLocale, getNamespaces, getNextSibling, getNextSibling, getParentElement, getPreviousSibling, getPreviousSibling, getQName, getResolvedBaseUri, getText, hashCode, iterator, removeAttribute, removeAttribute, setAttributeValue, setAttributeValue, setBaseUri, setBaseUri, setLanguage, setParentElement, setText, setText, toString, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo |
Methods inherited from interface org.apache.abdera.model.Element |
declareNS, discard, getAttributes, getAttributeValue, getAttributeValue, getBaseUri, getDocument, getElements, getExtensionAttributes, getFirstChild, getFirstChild, getLanguage, getLanguageTag, getLocale, getNamespaces, getNextSibling, getNextSibling, getParentElement, getPreviousSibling, getPreviousSibling, getQName, getResolvedBaseUri, getText, removeAttribute, removeAttribute, setAttributeValue, setAttributeValue, setBaseUri, setBaseUri, setLanguage, setParentElement, setText, setText |
Methods inherited from interface org.apache.abdera.model.Base |
addComment, clone, complete, getDefaultWriterOptions, getFactory, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo |
NS
public static final String NS
- See Also:
- Constant Field Values
ERROR
public static final QName ERROR
CODE
public static final QName CODE
MESSAGE
public static final QName MESSAGE
Error
public Error(Element internal)
Error
public Error(Factory factory,
QName qname)
getCode
public int getCode()
- The code should typically match the HTTP status code; however, certain application scenarios may require the use
of a different code
setCode
public Error setCode(int code)
- The code should typically match the HTTP status code; however, certain application scenarios may require the use
of a different code
getMessage
public String getMessage()
- Human-readable, language-sensitive description of the error
setMessage
public Error setMessage(String message)
- Human-readable, language-sensitive description of the error
throwException
public void throwException()
- Will throw a ProtocolException that wraps this element. This is useful on the client side to surface error
responses
create
public static Error create(Abdera abdera,
int code,
String message)
- Create a new Error object
create
public static Error create(Abdera abdera,
int code,
String message,
Throwable t)
create
public static void create(StreamWriter sw,
int code,
String message,
Throwable t)
Copyright © 2006-2010 Apache Software Foundation. All Rights Reserved.