01: package org.drools.lang;
02:
03: /*
04: * Copyright 2005 JBoss Inc
05: *
06: * Licensed under the Apache License, Version 2.0 (the "License");
07: * you may not use this file except in compliance with the License.
08: * You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing, software
13: * distributed under the License is distributed on an "AS IS" BASIS,
14: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15: * See the License for the specific language governing permissions and
16: * limitations under the License.
17: */
18:
19: import java.io.IOException;
20: import java.io.Reader;
21: import java.util.HashSet;
22: import java.util.List;
23: import java.util.Set;
24:
25: import org.drools.lang.dsl.DSLMapping;
26:
27: public class MockExpander implements Expander {
28:
29: private int timesCalled = 0;
30: public Set patterns = new HashSet();
31:
32: public String expand(final String scope, final String pattern) {
33:
34: this .patterns.add(scope + "," + pattern);
35:
36: final int grist = (++this .timesCalled);
37: return "foo" + grist + " : Bar(a==" + grist + ")";
38: }
39:
40: public boolean checkPattern(final String pat) {
41: return this .patterns.contains(pat);
42: }
43:
44: public void addDSLMapping(final DSLMapping mapping) {
45: // TODO Auto-generated method stub
46:
47: }
48:
49: public String expand(final Reader drl) throws IOException {
50: // TODO Auto-generated method stub
51: return null;
52: }
53:
54: public String expand(final String source) {
55: // TODO Auto-generated method stub
56: return null;
57: }
58:
59: public List getErrors() {
60: // TODO Auto-generated method stub
61: return null;
62: }
63:
64: public boolean hasErrors() {
65: // TODO Auto-generated method stub
66: return false;
67: }
68:
69: }
|