01: package org.drools.lang.descr;
02:
03: import java.util.List;
04:
05: /*
06: * Copyright 2005 JBoss Inc
07: *
08: * Licensed under the Apache License, Version 2.0 (the "License");
09: * you may not use this file except in compliance with the License.
10: * You may obtain a copy of the License at
11: *
12: * http://www.apache.org/licenses/LICENSE-2.0
13: *
14: * Unless required by applicable law or agreed to in writing, software
15: * distributed under the License is distributed on an "AS IS" BASIS,
16: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17: * See the License for the specific language governing permissions and
18: * limitations under the License.
19: */
20:
21: /**
22: * This represents a literal node in the rule language. This is
23: * a constraint on a single field of a pattern.
24: * The "text" contains the content, which may also be an enumeration.
25: */
26: public class FieldConstraintDescr extends BaseDescr {
27:
28: private static final long serialVersionUID = 400L;
29: private String fieldName;
30: private RestrictionConnectiveDescr restriction = new RestrictionConnectiveDescr(
31: RestrictionConnectiveDescr.AND);
32:
33: public FieldConstraintDescr(final String fieldName) {
34: this .fieldName = fieldName;
35: }
36:
37: public String getFieldName() {
38: return this .fieldName;
39: }
40:
41: public void addRestriction(final RestrictionDescr restriction) {
42: this .restriction.addRestriction(restriction);
43: }
44:
45: public List getRestrictions() {
46: return this .restriction.getRestrictions();
47: }
48:
49: public RestrictionConnectiveDescr getRestriction() {
50: return this.restriction;
51: }
52:
53: }
|