KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > forms > formmodel > tree > SourceTreeModelDefinition


1 /*
2  * Copyright 1999-2005 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.cocoon.forms.formmodel.tree;
17
18 import org.apache.excalibur.source.SourceResolver;
19
20 /**
21  * Definition for {@link SourceTreeModel}
22  *
23  * @version $Id: SourceTreeModelDefinition.java 190962 2005-06-16 17:17:00Z sylvain $
24  */

25 public class SourceTreeModelDefinition implements TreeModelDefinition {
26
27     public static final int[][] NO_PATTERNS = new int[0][];
28     private String JavaDoc url;
29     private int[][] fileIncludePatterns = NO_PATTERNS;
30     private int[][] fileExcludePatterns = NO_PATTERNS;
31     private int[][] dirIncludePatterns = NO_PATTERNS;
32     private int[][] dirExcludePatterns = NO_PATTERNS;
33     private SourceResolver resolver;
34
35     public void setURL(String JavaDoc url) {
36         this.url = url;
37     }
38
39     public void setFilePatterns(int[][] include, int[][] exclude) {
40         this.fileIncludePatterns = include;
41         this.fileExcludePatterns = exclude;
42     }
43
44     public void setDirectoryPatterns(int[][] include, int[][] exclude) {
45         this.dirIncludePatterns = include;
46         this.dirExcludePatterns = exclude;
47     }
48     
49     public TreeModel createInstance() {
50         return new SourceTreeModel(this);
51     }
52
53     public int[][] getDirectoryExcludePatterns() {
54         return dirExcludePatterns;
55     }
56
57     public int[][] getDirectoryIncludePatterns() {
58         return dirIncludePatterns;
59     }
60
61     public int[][] getFileExcludePatterns() {
62         return fileExcludePatterns;
63     }
64
65     public int[][] getFileIncludePatterns() {
66         return fileIncludePatterns;
67     }
68
69     public void setSourceResolver(SourceResolver resolver) {
70         this.resolver = resolver;
71     }
72
73     public String JavaDoc getRootURL() {
74         return this.url;
75     }
76     
77     public SourceResolver getResolver() {
78         return this.resolver;
79     }
80 }
81
Popular Tags