public void setBinding ( Path path , FullType fullType , Template template , SourceRange sourceRange ) { assert ( path != null ) ; assert ( path . isAbsolute ( ) ) ; assert ( fullType != null ) ; // Must make sure that all of the subtypes for the given type are // defined before adding the binding. try { fullType . verifySubtypesDefined ( types ) ; } catch ( EvaluationException ee ) { throw ee . addExceptionInfo ( sourceRange , template . source , this . getTraceback ( sourceRange ) ) ; } // Retrieve or create the list of bindings for this path. List < FullType > list = bindings . get ( path ) ; if ( list == null ) { list = new LinkedList < FullType > ( ) ; bindings . put ( path , list ) ; } // Add the binding. assert ( list != null ) ; list . add ( fullType ) ; }
This method associates a type definition to a path . These bindings are checked as part of the validation process . Note that there can be more than one binding per path .