1 2 3 package net.sourceforge.pmd.jsp.ast; 4 5 public class ASTElement extends SimpleNode { 6 7 8 9 12 private String name; 13 14 17 private boolean empty; 19 20 23 public boolean isHasNamespacePrefix() { 24 return (name.indexOf(':') >= 0); 25 } 26 27 30 public String getNamespacePrefix() { 31 int colonIndex = name.indexOf(':'); 32 return ((colonIndex >= 0) 33 ? name.substring(0, colonIndex) 34 : ""); 35 } 36 37 41 public String getLocalName() { 42 int colonIndex = name.indexOf(':'); 43 return ((colonIndex >= 0) 44 ? name.substring(colonIndex + 1) 45 : name); 46 } 47 48 51 public String getName() { 52 return name; 53 } 54 55 58 public void setName(String name) { 59 this.name = name; 60 } 61 62 65 public boolean isEmpty() { 66 return empty; 67 } 68 69 72 public void setEmpty(boolean empty) { 73 this.empty = empty; 74 } 75 76 79 public String toString(String prefix) { 80 return super.toString(prefix) + " name=[" + name + "] "; 81 } 82 83 84 85 86 public ASTElement(int id) { 87 super(id); 88 } 89 90 public ASTElement(JspParser p, int id) { 91 super(p, id); 92 } 93 94 95 98 public Object jjtAccept(JspParserVisitor visitor, Object data) { 99 return visitor.visit(this, data); 100 } 101 } 102 | Popular Tags |