if (envEntity instanceof ClassMethod) {
ClassMethod method = (ClassMethod)envEntity;
isRequiredClassMethod = (method.getDefaultClassMethodName() == null); // no default -> required
}
CALDocComment caldoc = envEntity.getCALDocComment();
buffer.append(getBasicMetadataHtml(owner, metadata, caldoc));
buffer.append(getFunctionalAgentMetadataHtml(owner, (FunctionalAgentMetadata) metadata, url, caldoc, isRequiredClassMethod));
buffer.append(getAdditionalMetadataHtml(owner, metadata, caldoc));
} else if (metadata instanceof ModuleMetadata) {
ModuleName moduleName = featureName.toModuleName();
ModuleTypeInfo moduleTypeInfoForFeature = owner.getPerspective().getMetaModule(moduleName).getTypeInfo();
CALDocComment caldoc = moduleTypeInfoForFeature.getCALDocComment();
buffer.append(getBasicMetadataHtml(owner, metadata, caldoc));
buffer.append(getModuleMetadataHtml(owner, (ModuleMetadata) metadata));
buffer.append(getAdditionalMetadataHtml(owner, metadata, caldoc));
} else if (metadata instanceof TypeClassMetadata) {
QualifiedName qualifiedName = featureName.toQualifiedName();
ModuleTypeInfo moduleTypeInfoForFeature = owner.getPerspective().getMetaModule(qualifiedName.getModuleName()).getTypeInfo();
TypeClass typeClass = moduleTypeInfoForFeature.getTypeClass(qualifiedName.getUnqualifiedName());
CALDocComment caldoc = typeClass.getCALDocComment();
buffer.append(getBasicMetadataHtml(owner, metadata, caldoc));
buffer.append(getTypeClassMetadataHtml(owner, (TypeClassMetadata) metadata));
buffer.append(getAdditionalMetadataHtml(owner, metadata, caldoc));
} else if (metadata instanceof TypeConstructorMetadata) {
QualifiedName qualifiedName = featureName.toQualifiedName();
ModuleTypeInfo moduleTypeInfoForFeature = owner.getPerspective().getMetaModule(qualifiedName.getModuleName()).getTypeInfo();
TypeConstructor typeCons = moduleTypeInfoForFeature.getTypeConstructor(qualifiedName.getUnqualifiedName());
CALDocComment caldoc = typeCons.getCALDocComment();
buffer.append(getBasicMetadataHtml(owner, metadata, caldoc));
buffer.append(getTypeConstructorMetadataHtml(owner, (TypeConstructorMetadata) metadata));
buffer.append(getAdditionalMetadataHtml(owner, metadata, caldoc));
} else if (metadata instanceof ClassInstanceMetadata) {
ClassInstanceIdentifier classInstanceID = featureName.toInstanceIdentifier();
ModuleTypeInfo moduleTypeInfoForFeature = owner.getPerspective().getMetaModule(featureName.toModuleName()).getTypeInfo();
ClassInstance instance = moduleTypeInfoForFeature.getClassInstance(classInstanceID);
CALDocComment caldoc = instance.getCALDocComment();
buffer.append(getBasicMetadataHtml(owner, metadata, caldoc));
buffer.append(getClassInstanceMetadataHtml(owner, (ClassInstanceMetadata) metadata));
buffer.append(getAdditionalMetadataHtml(owner, metadata, caldoc));
} else if (metadata instanceof InstanceMethodMetadata) {
ClassInstanceIdentifier classInstanceID = featureName.toInstanceIdentifier();
ModuleTypeInfo moduleTypeInfoForFeature = owner.getPerspective().getMetaModule(featureName.toModuleName()).getTypeInfo();
ClassInstance instance = moduleTypeInfoForFeature.getClassInstance(classInstanceID);
CALDocComment caldoc = instance.getMethodCALDocComment(featureName.toInstanceMethodName());
buffer.append(getBasicMetadataHtml(owner, metadata, caldoc));
buffer.append(getInstanceMethodMetadataHtml(owner, (InstanceMethodMetadata) metadata, url, caldoc));
buffer.append(getAdditionalMetadataHtml(owner, metadata, caldoc));
}
}