~ubuntu-branches/ubuntu/karmic/qdox/karmic

« back to all changes in this revision

Viewing changes to src/java/com/thoughtworks/qdox/model/AbstractJavaEntity.java

  • Committer: Bazaar Package Importer
  • Author(s): Ludovic Claude
  • Date: 2009-09-02 22:22:10 UTC
  • mfrom: (4.2.1 experimental) (4.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090902222210-814b8tibw8z1eo3h
Tags: 1.9.2-1
* New upstream version
* Bump up Standards-Version to 3.8.3
* Add Build-Depends on openjdk-6-doc (Closes: #543112)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
package com.thoughtworks.qdox.model;
2
2
 
3
 
import java.io.Serializable;
4
3
import java.util.ArrayList;
5
4
import java.util.Arrays;
6
5
import java.util.Iterator;
7
6
import java.util.List;
8
7
 
9
 
public abstract class AbstractJavaEntity implements Serializable, Comparable {
 
8
public abstract class AbstractJavaEntity extends AbstractBaseJavaEntity implements Comparable {
10
9
 
11
 
    protected String name;
12
10
    protected List modifiers = new ArrayList();
13
11
    private String comment;
14
12
    private DocletTag[] tags = new DocletTag[0];
15
 
    private JavaClassParent parent;
16
 
    private int lineNumber = -1;
17
 
 
18
 
    public int getLineNumber() {
19
 
        return lineNumber;
20
 
    }
21
 
 
22
 
    public String getName() {
23
 
        return name;
24
 
    }
25
 
 
26
13
    /**
27
14
     * Return list of modifiers as Strings.
28
15
     * (public, private, protected, final, abstract, static)
109
96
        }
110
97
    }
111
98
 
112
 
    public String toString() {
 
99
    public String getCodeBlock() {
113
100
        IndentBuffer result = new IndentBuffer();
114
101
        write(result);
115
102
        return result.toString();
122
109
 
123
110
    protected abstract void writeBody(IndentBuffer result);
124
111
 
125
 
    public void setName(String name) {
126
 
        this.name = name;
127
 
    }
128
 
 
129
112
    public void setModifiers(String[] modifiers) {
130
113
        this.modifiers = Arrays.asList(modifiers);
131
114
    }
226
209
        }
227
210
    }
228
211
    
229
 
    public JavaClassParent getParent() { 
230
 
        return parent; 
231
 
    } 
232
 
 
233
212
    public JavaSource getSource() { 
234
213
        return parent.getParentSource(); 
235
214
    }
236
215
 
237
 
    public void setLineNumber(int lineNumber) {
238
 
        this.lineNumber = lineNumber;
239
 
    }
240
 
    
241
 
    public void setParent(JavaClassParent parent) { 
242
 
        this.parent = parent;
243
 
    }
244
 
 
245
216
}