[jboss-svn-commits] JBL Code SVN: r5193 - labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/lang/descr

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Thu Jul 20 11:02:34 EDT 2006


Author: mark.proctor at jboss.com
Date: 2006-07-20 11:02:32 -0400 (Thu, 20 Jul 2006)
New Revision: 5193

Added:
   labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/lang/descr/FieldConstraintDescr.java
Log:
JBRULES-333
-Added new Restriction paradigm, so each FieldConstraint can have multiple restrictions
-Compiler is currently broken, this is being committed so that Mic can fix the parser.

Copied: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/lang/descr/FieldConstraintDescr.java (from rev 5191, labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/lang/descr/FieldConstraint.java)
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/lang/descr/FieldConstraint.java	2006-07-20 14:47:34 UTC (rev 5191)
+++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/lang/descr/FieldConstraintDescr.java	2006-07-20 15:02:32 UTC (rev 5193)
@@ -0,0 +1,51 @@
+package org.drools.lang.descr;
+
+import java.util.List;
+
+/*
+ * Copyright 2005 JBoss Inc
+ * 
+ * Licensed 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.
+ */
+
+/**
+ * This represents a literal node in the rule language. This is
+ * a constraint on a single field of a column. 
+ * The "text" contains the content, which may also be an enumeration. 
+ */
+public class FieldConstraintDescr extends PatternDescr {
+    /**
+     * 
+     */
+    private static final long serialVersionUID = 320;
+    private String  fieldName;
+    private List    restrictions;
+
+    public FieldConstraintDescr(final String fieldName) {
+        this.fieldName = fieldName;
+    }
+
+    public String getFieldName() {
+        return this.fieldName;
+    }
+    
+    public void addRestriction(RestrictionDescr restriction) {
+        this.restrictions.add( restriction );
+    }
+    
+    public List getRestrictions() {
+        return this.restrictions;
+    }
+
+    
+}
\ No newline at end of file




More information about the jboss-svn-commits mailing list