1 19 20 package org.netbeans.modules.lexer.demo; 21 22 import org.netbeans.api.lexer.Token; 23 import org.netbeans.api.lexer.TokenId; 24 import org.netbeans.spi.lexer.inc.RawOffsetToken; 25 import org.netbeans.spi.lexer.util.IntegerCache; 26 27 33 34 public class StringToken implements Token { 35 36 private final TokenId id; 37 38 private final String text; 39 40 StringToken(TokenId id, String text) { 41 if (id == null) { 42 throw new NullPointerException (); 43 } 44 45 if (text == null) { 46 throw new NullPointerException (); 47 } 48 49 this.id = id; 50 this.text = text; 51 } 52 53 public TokenId getId() { 54 return id; 55 } 56 57 public CharSequence getText() { 58 return (CharSequence )(Object )text; } 60 61 public String toString() { 62 return text; 63 } 64 65 } 66 67 | Popular Tags |