1 19 20 package org.netbeans.spi.lexer; 21 22 import org.netbeans.api.lexer.InputAttributes; 23 import org.netbeans.api.lexer.LanguagePath; 24 import org.netbeans.api.lexer.TokenId; 25 26 33 34 public final class LexerRestartInfo<T extends TokenId> { 35 36 private final LexerInput input; 37 38 private final TokenFactory<T> tokenFactory; 39 40 private final Object state; 41 42 private final LanguagePath languagePath; 43 44 private final InputAttributes inputAttributes; 45 46 LexerRestartInfo(LexerInput input, 47 TokenFactory<T> tokenFactory, Object state, 48 LanguagePath languagePath, InputAttributes inputAttributes) { 49 this.input = input; 50 this.tokenFactory = tokenFactory; 51 this.state = state; 52 this.languagePath = languagePath; 53 this.inputAttributes = inputAttributes; 54 } 55 56 public LexerInput input() { 57 return input; 58 } 59 60 public TokenFactory<T> tokenFactory() { 61 return tokenFactory; 62 } 63 64 public Object state() { 65 return state; 66 } 67 68 public LanguagePath languagePath() { 69 return languagePath; 70 } 71 72 public InputAttributes inputAttributes() { 73 return inputAttributes; 74 } 75 76 public Object getAttributeValue(Object key) { 77 return (inputAttributes != null) 78 ? inputAttributes.getValue(languagePath, key) 79 : null; 80 } 81 82 } 83 | Popular Tags |