Package net.pterodactylus.sone.text

Examples of net.pterodactylus.sone.text.SoneTextParser


   */
  @Inject
  public WebInterface(SonePlugin sonePlugin) {
    this.sonePlugin = sonePlugin;
    formPassword = sonePlugin.pluginRespirator().getToadletContainer().getFormPassword();
    soneTextParser = new SoneTextParser(getCore(), getCore());

    templateContextFactory = new TemplateContextFactory();
    templateContextFactory.addAccessor(Object.class, new ReflectionAccessor());
    templateContextFactory.addAccessor(Collection.class, new CollectionAccessor());
    templateContextFactory.addAccessor(Sone.class, new SoneAccessor(getCore()));
View Full Code Here


   *            The writer to render the part to
   * @param postPart
   *            The part to render
   */
  private void render(Writer writer, PostPart postPart) {
    SoneTextParser parser = new SoneTextParser(core, core);
    SoneTextParserContext parserContext = new SoneTextParserContext(null, postPart.getPost().getSone());
    try {
      Iterable<Part> parts = parser.parse(parserContext, new StringReader(postPart.getPost().getText()));
      StringBuilder excerpt = new StringBuilder();
      for (Part part : parts) {
        excerpt.append(part.getText());
        if (excerpt.length() > 20) {
          int lastSpace = excerpt.lastIndexOf(" ", 20);
View Full Code Here

TOP

Related Classes of net.pterodactylus.sone.text.SoneTextParser

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.