KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > aop > pointcut > ast > ASTField


1 /*
2   * JBoss, Home of Professional Open Source
3   * Copyright 2005, JBoss Inc., and individual contributors as indicated
4   * by the @authors tag. See the copyright.txt in the distribution for a
5   * full listing of individual contributors.
6   *
7   * This is free software; you can redistribute it and/or modify it
8   * under the terms of the GNU Lesser General Public License as
9   * published by the Free Software Foundation; either version 2.1 of
10   * the License, or (at your option) any later version.
11   *
12   * This software is distributed in the hope that it will be useful,
13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15   * Lesser General Public License for more details.
16   *
17   * You should have received a copy of the GNU Lesser General Public
18   * License along with this software; if not, write to the Free
19   * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20   * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21   */

22
23 package org.jboss.aop.pointcut.ast;
24
25 import java.util.ArrayList JavaDoc;
26
27 public class ASTField extends SimpleNode
28 {
29    public ASTField(int id)
30    {
31       super(id);
32    }
33
34    public ASTField(PointcutExpressionParser p, int id)
35    {
36       super(p, id);
37    }
38
39
40    /** Accept the visitor. **/
41    public Object JavaDoc jjtAccept(PointcutExpressionParserVisitor visitor, Object JavaDoc data)
42    {
43       return visitor.visit(this, data);
44    }
45    /** Accept the visitor. **/
46    public Object JavaDoc jjtAccept(TypeExpressionParserVisitor visitor, Object JavaDoc data)
47    {
48       return visitor.visit(this, data);
49    }
50
51    String JavaDoc typeExpression;
52    ClassExpression type;
53    String JavaDoc classExpr;
54    ClassExpression clazz;
55    String JavaDoc fieldExpr;
56    IdentifierExpression fieldIdentifier;
57    ArrayList JavaDoc attributes = new ArrayList JavaDoc();
58
59    public void jjtAddChild(Node n, int i)
60    {
61       if (n instanceof ASTAttribute) attributes.add(n);
62    }
63
64    public void setTypeExpression(String JavaDoc type)
65    {
66       this.typeExpression = type;
67       this.type = new ClassExpression(type);
68    }
69
70    public String JavaDoc getTypeExpression()
71    {
72       return typeExpression;
73    }
74
75    public String JavaDoc getClassExpr()
76    {
77       return classExpr;
78    }
79
80    public String JavaDoc getFieldExpr()
81    {
82       return fieldExpr;
83    }
84
85    public void setClassExpr(String JavaDoc classExpr)
86    {
87       this.classExpr = classExpr;
88       clazz = new ClassExpression(classExpr);
89    }
90
91    public void setFieldExpr(String JavaDoc fieldExpr)
92    {
93       this.fieldExpr = fieldExpr;
94       fieldIdentifier = new IdentifierExpression(fieldExpr);
95    }
96
97    public ArrayList JavaDoc getAttributes()
98    {
99       return attributes;
100    }
101
102    public ClassExpression getType()
103    {
104       return type;
105    }
106
107    public ClassExpression getClazz()
108    {
109       return clazz;
110    }
111
112    public IdentifierExpression getFieldIdentifier()
113    {
114       return fieldIdentifier;
115    }
116 }
117
Popular Tags