public final class StreamingEscaper extends LoggingAdvisingAppendable
LoggingAdvisingAppendable that applies escaping
logic to untrusted content.LoggingAdvisingAppendable.BufferingAppendable| Modifier and Type | Method and Description |
|---|---|
LoggingAdvisingAppendable |
append(char c) |
LoggingAdvisingAppendable |
append(CharSequence csq) |
LoggingAdvisingAppendable |
append(CharSequence csq,
int start,
int end) |
LoggingAdvisingAppendable |
appendLoggingFunctionInvocation(LoggingFunctionInvocation funCall,
com.google.common.collect.ImmutableList<com.google.common.base.Function<String,String>> escapers)
Called whenever a logging function is being rendered.
|
static StreamingEscaper |
create(LoggingAdvisingAppendable delegate,
EscapingConventions.CrossLanguageStringXform transform)
Creates a streaming escaper, or returns the delegate if it is already escaping with the same
settings.
|
LoggingAdvisingAppendable |
enterLoggableElement(LogStatement statement)
Called whenever a loggable element is entered.
|
LoggingAdvisingAppendable |
exitLoggableElement()
Called whenever a loggable element is exited.
|
boolean |
softLimitReached()
Indicates that an internal limit has been reached or exceeded and that write operations should
be suspended soon.
|
buffering, delegating, escapePlaceholder, getSanitizedContentDirectionality, getSantizedContentKind, notifyContentDirectionality, notifyContentKind, setSanitizedContentDirectionality, setSanitizedContentKind, stringCoercingpublic static StreamingEscaper create(LoggingAdvisingAppendable delegate, EscapingConventions.CrossLanguageStringXform transform)
public final LoggingAdvisingAppendable append(CharSequence csq) throws IOException
append in interface AdvisingAppendableappend in interface Appendableappend in class LoggingAdvisingAppendableIOExceptionpublic final LoggingAdvisingAppendable append(CharSequence csq, int start, int end) throws IOException
append in interface AdvisingAppendableappend in interface Appendableappend in class LoggingAdvisingAppendableIOExceptionpublic final LoggingAdvisingAppendable append(char c) throws IOException
append in interface AdvisingAppendableappend in interface Appendableappend in class LoggingAdvisingAppendableIOExceptionpublic LoggingAdvisingAppendable appendLoggingFunctionInvocation(LoggingFunctionInvocation funCall, com.google.common.collect.ImmutableList<com.google.common.base.Function<String,String>> escapers) throws IOException
LoggingAdvisingAppendableTODO(lukes): come up with a better interface than Function. Maybe Escaper?
appendLoggingFunctionInvocation in class LoggingAdvisingAppendablefunCall - The function invocationescapers - The escapers to apply to the result. NOTE: this should be SoyJavaPrintDirective
or similar but that would cause cycles between soy.data and soy.shared.restrictedIOExceptionpublic final boolean softLimitReached()
AdvisingAppendablepublic LoggingAdvisingAppendable enterLoggableElement(LogStatement statement)
LoggingAdvisingAppendableenterLoggableElement in class LoggingAdvisingAppendablepublic LoggingAdvisingAppendable exitLoggableElement()
LoggingAdvisingAppendableexitLoggableElement in class LoggingAdvisingAppendable