public abstract class SoyParsingContext extends Object
Important: Do not use outside of Soy code (treat as superpackage-private).
| Constructor and Description |
|---|
SoyParsingContext() |
| Modifier and Type | Method and Description |
|---|---|
static SoyParsingContext |
create(ErrorReporter errorReporter,
String namespace,
com.google.common.collect.ImmutableMap<String,String> aliasToNamespaceMap) |
static SoyParsingContext |
empty(ErrorReporter errorReporter,
String namespace) |
abstract ErrorReporter |
errorReporter() |
static SoyParsingContext |
exploding()
Creates a context with an exploding error reporter and no contextual data.
|
abstract String |
namespace()
The full namespace of the file being parsed, or null for legacy v1 templates.
|
void |
report(SourceLocation sourceLocation,
SoyErrorKind error,
Object... args)
Reports the given
error, formatted according to args and associated with
the given sourceLocation. |
String |
resolveAlias(String sourceName)
Dealiases a name in the scope of this context (if it matches an alias).
|
SoyParsingContext |
withErrorReporter(ErrorReporter errorReporter) |
public static SoyParsingContext create(ErrorReporter errorReporter, String namespace, com.google.common.collect.ImmutableMap<String,String> aliasToNamespaceMap)
public static SoyParsingContext empty(ErrorReporter errorReporter, String namespace)
public static SoyParsingContext exploding()
public abstract ErrorReporter errorReporter()
@Nullable public abstract String namespace()
public String resolveAlias(String sourceName)
public void report(SourceLocation sourceLocation, SoyErrorKind error, Object... args)
error, formatted according to args and associated with
the given sourceLocation.
Convencience wrapper for errorReporter.public SoyParsingContext withErrorReporter(ErrorReporter errorReporter)