* Generates a reference to an instance method, appropriately hyperlinked.
* @param classInstance the class instance of the instance method.
* @param methodName the name of the instance method.
*/
private void generateInstanceMethodReference(ClassInstance classInstance, String methodName) {
ModuleName definingModuleName = classInstance.getModuleName();
ClassInstanceIdentifier identifier = classInstance.getIdentifier();
String instanceMethodLabel = labelMaker.getInstanceMethodLabel(identifier, methodName);
if (!isDocForClassInstanceGenerated(classInstance)) {
// if the class instance is not documented, no hyperlink can be made.
generateClassInstanceDeclarationName(classInstance, false);
currentPage.addText(" ").addText(methodName);
} else {
// the instance is indeed documented, so create a hyperlinked reference to the instance method
HTMLBuilder.AttributeList hrefAttribute;
if (config.shouldSeparateInstanceDoc) {
if (inSeparateInstanceDoc) {
if (definingModuleName == null || definingModuleName.equals(currentModuleName)) {
hrefAttribute = localHrefAttribute(instanceMethodLabel);
} else {
hrefAttribute = nonLocalHrefAttribute(getSeparateInstanceDocFileName(definingModuleName), instanceMethodLabel);
}
} else {
hrefAttribute = nonLocalHrefAttribute("../" + SEPARATE_INSTANCE_DOC_SUBDIRECTORY + "/" + getSeparateInstanceDocFileName(definingModuleName), instanceMethodLabel);
}
} else {
if (definingModuleName == null || definingModuleName.equals(currentModuleName)) {
hrefAttribute = localHrefAttribute(instanceMethodLabel);
} else {
hrefAttribute = nonLocalHrefAttribute(getModuleFileName(definingModuleName), instanceMethodLabel);
}
}