@Override protected String resolveText() { final Writer stringWriter = new FastStringWriter(); produceEscapedOutput(stringWriter); return stringWriter.toString(); }
final FastStringWriter writer = new FastStringWriter(200); writer.write("["); writer.write(commentStr, parsingResult.getStartExpressionOffset(), parsingResult.getStartExpressionLen()); writer.write("]>"); writer.write("<!["); writer.write(commentStr, parsingResult.getEndExpressionOffset(), parsingResult.getEndExpressionLen()); writer.write("]"); structureHandler.setContent(writer.toString());
public final String process(final TemplateSpec templateSpec, final IContext context) { final Writer stringWriter = new FastStringWriter(100); process(templateSpec, context, stringWriter); return stringWriter.toString(); }
@Override protected String produceEscapedOutput(final Object input) { final Writer jsWriter = new FastStringWriter(input instanceof String? ((String)input).length() * 2 : 20); this.serializer.serializeValue(input, jsWriter); return jsWriter.toString(); }
@Override protected String produceEscapedOutput(final Object input) { final Writer cssWriter = new FastStringWriter(input instanceof String? ((String)input).length() * 2 : 20); this.serializer.serializeValue(input, cssWriter); return cssWriter.toString(); }
@Override public final String toString() { final Writer stringWriter = new FastStringWriter(); try { write(stringWriter); } catch (final IOException e) { throw new TemplateProcessingException("Exception while creating String representation of model entity", e); } return stringWriter.toString(); }
@Override public String toString() { final Writer stringWriter = new FastStringWriter(); try { write(stringWriter); } catch (final IOException e) { throw new TemplateProcessingException("Exception while creating String representation of model entity", e); } return stringWriter.toString(); }
@Override public String toString() { final Writer stringWriter = new FastStringWriter(); try { write(stringWriter); } catch (final IOException e) { throw new TemplateProcessingException("Exception processing String form of ElementAttributes", e); } return stringWriter.toString(); }
@Override public String toString() { final Writer stringWriter = new FastStringWriter(); try { write(stringWriter); } catch (final IOException e) { // Should never happen! throw new TemplateProcessingException("Error computing attribute representation", e); } return stringWriter.toString(); }
@Override public final String toString() { try { final Writer writer = new FastStringWriter(); write(writer); return writer.toString(); } catch (final IOException e) { throw new TemplateProcessingException( "Error while creating String representation of model"); } }
@Override public final String toString() { try { final Writer writer = new FastStringWriter(); write(writer); return writer.toString(); } catch (final IOException e) { throw new TemplateProcessingException( "Error while creating String representation of model"); } }
@Override protected String resolveText() { final Writer stringWriter = new FastStringWriter(); this.context.getConfiguration().getTemplateManager().process(this.templateModel, this.context, stringWriter); return stringWriter.toString(); }
private CharSequence inlineSwitchTemplateMode(final ITemplateContext context, final IText text) { final TemplateManager templateManager = context.getConfiguration().getTemplateManager(); final TemplateModel templateModel = templateManager.parseString( context.getTemplateData(), text.getText(), text.getLine(), text.getCol(), this.templateMode, true); if (!this.writeTextsToOutput) { final Writer stringWriter = new FastStringWriter(50); templateManager.process(templateModel, context, stringWriter); return stringWriter.toString(); } // If we can directly write to output (and text is an IText), we will use a LazyProcessingCharSequence return new LazyProcessingCharSequence(context, templateModel); }
private CharSequence inlineSwitchTemplateMode(final ITemplateContext context, final ICDATASection cdataSection) { final TemplateManager templateManager = context.getConfiguration().getTemplateManager(); /* * Notice we are ONLY processing the contents of the CDATA, because we know the target inlining * mode will not understand the CDATA (it will be textual) and we don't want it to mess around with * the CDATA's prefix and suffix. * * Note this will only be executed in markup modes (textual modes never fire "handleCDATASection" events), * so we are safe assuming the sizes of CDATA prefixes and suffixes in HTML/XML. */ final TemplateModel templateModel = templateManager.parseString( context.getTemplateData(), cdataSection.getContent(), cdataSection.getLine(), cdataSection.getCol() + 9, // +9 because of the prefix this.templateMode, true); final Writer stringWriter = new FastStringWriter(50); templateManager.process(templateModel, context, stringWriter); return stringWriter.toString(); }
private CharSequence inlineSwitchTemplateMode(final ITemplateContext context, final IComment comment) { final TemplateManager templateManager = context.getConfiguration().getTemplateManager(); /* * Notice we are ONLY processing the contents of the Comment, because we know the target inlining * mode will not understand the Comment (it will be textual) and we don't want it to mess around with * the Comment's prefix and suffix. * * Note this will only be executed in markup modes (textual modes never fire "handleComment" events), * so we are safe assuming the sizes of Comment prefixes and suffixes in HTML/XML. */ final TemplateModel templateModel = templateManager.parseString( context.getTemplateData(), comment.getContent(), comment.getLine(), comment.getCol() + 4, // +4 because of the prefix this.templateMode, true); final Writer stringWriter = new FastStringWriter(50); templateManager.process(templateModel, context, stringWriter); return stringWriter.toString(); }
TemplateMode.JAVASCRIPT, true); final Writer stringWriter = new FastStringWriter(50); templateManager.process(templateModel, context, stringWriter);
final Writer stringWriter = new FastStringWriter(200); configuration.getTemplateManager().process(fragmentModel, context, stringWriter);
(producePartialOutputWhileProcessing? response.getWriter() : new FastStringWriter(1024));
(producePartialOutputWhileProcessing? response.getWriter() : new FastStringWriter(1024));
(producePartialOutputWhileProcessing? response.getWriter() : new FastStringWriter(1024));