Bug 226878: fixed wrong plugin name in CVS
diff --git a/plugins/org.eclipse.tigerstripe.annotation.example.person.validators/.classpath b/plugins/org.eclipse.tigerstripe.annotation.example.person.validators/.classpath
new file mode 100644
index 0000000..0215967
--- /dev/null
+++ b/plugins/org.eclipse.tigerstripe.annotation.example.person.validators/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>

+<classpath>

+	<classpathentry kind="src" path="src"/>

+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>

+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>

+	<classpathentry kind="output" path="bin"/>

+</classpath>

diff --git a/plugins/org.eclipse.tigerstripe.annotation.example.person.validators/.project b/plugins/org.eclipse.tigerstripe.annotation.example.person.validators/.project
new file mode 100644
index 0000000..9fbe96b
--- /dev/null
+++ b/plugins/org.eclipse.tigerstripe.annotation.example.person.validators/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>

+<projectDescription>

+	<name>org.eclipse.tigerstripe.annotation.example.person.validators</name>

+	<comment></comment>

+	<projects>

+	</projects>

+	<buildSpec>

+		<buildCommand>

+			<name>org.eclipse.jdt.core.javabuilder</name>

+			<arguments>

+			</arguments>

+		</buildCommand>

+		<buildCommand>

+			<name>org.eclipse.pde.ManifestBuilder</name>

+			<arguments>

+			</arguments>

+		</buildCommand>

+		<buildCommand>

+			<name>org.eclipse.pde.SchemaBuilder</name>

+			<arguments>

+			</arguments>

+		</buildCommand>

+	</buildSpec>

+	<natures>

+		<nature>org.eclipse.pde.PluginNature</nature>

+		<nature>org.eclipse.jdt.core.javanature</nature>

+	</natures>

+</projectDescription>

diff --git a/plugins/org.eclipse.tigerstripe.annotation.example.person.validators/META-INF/MANIFEST.MF b/plugins/org.eclipse.tigerstripe.annotation.example.person.validators/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..38a4bc8
--- /dev/null
+++ b/plugins/org.eclipse.tigerstripe.annotation.example.person.validators/META-INF/MANIFEST.MF
@@ -0,0 +1,10 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Tigerstripe Annotation Validators Plug-in
+Bundle-SymbolicName: org.eclipse.tigerstripe.annotation.example.person.validators;singleton:=true
+Bundle-Version: 1.0.0
+Bundle-Vendor: Eclipse.org
+Require-Bundle: org.eclipse.tigerstripe.annotation.core,
+ org.eclipse.tigerstripe.annotation.example.person,
+ org.eclipse.emf.validation,
+ org.eclipse.core.runtime
diff --git a/plugins/org.eclipse.tigerstripe.annotation.example.person.validators/build.properties b/plugins/org.eclipse.tigerstripe.annotation.example.person.validators/build.properties
new file mode 100644
index 0000000..2c6c609
--- /dev/null
+++ b/plugins/org.eclipse.tigerstripe.annotation.example.person.validators/build.properties
@@ -0,0 +1,16 @@
+###############################################################################

+# Copyright (c) 2008 xored software, Inc.  

+# 

+# All rights reserved. This program and the accompanying materials 

+# are made available under the terms of the Eclipse Public License v1.0 

+# which accompanies this distribution, and is available at 

+# http://www.eclipse.org/legal/epl-v10.html  

+# 

+# Contributors: 

+#     xored software, Inc. - initial API and Implementation (Yuri Strot) 

+###############################################################################

+source.. = src/

+output.. = bin/

+bin.includes = META-INF/,\

+               .,\

+               plugin.xml

diff --git a/plugins/org.eclipse.tigerstripe.annotation.example.person.validators/plugin.xml b/plugins/org.eclipse.tigerstripe.annotation.example.person.validators/plugin.xml
new file mode 100644
index 0000000..e936db6
--- /dev/null
+++ b/plugins/org.eclipse.tigerstripe.annotation.example.person.validators/plugin.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>

+<?eclipse version="3.2"?>

+<plugin>

+   <extension

+         point="org.eclipse.tigerstripe.annotation.core.validators">

+      <validator

+            class="org.eclipse.tigerstripe.annotation.example.person.validators.PersonValidator"

+            typeID="org.eclipse.tigerstripe.annotation.example.person">

+      </validator>

+   </extension>

+   

+   <extension

+         point="org.eclipse.emf.validation.constraintProviders">

+      <constraintProvider cache="true">

+         <package namespaceUri="http:///org/eclipse/tigerstripe/annotation/example/person.ecore"/>

+         <constraints categories="org.eclipse.tigerstripe.annotation.core.validation.category">

+            <constraint

+                  lang="Java"

+                  class="org.eclipse.tigerstripe.annotation.example.person.validators.PersonValidator"

+                  severity="ERROR"

+                  mode="Live"

+                  name="Valid Person Age"

+                  id="org.eclipse.tigerstripe.annotation.example.person.validAge"

+                  statusCode="1">

+               <description>

+                  Person age should be non-negative number and non greater than 100 years

+               </description>

+               <message>

+                  Person age can't be {0}

+               </message>

+               <target class="Person">

+                  <event name="Set">

+                     <feature name="age"/>

+                  </event>

+                  <event name="Unset">

+                     <feature name="age"/>

+                  </event>

+               </target>

+            </constraint>

+         </constraints>

+      </constraintProvider>

+   </extension>

+

+</plugin>

diff --git a/plugins/org.eclipse.tigerstripe.annotation.example.person.validators/src/org/eclipse/tigerstripe/annotation/example/person/validators/PersonValidator.java b/plugins/org.eclipse.tigerstripe.annotation.example.person.validators/src/org/eclipse/tigerstripe/annotation/example/person/validators/PersonValidator.java
new file mode 100644
index 0000000..c7a3672
--- /dev/null
+++ b/plugins/org.eclipse.tigerstripe.annotation.example.person.validators/src/org/eclipse/tigerstripe/annotation/example/person/validators/PersonValidator.java
@@ -0,0 +1,54 @@
+/******************************************************************************* 

+ * Copyright (c) 2008 xored software, Inc.  

+ * 

+ * All rights reserved. This program and the accompanying materials 

+ * are made available under the terms of the Eclipse Public License v1.0 

+ * which accompanies this distribution, and is available at 

+ * http://www.eclipse.org/legal/epl-v10.html  

+ * 

+ * Contributors: 

+ *     xored software, Inc. - initial API and Implementation (Yuri Strot) 

+ *******************************************************************************/

+package org.eclipse.tigerstripe.annotation.example.person.validators;

+

+import org.eclipse.core.runtime.IStatus;

+import org.eclipse.emf.ecore.EObject;

+import org.eclipse.emf.validation.AbstractModelConstraint;

+import org.eclipse.emf.validation.EMFEventType;

+import org.eclipse.emf.validation.IValidationContext;

+import org.eclipse.tigerstripe.annotation.example.person.Person;

+

+/**

+ * @author Yuri Strot

+ *

+ */

+public class PersonValidator extends AbstractModelConstraint {

+

+    public IStatus validate(IValidationContext ctx) {

+		EObject eObj = ctx.getTarget();

+		EMFEventType eType = ctx.getEventType();

+		

+		// In the case of batch mode.

+		int age = 0;

+		if (eType == EMFEventType.NULL) {

+			if (eObj instanceof Person) {

+				age = ((Person)eObj).getAge();

+			}

+			

+		// In the case of live mode.

+		} else {

+			Object newValue = ctx.getFeatureNewValue();

+			if (newValue instanceof Integer) {

+				age = ((Integer)newValue).intValue();

+			}

+		}

+		

+		if (age < 0)

+			return ctx.createFailureStatus(new Object[] { "negative" });

+		if (age >= 100)

+			return ctx.createFailureStatus(new Object[] { "greater than 100 years" });

+		

+		return ctx.createSuccessStatus();

+    }

+

+}