View Javadoc

1   /*
2    * Copyright (c) 2001-2003 The XDoclet team
3    * All rights reserved.
4    */
5   package xjavadoc;
6   
7   import java.lang.reflect.Modifier;
8   
9   /***
10   * @author    Ara Abrahamian (ara_e_w@yahoo.com)
11   * @author    Aslak Hellesøy
12   * @created   Feb 15, 2002
13   * @version   $Revision: 1.17 $
14   */
15  final class FieldImpl extends MemberImpl implements XField
16  {
17  	private String     _type;
18  	private int        _dimension;
19  
20  	public FieldImpl( AbstractClass containingClass, XTagFactory tagFactory )
21  	{
22  		super( containingClass, tagFactory );
23  	}
24  
25  	public final boolean isTransient()
26  	{
27  		return ( getModifierSpecifier() & Modifier.TRANSIENT ) != 0;
28  	}
29  
30  	public final boolean isVolatile()
31  	{
32  		return ( getModifierSpecifier() & Modifier.VOLATILE ) != 0;
33  	}
34  
35  	public int getDimension()
36  	{
37  		return _dimension;
38  	}
39  
40  	public String getTypeAsString()
41  	{
42  		return _type;
43  	}
44  
45  	public String getDimensionAsString()
46  	{
47  		return Util.appendDimensionAsString( getDimension(), new StringBuffer() ).toString();
48  	}
49  
50  	public XClass getType()
51  	{
52  		return getContainingAbstractClass().qualify( _type );
53  	}
54  
55  	public XProgramElement getSuperElement()
56  	{
57  		return null;
58  	}
59  
60  	public void setType( String type )
61  	{
62  		_type = type;
63  	}
64  
65  	public void setDimension( int dimension )
66  	{
67  		_dimension = dimension;
68  	}
69  
70  	public String toString()
71  	{
72  		return getModifiers() + " " + getTypeAsString() + Util.appendDimensionAsString( getDimension(), new StringBuffer() ).toString() + " " +
73  			getName();
74  	}
75  }