01: package org.drools.lang.descr;
02:
03: /**
04: * This is the factory for ALL descriptors (eventually).
05: * This will be tied in a with a package builder session, so it can add in context information for
06: * validation when parsing.
07: *
08: * @author Michael Neale
09: *
10: */
11: public class DescrFactory {
12:
13: public PackageDescr createPackage(final String packageName) {
14: return new PackageDescr(packageName);
15: }
16:
17: public GlobalDescr createGlobal() {
18: return new GlobalDescr();
19: }
20:
21: public FromDescr createFrom() {
22: return new FromDescr();
23: }
24:
25: public AccumulateDescr createAccumulate() {
26: return new AccumulateDescr();
27: }
28:
29: public CollectDescr createCollect() {
30: return new CollectDescr();
31: }
32:
33: public ForallDescr createForall() {
34: return new ForallDescr();
35: }
36:
37: public ImportDescr createImport() {
38: return new ImportDescr();
39: }
40:
41: public FunctionImportDescr createFunctionImport() {
42: return new FunctionImportDescr();
43: }
44:
45: public QueryDescr createQuery(final String queryName) {
46: return new QueryDescr(queryName, "");
47: }
48:
49: public FunctionDescr createFunction(final String functionName,
50: final String returnType) {
51: return new FunctionDescr(functionName, returnType);
52: }
53:
54: public FactTemplateDescr createFactTemplate(
55: final String templateName) {
56: return new FactTemplateDescr(templateName);
57: }
58:
59: public FieldTemplateDescr createFieldTemplate() {
60: return new FieldTemplateDescr();
61: }
62: }
|