/** * This method will bind the type of the <code>typedElement</code> if the {@link * #getTypeParameter() type parameter} of this <code>ParameterGenericType</code> is in the given * list of type parameters that shall be bound. */ @Override protected boolean doBindGenericType( List<TypeParameter> parameters, List<? extends Type> types, TypedElement typedElement) { int index; // search the type parameter of this generic type in the list of parameters index = ListUtil.indexOf(parameters, getTypeParameter()); // bind the generic type if type parameter was found if (index != -1) { Type type = types.get(index); if (logger.isInfoEnabled()) { logger.info( "Binding type of '" + typedElement.getQualifiedName() // $NON-NLS-1$ + "' with '" + type.getName() + "'."); //$NON-NLS-1$ //$NON-NLS-2$ } // reset the generic type, then set the type (the order is important) typedElement.setGenericType(null); typedElement.setType(type); // break ans signal success return true; } return false; }
/** * Helper method to return the name of the {@link Type} of a {@link TypedElement}. This default * implementation simply returns the name if the type, but subclasses may override to provide a * custom rendering. * * @param type the <code>Type</code>, guaranteed not to be <code>null</code> * @return a formatted name for the type */ protected CharSequence getTypeName(Type type) { return type.getName(); }