diff options
Diffstat (limited to 'src/Model')
-rw-r--r-- | src/Model/DocumentationBuildingVisitor.kt | 7 | ||||
-rw-r--r-- | src/Model/DocumentationModule.kt | 7 |
2 files changed, 10 insertions, 4 deletions
diff --git a/src/Model/DocumentationBuildingVisitor.kt b/src/Model/DocumentationBuildingVisitor.kt index 2d293de2..b544b42b 100644 --- a/src/Model/DocumentationBuildingVisitor.kt +++ b/src/Model/DocumentationBuildingVisitor.kt @@ -4,7 +4,10 @@ import org.jetbrains.jet.lang.descriptors.* import org.jetbrains.jet.lang.resolve.name.* import org.jetbrains.jet.lang.resolve.* -class DocumentationBuildingVisitor(val context: BindingContext, private val worker: DeclarationDescriptorVisitor<DocumentationNode, DocumentationNode>) +public data class DocumentationOptions(val includeNonPublic : Boolean = false) +class DocumentationBuildingVisitor(val context: BindingContext, + val options: DocumentationOptions, + private val worker: DeclarationDescriptorVisitor<DocumentationNode, DocumentationNode>) : DeclarationDescriptorVisitor<DocumentationNode, DocumentationNode> { private fun visitChildren(descriptors: Collection<DeclarationDescriptor>, data: DocumentationNode) { @@ -15,7 +18,7 @@ class DocumentationBuildingVisitor(val context: BindingContext, private val work private fun visitChild(descriptor: DeclarationDescriptor?, data: DocumentationNode) { if (descriptor != null && descriptor.isUserCode()) { - if (descriptor !is MemberDescriptor || descriptor.getVisibility().isPublicAPI()) { + if (options.includeNonPublic || descriptor !is MemberDescriptor || descriptor.getVisibility().isPublicAPI()) { descriptor.accept(this, data) } } diff --git a/src/Model/DocumentationModule.kt b/src/Model/DocumentationModule.kt index 832eb9e3..78ebda04 100644 --- a/src/Model/DocumentationModule.kt +++ b/src/Model/DocumentationModule.kt @@ -13,12 +13,15 @@ public class DocumentationModule(name: String, val module: ModuleDescriptor) : D } } -fun BindingContext.createDocumentationModule(name: String, module: ModuleDescriptor, packages: Set<FqName>): DocumentationModule { +fun BindingContext.createDocumentationModule(name: String, + module: ModuleDescriptor, + packages: Set<FqName>, + options : DocumentationOptions = DocumentationOptions()): DocumentationModule { val documentationModule = DocumentationModule(name, module) val visitor = DocumentationNodeBuilder(this) for (packageName in packages) { val pkg = module.getPackage(packageName) - pkg!!.accept(DocumentationBuildingVisitor(this, visitor), documentationModule) + pkg!!.accept(DocumentationBuildingVisitor(this, options, visitor), documentationModule) } // TODO: Uncomment for resolve verification |