aboutsummaryrefslogtreecommitdiff
path: root/src/uk/org/ury/server/protocol/Directive.java
diff options
context:
space:
mode:
authorMatt Windsor <matt@deling.(none)>2011-03-18 08:28:09 +0000
committerMatt Windsor <matt@deling.(none)>2011-03-18 08:28:09 +0000
commitd547f87da5f68c12dede7c9d45618cae11ff5699 (patch)
tree613aa95d94b363c72ba9a7be639c74f76edf81f8 /src/uk/org/ury/server/protocol/Directive.java
parentc8bb324e757587e742df0824304144e1eb881cee (diff)
Mega-commit to the rescue! Added Javadoc snapshot (admittedly old); show UI now fixed-layout; UI uses system selection colours for accents; now uses bapsserver password and can thus talk to show database relations; removed member relation dependencies until further notice; attempted to get application and applet launchers working but having issues with the latter; started working on a server communicating via a minimal implementation of HTTP 1.1 (standardisation required eventually).
Diffstat (limited to 'src/uk/org/ury/server/protocol/Directive.java')
-rw-r--r--src/uk/org/ury/server/protocol/Directive.java69
1 files changed, 69 insertions, 0 deletions
diff --git a/src/uk/org/ury/server/protocol/Directive.java b/src/uk/org/ury/server/protocol/Directive.java
new file mode 100644
index 0000000..0d7a162
--- /dev/null
+++ b/src/uk/org/ury/server/protocol/Directive.java
@@ -0,0 +1,69 @@
+/**
+ *
+ */
+package uk.org.ury.server.protocol;
+
+/**
+ * Directives supported by the protocol.
+ *
+ * @author Matt Windsor
+ */
+
+public enum Directive
+ {
+ // ID String representation Singleton?
+
+ /** Directive marking the start of an item block. */
+ ITEM_START ("ITEM-START" , false),
+
+ /** Directive marking a property inside an item block. */
+ ITEM_PROPERTY ("PROP" , false),
+
+ /** Directive marking the end of an item block. */
+ ITEM_END ("ITEM-END" , false);
+
+
+
+ private String strRep; // String representation
+ private boolean isSingleton; // Is a singleton?
+
+
+ /**
+ * Construct a new Directive.
+ *
+ * @param strRep The string representation of the Directive.
+ *
+ * @param isSingleton If true, then the Directive accepts no
+ * properties. If false, then the Directive
+ * must be provided with at least one.
+ */
+
+ private
+ Directive (String strRep, boolean isSingleton)
+ {
+ this.strRep = strRep;
+ this.isSingleton = isSingleton;
+ }
+
+
+ /**
+ * @return the string representation.
+ */
+
+ public String
+ toString ()
+ {
+ return strRep;
+ }
+
+
+ /**
+ * @return true if the directive has no properties.
+ */
+
+ public Boolean
+ isSingleton ()
+ {
+ return isSingleton;
+ }
+ }