ASTAttribute.java
01 /* Generated By:JJTree: Do not edit this line. ASTAttribute.java */
02 
03 package net.sourceforge.pmd.lang.jsp.ast;
04 
05 public class ASTAttribute extends AbstractJspNode {
06     /* BEGIN CUSTOM CODE */
07     private String name;
08 
09     /**
10      @return Returns the name.
11      */
12     public String getName() {
13         return name;
14     }
15 
16     /**
17      @param name The name to set.
18      */
19     public void setName(String name) {
20         this.name = name;
21     }
22 
23 
24     /**
25      @return boolean - true if the element has a namespace-prefix, false otherwise
26      */
27     public boolean isHasNamespacePrefix() {
28         return name.indexOf(':'>= 0;
29     }
30 
31     /**
32      @return String - the part of the name that is before the (first) colon (":")
33      */
34     public String getNamespacePrefix() {
35         int colonIndex = name.indexOf(':');
36         return colonIndex >= 0
37                 ? name.substring(0, colonIndex)
38                 "";
39     }
40 
41     /**
42      @return String - The part of the name that is after the first colon (":").
43      *         If the name does not contain a colon, the full name is returned.
44      */
45     public String getLocalName() {
46         int colonIndex = name.indexOf(':');
47         return colonIndex >= 0
48                 ? name.substring(colonIndex + 1)
49                 : name;
50     }
51 
52 /* END CUSTOM CODE */
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      * Accept the visitor. *
66      */
67     public Object jjtAccept(JspParserVisitor visitor, Object data) {
68         return visitor.visit(this, data);
69     }
70 }