public static Tag createInstance ( int id , String tagName ) throws TagCreateException { Class < ? extends Tag > clazz = idToTag . get ( id ) ; if ( clazz == null ) { throw new TagCreateException ( "Could not find tag with ID \"" + id + "\"." ) ; } try { Constructor < ? extends Tag > constructor = clazz . getDeclaredConstructor ( String . class ) ; constructor . setAccessible ( true ) ; return constructor . newInstance ( tagName ) ; } catch ( Exception e ) { throw new TagCreateException ( "Failed to create instance of tag \"" + clazz . getSimpleName ( ) + "\"." , e ) ; } }
Creates an instance of the tag with the given id using the String constructor .