1 2 3 package net.sourceforge.pmd.jsp.ast; 4 5 public class ASTAttribute extends SimpleNode { 6 7 private String name; 8 9 12 public String getName() { 13 return name; 14 } 15 16 19 public void setName(String name) { 20 this.name = name; 21 } 22 23 24 27 public boolean isHasNamespacePrefix() { 28 return (name.indexOf(':') >= 0); 29 } 30 31 34 public String getNamespacePrefix() { 35 int colonIndex = name.indexOf(':'); 36 return ((colonIndex >= 0) 37 ? name.substring(0, colonIndex) 38 : ""); 39 } 40 41 45 public String getLocalName() { 46 int colonIndex = name.indexOf(':'); 47 return ((colonIndex >= 0) 48 ? name.substring(colonIndex + 1) 49 : name); 50 } 51 52 55 public String toString(String prefix) { 56 return super.toString(prefix) + " name=[" + name + "]"; 57 } 58 59 60 61 62 public ASTAttribute(int id) { 63 super(id); 64 } 65 66 public ASTAttribute(JspParser p, int id) { 67 super(p, id); 68 } 69 70 71 74 public Object jjtAccept(JspParserVisitor visitor, Object data) { 75 return visitor.visit(this, data); 76 } 77 } 78 | Popular Tags |