Updated Branches:
  refs/heads/api_refactoring c167ad45e -> 44ef998cf

api: Add Validator interface that will be used for the @Validator annotation

The @Validator (defined as @validate in wiki/FS) will do the following things:
- DBEntityValidator (verifies if the entity exists in the db or not)
- RangeValidator (min, max; limits)

Signed-off-by: Rohit Yadav <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/44ef998c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/44ef998c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/44ef998c

Branch: refs/heads/api_refactoring
Commit: 44ef998cfc83bcb210cf257bd137073338aab4e2
Parents: c167ad4
Author: Fang Wang <[email protected]>
Authored: Fri Dec 14 11:42:49 2012 -0800
Committer: Rohit Yadav <[email protected]>
Committed: Fri Dec 14 11:42:49 2012 -0800

----------------------------------------------------------------------
 api/src/org/apache/cloudstack/api/Validator.java |   30 +++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/44ef998c/api/src/org/apache/cloudstack/api/Validator.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/Validator.java 
b/api/src/org/apache/cloudstack/api/Validator.java
new file mode 100644
index 0000000..ca2c241
--- /dev/null
+++ b/api/src/org/apache/cloudstack/api/Validator.java
@@ -0,0 +1,30 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.api;
+
+import static java.lang.annotation.ElementType.FIELD;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ FIELD })
+public @interface Validator {
+    String DBEntityValidator();
+    String RangeValidator();
+}

Reply via email to