com.google.caja.render
Class JsPrettyPrinter
java.lang.Object
com.google.caja.render.BufferingRenderer
com.google.caja.render.JsPrettyPrinter
- All Implemented Interfaces:
- TokenConsumer
public final class JsPrettyPrinter
- extends BufferingRenderer
A formatter that indents code for a C-style language with statement
delimited by curly brackets, and expression blocks delimited by
square brackets and parentheses.
- Author:
- mikesamuel@gmail.com
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
lineLengthLimit
private int lineLengthLimit
breakAfterComment
private boolean breakAfterComment
JsPrettyPrinter
public JsPrettyPrinter(Concatenator out)
- Parameters:
out
- receives the rendered text.
setLineLengthLimit
public void setLineLengthLimit(int lineLengthLimit)
getLineLengthLimit
public int getLineLengthLimit()
setBreakAfterComment
public void setBreakAfterComment(boolean breakAfterComment)
isBreakAfterComment
public boolean isBreakAfterComment()
splitTokens
java.util.List<java.lang.String> splitTokens(java.util.List<java.lang.Object> tokens)
- Description copied from class:
BufferingRenderer
- Generates a list of output tokens consisting of non-whitespace tokens,
space tokens (
" "
) and newline tokens ('\n'
followed by
any number of spaces).
- Specified by:
splitTokens
in class BufferingRenderer
- Parameters:
tokens
- a heterogeneous array containing String
tokens and
FilePosition
marks.
- Returns:
- the strings in tokens in order with newline and space tokens
inserted as appropriate.
Copyright (C) 2008 Google Inc.
Licensed under the Apache License, Version 2.0