com.google.template.soy.shared.internal
Class ModuleUtils

java.lang.Object
  extended by com.google.template.soy.shared.internal.ModuleUtils

public class ModuleUtils
extends Object

Utilities for Guice modules (SharedModule, TofuModule, JsSrcModule, JavaSrcModule, etc).

Important: Do not use outside of Soy code (treat as superpackage-private).


Method Summary
static
<T extends SoyPrintDirective>
Map<String,T>
buildSpecificSoyDirectivesMap(Class<T> specificSoyDirectiveType, Set<SoyPrintDirective> soyDirectivesSet)
          Given a specific Soy directive type (subtype of SoyPrintDirective) and the set of all Soy directive implementations, finds the Soy directives that implement the specific type and returns them in the form of a map from directive name to directive.
static
<T extends SoyFunction>
Map<String,T>
buildSpecificSoyFunctionsMap(Class<T> specificSoyFunctionType, Set<SoyFunction> soyFunctionsSet)
          Given a specific Soy function type (subtype of SoyFunction) and the set of all Soy function implementations, finds the Soy functions that implement the specific type and returns them in the form of a map from function name to function.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

buildSpecificSoyFunctionsMap

public static <T extends SoyFunction> Map<String,T> buildSpecificSoyFunctionsMap(Class<T> specificSoyFunctionType,
                                                                                 Set<SoyFunction> soyFunctionsSet)
Given a specific Soy function type (subtype of SoyFunction) and the set of all Soy function implementations, finds the Soy functions that implement the specific type and returns them in the form of a map from function name to function.

Parameters:
specificSoyFunctionType - The specific Soy function type to filter for.
soyFunctionsSet - The set of all Soy functions.
Returns:
A map of the relevant specific Soy functions (name to function).

buildSpecificSoyDirectivesMap

public static <T extends SoyPrintDirective> Map<String,T> buildSpecificSoyDirectivesMap(Class<T> specificSoyDirectiveType,
                                                                                        Set<SoyPrintDirective> soyDirectivesSet)
Given a specific Soy directive type (subtype of SoyPrintDirective) and the set of all Soy directive implementations, finds the Soy directives that implement the specific type and returns them in the form of a map from directive name to directive.

Parameters:
specificSoyDirectiveType - The specific Soy directive type to filter for.
soyDirectivesSet - The set of all Soy directives.
Returns:
A map of the relevant specific Soy directives (name to directive).