Use Jackson to create JSON pages, get rid of utils-json dependency.
[Sone.git] / src / main / java / net / pterodactylus / sone / web / ajax / JsonErrorReturnObject.java
diff --git a/src/main/java/net/pterodactylus/sone/web/ajax/JsonErrorReturnObject.java b/src/main/java/net/pterodactylus/sone/web/ajax/JsonErrorReturnObject.java
new file mode 100644 (file)
index 0000000..0dae0a3
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * © 2013 xplosion interactive
+ */
+
+package net.pterodactylus.sone.web.ajax;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * {@link JsonReturnObject} that signals an error has occured.
+ *
+ * @author <a href="mailto:d.roden@xplosion.de">David Roden</a>
+ */
+public class JsonErrorReturnObject extends JsonReturnObject {
+
+       /** The error that has occured. */
+       @JsonProperty
+       private final String error;
+
+       /**
+        * Creates a new error JSON return object.
+        *
+        * @param error
+        *              The error that occured
+        */
+       public JsonErrorReturnObject(String error) {
+               super(false);
+               this.error = error;
+       }
+
+}