1
2
3 package net.sourceforge.pmd.lang.jsp.ast;
4
5 public class ASTAttribute extends AbstractJspNode {
6
7 private String name;
8
9
10
11
12 public String getName() {
13 return name;
14 }
15
16
17
18
19 public void setName(String name) {
20 this.name = name;
21 }
22
23
24
25
26
27 public boolean isHasNamespacePrefix() {
28 return name.indexOf(':') >= 0;
29 }
30
31
32
33
34 public String getNamespacePrefix() {
35 int colonIndex = name.indexOf(':');
36 return colonIndex >= 0
37 ? name.substring(0, colonIndex)
38 : "";
39 }
40
41
42
43
44
45 public String getLocalName() {
46 int colonIndex = name.indexOf(':');
47 return colonIndex >= 0
48 ? name.substring(colonIndex + 1)
49 : name;
50 }
51
52
53
54
55 public ASTAttribute(int id) {
56 super(id);
57 }
58
59 public ASTAttribute(JspParser p, int id) {
60 super(p, id);
61 }
62
63
64
65
66
67 public Object jjtAccept(JspParserVisitor visitor, Object data) {
68 return visitor.visit(this, data);
69 }
70 }