Package br.com.caelum.tubaina

Examples of br.com.caelum.tubaina.TubainaException


 
  private static final String MESSAGE = "[java] Tag is deprecated and can't be used anymore. Use [code java] instead";

  @Inject
  public JavaTag(Indentator indentator) {
    throw new TubainaException(MESSAGE);
  }
View Full Code Here


    throw new TubainaException(MESSAGE);
  }
 
  @Override
  public String parse(JavaChunk chunk) {
    throw new TubainaException(MESSAGE);
  }
View Full Code Here

public class RubyTag implements Tag<RubyChunk> {

  private static final String MESSAGE = "[ruby] Tag is deprecated and can't be used anymore. Use [code ruby] instead";

  public RubyTag(Indentator indentator) {
    throw new TubainaException(MESSAGE);
  }
View Full Code Here

    throw new TubainaException(MESSAGE);
  }
 
  @Override
  public String parse(RubyChunk chunk) {
    throw new TubainaException(MESSAGE);
  }
View Full Code Here

    PrintWriter out = new PrintWriter(writer);
    try {
      Template temp = configuration.getTemplate(template);
      temp.process(map, out);
    } catch (Exception e) {
      throw new TubainaException(e);
    }
    out.flush();
    return writer.getBuffer();
  }
View Full Code Here

  public String parse(String content) {
    int posicaoAtual = escapaAteVerbatim(content, 0);
    while (posicaoAtual < content.length()) {
      int fimVerbatim = content.indexOf("[/verbatim]", posicaoAtual);
      if(naoAchei(fimVerbatim))
        throw new TubainaException("Verbatim missing end tag");
      String literal = content.substring(posicaoAtual + "[verbatim]".length(), fimVerbatim);
      text.append(literal);
      posicaoAtual = escapaAteVerbatim(content, fimVerbatim + "[/verbatim]".length());
    }
    return text.toString();
View Full Code Here

        LOG.warn("Failed to read file", e);
      }
    }
    int maxLineLength = Utilities.maxLineLength(content) - Utilities.getMinIndent(content);
    if(maxLineLength >TubainaBuilder.getCodeLength())
      throw new TubainaException ("Chapter " + ChapterBuilder.getChaptersCount() +
          "  -  Code has " + maxLineLength + " columns out of " + TubainaBuilder.getCodeLength() + ":\n\n" + content);
    return new JavaChunk(options, content);
  }
View Full Code Here

  @Override
  protected Chunk createChunk(String options, String content) {
    List<Chunk> cols = new ChunkSplitter(resources, "row").splitChunks(content);
    if (cols.size() == 0)
      throw new TubainaException("Row without columns inside");
    return new TableRowChunk(cols);
  }
View Full Code Here

  @Override
  public Chunk createChunk(String options, String content) {
    int maxLineLength = Utilities.maxLineLength(content) - Utilities.getMinIndent(content);
    if(maxLineLength >TubainaBuilder.getCodeLength())
      throw new TubainaException ("Chapter " + ChapterBuilder.getChaptersCount() +
          "  -  Code has " + maxLineLength + " columns out of " + TubainaBuilder.getCodeLength() + ":\n\n" + content);
    return new RubyChunk(content, options);
  }
View Full Code Here

        }
      } else { //is closeTag ([/tag])
        if (stack.peek().equalsIgnoreCase(tagName)) {
          stack.pop();
        } else {
          throw new TubainaException("Tag " + tagName + " was closed unproperly");
        }
      }
    }
    if (!stack.isEmpty()) { //tag was not closed properly
      throw new TubainaException("There is(are) unclosed tag(s) : " + stack.toString());
    }
    String content = text.substring(contentStart, contentStart + tagMatcher.start());
   
    chunks.add(createChunk(options, content));
    return text.substring(contentStart + tagMatcher.end());
View Full Code Here

TOP

Related Classes of br.com.caelum.tubaina.TubainaException

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.