1 15 package org.apache.tapestry.parse; 16 17 import org.apache.hivemind.Locatable; 18 import org.apache.hivemind.Location; 19 import org.apache.hivemind.util.ToStringBuilder; 20 21 28 29 public abstract class TemplateToken implements Locatable 30 { 31 private TokenType _type; 32 33 private Location _location; 34 35 protected TemplateToken(TokenType type, Location location) 36 { 37 _type = type; 38 _location = location; 39 } 40 41 public TokenType getType() 42 { 43 return _type; 44 } 45 46 public Location getLocation() 47 { 48 return _location; 49 } 50 51 public String toString() 52 { 53 ToStringBuilder builder = new ToStringBuilder(this); 54 55 builder.append("type", _type.getName()); 56 builder.append("location", _location); 57 58 extendDescription(builder); 59 60 return builder.toString(); 61 } 62 63 70 71 protected void extendDescription(ToStringBuilder builder) 72 { 73 } 74 } | Popular Tags |