KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > java > parser > DocumentModelBuilder


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.java.parser;
21
22 import javax.swing.text.*;
23 import javax.swing.text.Position JavaDoc;
24
25 import org.openide.src.*;
26
27 import org.openide.text.CloneableEditorSupport;
28 import org.openide.text.PositionBounds;
29 import org.openide.text.PositionRef;
30
31 import org.netbeans.modules.java.ElementFactory;
32
33 /**
34  *
35  * @author svata
36  * @version
37  */

38 public class DocumentModelBuilder implements ElementFactory {
39     CloneableEditorSupport editSupp;
40     char[] inputText;
41     boolean computeHash;
42
43     public DocumentModelBuilder(CloneableEditorSupport supp) {
44         this.editSupp = supp;
45     }
46     
47     protected void setContent(char[] content, boolean computeHash) {
48     }
49     
50     public void createPackage(Identifier name, int begin, int end) {
51     }
52     
53     public void createImport(Import im, int begin, int end) {
54     }
55     
56     public Item createClass(boolean isInterface, int modifiers, Identifier name, Identifier superclass, Identifier[] interfaces) {
57     return null;
58     }
59     
60     public Item createConstructor(int modifiers, Identifier id, MethodParameter[] params, Identifier[] exceptions) {
61     return null;
62     }
63     
64     public Item createField(int modifiers, Identifier name, Type type, String JavaDoc initializer) {
65         return null;
66     }
67     
68     public Item createInitializer(int modifiers) {
69         return null;
70     }
71     
72     public Item createMethod(int modifiers, Identifier name, Type returnType, MethodParameter[] params, Identifier[] exceptions) {
73         return null;
74     }
75     
76     public void markError(Item item) {
77         // huh ? attach some error-information-decorator to an element ??
78
}
79     
80     public void setBodyBounds(Item item, int begin, int end) {
81     }
82     
83     public void setBounds(Item item, int begin, int end) {
84     }
85     
86     public void setDocumentation(Item item, int begin, int end, String JavaDoc text) {
87     }
88     
89     public void setFieldTypeBounds(Item item, int begin, int end) {
90     }
91     
92     public void setHeaderBounds(Item item, int begin, int end) {
93     }
94     
95     public void setParent(Item child, Item parent) {
96     }
97     
98     public void setPrecedingField(Item item, Item previous) {
99     }
100
101     protected PositionBounds createAbsorbingBounds(int from, int to) {
102         PositionRef posBegin = editSupp.createPositionRef(from, Position.Bias.Forward);
103         PositionRef posEnd = editSupp.createPositionRef(to, Position.Bias.Backward);
104         return new PositionBounds(posBegin, posEnd);
105     }
106 }
107
Popular Tags