Examples of Token


Examples of org.sonar.duplications.token.Token

public class ForgetLastTokenMatcherTest {

  @Test
  public void shouldMatch() {
    TokenQueue tokenQueue = spy(new TokenQueue());
    Token token = new Token("a", 0, 0);
    List<Token> output = Lists.newArrayList(token);
    ForgetLastTokenMatcher matcher = new ForgetLastTokenMatcher();

    assertThat(matcher.matchToken(tokenQueue, output), is(true));
    assertThat(output.size(), is(0));
View Full Code Here

Examples of org.spoofax.jsglr.client.imploder.Token

    }
   
    HashMap<String, String> cache = new HashMap<String, String>();
   
    for (int i = left.getIndex(), max = right.getIndex(); i <= max; i++) {
      Token tok = ((Token) left.getTokenizer().getTokenAt(i));
      if (tok.getError() == null || tok.getError().isEmpty())
        tok.setError(msg);
      else {
        StringBuilder b = new StringBuilder();
        b.append(tok.getError());
        b.append("<br>");
        b.append(msg);
        String key = b.toString();
        String val = cache.get(key);
        if (val == null) {
          val = key;
          cache.put(key, val);
        }
        tok.setError(val);
      }
     
      if (tok.getTokenizer().getInput().length() <= tok.getStartOffset() || tok.getTokenizer().getInput().charAt(tok.getStartOffset()) == '\n')
        break;
    }
  }
View Full Code Here

Examples of org.springframework.security.core.token.Token

    }

    @Test
    public void testOperationWithSimpleExtendedInformation() {
        KeyBasedPersistenceTokenService service = getService();
        Token token = service.allocateToken("Hello world");
        Token result = service.verifyToken(token.getKey());
        Assert.assertEquals(token, result);
    }
View Full Code Here

Examples of org.springframework.xd.dirt.stream.dsl.Token

      tokenPointer--;
    }

    StringBuilder prefix = null;
    for (prefix = new StringBuilder(); tokenPointer < tokens.size(); tokenPointer++) {
      Token t = tokens.get(tokenPointer);
      if (t.isIdentifier()) {
        prefix.append(t.stringValue());
      }
      else {
        prefix.append(t.getKind().getTokenChars());
      }
    }

    List<ModuleDescriptor> parsed = parser.parse("__dummy", safe, toParsingContext(kind));
View Full Code Here

Examples of org.stringtree.mojasef.Token

    public void request(StringKeeper context) {
    StringCollector collector = (StringCollector)context.getObject(MojasefConstants.OUTPUT_COLLECTOR);
    Iterator<Mount> it = mounts.iterator();
        String path = context.get(MojasefConstants.REQUEST_LOCALPATH);
        Token status = Token.CONTINUE;
       
    while (status == Token.CONTINUE && it.hasNext()) {
      Mount mount = it.next();
      if (mount.match(path, context)) {
        status = Mojasef.delegate(collector, context, mount.getApplication());
View Full Code Here

Examples of org.supercsv.cellprocessor.Token

                } else {
                    throw SupportLogger.LOGGER.invalidParamsForCellProcessor(name, params);
                }
            } else if (name.equalsIgnoreCase("Token")) {
                if (params.length == 2) {  //token, replacement
                    current = previous == null ? new Token(params[0], params[1]) :
                            new Token(params[0], params[1], previous);
                } else {
                    throw SupportLogger.LOGGER.invalidParamsForCellProcessor(name, params);
                }
            } else if (name.equalsIgnoreCase("StrReplace")) {
                if (params.length == 2) {  //regex, replacement
View Full Code Here

Examples of org.syntax.jedit.tokenmarker.Token

     * If syntax coloring is enabled, we have to do this because tokens can
     * vary in width
     */
    else
    {
      Token tokens;
      if( painter.currentLineIndex == line && painter.currentLineTokens != null )
        tokens = painter.currentLineTokens;
      else
      {
        painter.currentLineIndex = line;
View Full Code Here

Examples of org.waveprotocol.wave.model.richtext.RichTextTokenizerImpl.Token

  protected RichTextTokenizer tokenize(String xmlString) {
    return new RichTextTokenizerImpl<Node, Element, Text>(parseDocumentContents(xmlString));
  }

  private Token token(RichTextTokenizer.Type type) {
    return new Token(type, null);
  }
View Full Code Here

Examples of org.xhtmlrenderer.css.parser.Token

            List consecutiveIdents = new ArrayList();
            List normalized = new ArrayList(values.size());
            for (Iterator i = values.iterator(); i.hasNext(); ) {
                PropertyValue value = (PropertyValue)i.next();
               
                Token operator = value.getOperator();
                if (operator != null && operator != Token.TK_COMMA) {
                    throw new CSSParseException("Invalid font-family definition", -1);
                }
               
                if (operator != null) {
View Full Code Here

Examples of org.yaml.snakeyaml.tokens.Token

        }
        if (!tokens.isEmpty()) {
            if (choices.length == 0) {
                return true;
            }
            Token first = this.tokens.get(0);
            for (Token.ID choice : choices) {
                if (first.getTokenId() == choice) {
                    return true;
                }
            }
        }
        return false;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.