@ SuppressWarnings ( "unused" ) // called in SoyFileParser.jj public static final String calculateFullCalleeName ( Identifier ident , SoyFileHeaderInfo header , ErrorReporter errorReporter ) { String name = ident . identifier ( ) ; switch ( ident . type ( ) ) { case DOT_IDENT : // Case 1: Source callee name is partial. return header . getNamespace ( ) + name ; case DOTTED_IDENT : // Case 2: Source callee name is a proper dotted ident, which might start with an alias. return header . resolveAlias ( name ) ; case SINGLE_IDENT : // Case 3: Source callee name is a single ident (not dotted). if ( header . hasAlias ( name ) ) { // Case 3a: This callee collides with a namespace alias, which likely means the alias // incorrectly references a template. errorReporter . report ( ident . location ( ) , CALL_COLLIDES_WITH_NAMESPACE_ALIAS , name ) ; } else { // Case 3b: The callee name needs a namespace. errorReporter . report ( ident . location ( ) , MISSING_CALLEE_NAMESPACE , name ) ; } return name ; } throw new AssertionError ( ident . type ( ) ) ; }
Given a template call and file header info return the expanded callee name if possible .