Package net.java.textilej.parser.tag

Examples of net.java.textilej.parser.tag.ReplacementTokenProcessor


      throw new IllegalStateException();
    }
    Matcher replacementMatcher = REPLACEMENT_PATTERN.matcher(textileMarkup);
    int lastOffset = 0;
   
    ReplacementTokenProcessor replacementTokenProcessor = null;
    final int textileMarkupLength = textileMarkup.length();
    for (;;) {
      if (dialect != null && (replacementTokenProcessor == null || replacementTokenProcessor.getLineStartOffset() < lastOffset)) {
        replacementTokenProcessor = dialect.findReplacementToken(textileMarkup, lastOffset);
      }
     
      if (lastOffset > 0 && dialect != null) {
        replacementMatcher.region(lastOffset, textileMarkupLength);
      }
      int offset = -1;
     
      if (replacementMatcher.find()) {
        offset = replacementMatcher.start();
      }
      if (replacementTokenProcessor != null) {
        if (offset == -1 || replacementTokenProcessor.getLineStartOffset() < offset) {
          offset = replacementTokenProcessor.getLineStartOffset();
          if (lastOffset < offset) {
            String t = textileMarkup.substring(lastOffset,offset);
            builder.characters(t);
          }
          replacementTokenProcessor.setParser(this);
          replacementTokenProcessor.setParserServices(services);
          replacementTokenProcessor.setBuilder(builder);
          replacementTokenProcessor.setTextile(state.textile);
          replacementTokenProcessor.emitTokenContent();
          lastOffset = replacementTokenProcessor.getLineEndOffset();
          continue;
        }
      }
      if (offset == -1) {
        break;
View Full Code Here

TOP

Related Classes of net.java.textilej.parser.tag.ReplacementTokenProcessor

Copyright © 2018 www.massapicom. 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.