public final class PluginResolver extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
PluginResolver.Mode
Configures the behavior of the resolver when a lookup fails.
|
| Constructor and Description |
|---|
PluginResolver(PluginResolver.Mode mode,
com.google.common.collect.ImmutableMap<String,? extends SoyPrintDirective> printDirectives,
com.google.common.collect.ImmutableMap<String,? extends SoyFunction> functions,
ErrorReporter reporter) |
| Modifier and Type | Method and Description |
|---|---|
SoyPrintDirective |
lookupPrintDirective(String name,
int numArgs,
SourceLocation location)
Returns a print directive with the given name and arity.
|
SoyFunction |
lookupSoyFunction(String name,
int numArgs,
SourceLocation location)
Returns a function with the given name and arity.
|
static PluginResolver |
nullResolver(PluginResolver.Mode mode,
ErrorReporter reporter)
Returns an empty resolver.
|
public PluginResolver(PluginResolver.Mode mode, com.google.common.collect.ImmutableMap<String,? extends SoyPrintDirective> printDirectives, com.google.common.collect.ImmutableMap<String,? extends SoyFunction> functions, ErrorReporter reporter)
public static PluginResolver nullResolver(PluginResolver.Mode mode, ErrorReporter reporter)
public SoyPrintDirective lookupPrintDirective(String name, int numArgs, SourceLocation location)
An error will be reported according to the current PluginResolver.Mode and a placeholder function
will be returned if it cannot be found.
public SoyFunction lookupSoyFunction(String name, int numArgs, SourceLocation location)
An error will be reported according to the current PluginResolver.Mode and a placeholder function
will be returned if it cannot be found.