Skip to content
Newer
Older
100644 191 lines (163 sloc) 5.77 KB
d9e3dde Scaladoc 2.
Gilles Dubochet authored
1 /* NSC -- new Scala compiler
ba33e9b Updated copyright notices to 2010
Antonio Cunei authored
2 * Copyright 2007-2010 LAMP/EPFL
d9e3dde Scaladoc 2.
Gilles Dubochet authored
3 * @author Manohar Jonnalagedda
4 */
5
6 package scala.tools.nsc
7 package doc
8 package model
9
10 import scala.collection._
11 import comment._
12
13 /** Some entity of the Scaladoc model. */
14 trait Entity {
15 def name : String
16 def inTemplate: TemplateEntity
17 def toRoot: List[Entity]
18 def qualifiedName: String
19 override def toString = qualifiedName
d36dcfb [scaladoc] Adds private Scaladoc option "-Yuse-...
Gilles Dubochet authored
20 def universe: Universe
d9e3dde Scaladoc 2.
Gilles Dubochet authored
21 }
22
b2abe22 removed warnings (deprecation,unchecked)
michelou authored
23 /** A class, trait, object or package. A package is represented as an instance
24 * of the `Package` subclass. A class, trait, object or package may be
25 * directly an instance of `WeakTemplateEntity` if it is not ''documentable''
26 * (that is, if there is no documentation page for it in the current site),
27 * otherwise, it will be represented as an instance of the `TemplateEntity`
28 * subclass. */
d9e3dde Scaladoc 2.
Gilles Dubochet authored
29 trait TemplateEntity extends Entity {
30 def isPackage: Boolean
31 def isRootPackage: Boolean
32 def isTrait: Boolean
33 def isClass: Boolean
34 def isObject: Boolean
6995333 [scaladoc] Types are links.
Gilles Dubochet authored
35 def isDocTemplate: Boolean
596ef0e [Scaladoc] Improve the documentation of primary...
chrisJames authored
36 def isCaseClass: Boolean
9cc51c6 [Scaladoc] Self types are printed.
Gilles Dubochet authored
37 def selfType : Option[TypeEntity]
d9e3dde Scaladoc 2.
Gilles Dubochet authored
38 }
39 trait NoDocTemplate extends TemplateEntity
40
41 /** A member of a class, trait, object or package. */
42 trait MemberEntity extends Entity {
a17785f [scaladoc] Display of comments is improved.
Gilles Dubochet authored
43 def comment: Option[Comment]
d9e3dde Scaladoc 2.
Gilles Dubochet authored
44 def inTemplate: DocTemplateEntity
6995333 [scaladoc] Types are links.
Gilles Dubochet authored
45 def toRoot: List[MemberEntity]
a17785f [scaladoc] Display of comments is improved.
Gilles Dubochet authored
46 def inDefinitionTemplates: List[TemplateEntity]
d9e3dde Scaladoc 2.
Gilles Dubochet authored
47 def definitionName: String
86af709 [scaladoc] Considerably reduced size of documen...
Gilles Dubochet authored
48 def visibility: Visibility
d9e3dde Scaladoc 2.
Gilles Dubochet authored
49 def flags: List[Paragraph]
a6eecfb [scaladoc] Optional link to source (set paramet...
Gilles Dubochet authored
50 def deprecation: Option[Body]
d9e3dde Scaladoc 2.
Gilles Dubochet authored
51 def inheritedFrom: List[TemplateEntity]
52 def resultType: TypeEntity
53 def isDef: Boolean
54 def isVal: Boolean
9361f2d [scaladoc] Lazy vals are printed as such, no lo...
Gilles Dubochet authored
55 def isLazyVal: Boolean
d9e3dde Scaladoc 2.
Gilles Dubochet authored
56 def isVar: Boolean
ec5a4e8 @lindydonna Move constructors to beginning of scaladoc html...
lindydonna authored
57 def isImplicit: Boolean
109924d [scaladoc] Abstract members can be filtered in ...
Gilles Dubochet authored
58 def isAbstract: Boolean
d9e3dde Scaladoc 2.
Gilles Dubochet authored
59 def isConstructor: Boolean
60 def isAliasType: Boolean
61 def isAbstractType: Boolean
62 def isTemplate: Boolean
63 }
64
c66d3b0 [scaladoc] Implements documentation of higher-k...
Gilles Dubochet authored
65 trait HigherKinded extends Entity {
66 def typeParams: List[TypeParam]
67 }
68
b2abe22 removed warnings (deprecation,unchecked)
michelou authored
69 /** A ''documentable'' class, trait or object (that is, a documentation page
70 * will be generated for it in the current site). */
d9e3dde Scaladoc 2.
Gilles Dubochet authored
71 trait DocTemplateEntity extends TemplateEntity with MemberEntity {
e4fded7 [scaladoc] Known subclasses are printed.
Gilles Dubochet authored
72 def toRoot: List[DocTemplateEntity]
d9e3dde Scaladoc 2.
Gilles Dubochet authored
73 def inSource: Option[(io.AbstractFile, Int)]
a6eecfb [scaladoc] Optional link to source (set paramet...
Gilles Dubochet authored
74 def sourceUrl: Option[java.net.URL]
d9e3dde Scaladoc 2.
Gilles Dubochet authored
75 def parentType: Option[TypeEntity]
289e6a4 [scaladoc] Print "Inherited from" headings usin...
Gilles Dubochet authored
76 def linearization: List[(TemplateEntity, TypeEntity)]
77 def linearizationTemplates: List[TemplateEntity]
ceec792 [scaladoc] Added linear super types.
Gilles Dubochet authored
78 def linearizationTypes: List[TypeEntity]
d9e3dde Scaladoc 2.
Gilles Dubochet authored
79 def subClasses: List[DocTemplateEntity]
80 def members: List[MemberEntity]
81 def templates: List[DocTemplateEntity]
82 def methods: List[Def]
83 def values: List[Val]
84 def abstractTypes: List[AbstractType]
85 def aliasTypes: List[AliasType]
b0e6451 [scaladoc] Companion classes are printed.
Gilles Dubochet authored
86 def companion: Option[DocTemplateEntity]
d9e3dde Scaladoc 2.
Gilles Dubochet authored
87 }
88
89 /** A ''documentable'' trait. */
596ef0e [Scaladoc] Improve the documentation of primary...
chrisJames authored
90 trait Trait extends DocTemplateEntity with HigherKinded
d9e3dde Scaladoc 2.
Gilles Dubochet authored
91
92 /** A ''documentable'' class. */
c66d3b0 [scaladoc] Implements documentation of higher-k...
Gilles Dubochet authored
93 trait Class extends Trait with HigherKinded {
d9e3dde Scaladoc 2.
Gilles Dubochet authored
94 def primaryConstructor: Option[Constructor]
95 def constructors: List[Constructor]
596ef0e [Scaladoc] Improve the documentation of primary...
chrisJames authored
96 def valueParams: List[List[ValueParam]]
d9e3dde Scaladoc 2.
Gilles Dubochet authored
97 }
98
99 /** A ''documentable'' object. */
e1eb917 @hubertp Revert changes related to #1591. no review.
hubertp authored
100 trait Object extends DocTemplateEntity
d9e3dde Scaladoc 2.
Gilles Dubochet authored
101
b2abe22 removed warnings (deprecation,unchecked)
michelou authored
102 /** A package that contains at least one ''documentable'' class, trait,
103 * object or package. */
d9e3dde Scaladoc 2.
Gilles Dubochet authored
104 trait Package extends Object {
105 def inTemplate: Package
106 def toRoot: List[Package]
107 def packages: List[Package]
108 }
109
d43ccc6 [scaladoc] Improved Scaladoc comment syntax, co...
Gilles Dubochet authored
110 /** A package represent the root of Entities hierarchy */
111 trait RootPackage extends Package
112
25e7a7c [scaladoc] Use cases are printed.
Gilles Dubochet authored
113 trait NonTemplateMemberEntity extends MemberEntity {
114 def isUseCase: Boolean
115 }
d9e3dde Scaladoc 2.
Gilles Dubochet authored
116
117 /** A method (`def`) of a ''documentable'' class, trait or object. */
c66d3b0 [scaladoc] Implements documentation of higher-k...
Gilles Dubochet authored
118 trait Def extends NonTemplateMemberEntity with HigherKinded {
d9e3dde Scaladoc 2.
Gilles Dubochet authored
119 def valueParams : List[List[ValueParam]]
120 }
121
122 trait Constructor extends NonTemplateMemberEntity {
123 def isPrimary: Boolean
124 def valueParams : List[List[ValueParam]]
125 }
126
b2abe22 removed warnings (deprecation,unchecked)
michelou authored
127 /** A value (`val`), lazy val (`lazy val`) or variable (`var`) of a
128 * ''documentable'' class, trait or object. */
d9e3dde Scaladoc 2.
Gilles Dubochet authored
129 trait Val extends NonTemplateMemberEntity
130
131 /** An abstract type of a ''documentable'' class, trait or object. */
c66d3b0 [scaladoc] Implements documentation of higher-k...
Gilles Dubochet authored
132 trait AbstractType extends NonTemplateMemberEntity with HigherKinded {
d9e3dde Scaladoc 2.
Gilles Dubochet authored
133 def lo: Option[TypeEntity]
134 def hi: Option[TypeEntity]
135 }
136
137 /** An abstract type of a ''documentable'' class, trait or object. */
c66d3b0 [scaladoc] Implements documentation of higher-k...
Gilles Dubochet authored
138 trait AliasType extends NonTemplateMemberEntity with HigherKinded {
d9e3dde Scaladoc 2.
Gilles Dubochet authored
139 def alias: TypeEntity
140 }
141
142 trait ParameterEntity extends Entity {
143 def isTypeParam: Boolean
144 def isValueParam: Boolean
145 }
146
147 /** A type parameter to a class or trait or to a method. */
c66d3b0 [scaladoc] Implements documentation of higher-k...
Gilles Dubochet authored
148 trait TypeParam extends ParameterEntity with HigherKinded {
d9e3dde Scaladoc 2.
Gilles Dubochet authored
149 def variance: String
150 def lo: Option[TypeEntity]
151 def hi: Option[TypeEntity]
152 }
153
154 /** A value parameter to a constructor or to a method. */
155 trait ValueParam extends ParameterEntity {
a259a74 [scaladoc] Default values of parameters are doc...
Gilles Dubochet authored
156 def resultType: TypeEntity
bf44cd1 [Scaladoc]
chrisJames authored
157 def defaultValue: Option[TreeEntity]
ea7ac7b [scaladoc] Deprecated methods are striked-out.
Gilles Dubochet authored
158 def isImplicit: Boolean
d9e3dde Scaladoc 2.
Gilles Dubochet authored
159 }
86af709 [scaladoc] Considerably reduced size of documen...
Gilles Dubochet authored
160
161 /** An type that represents visibility of members. */
162 sealed trait Visibility {
163 def isProtected: Boolean = false
164 def isPublic: Boolean = false
165 }
166
167 /** The visibility of `private[this]` members. */
b2abe22 removed warnings (deprecation,unchecked)
michelou authored
168 case class PrivateInInstance() extends Visibility
86af709 [scaladoc] Considerably reduced size of documen...
Gilles Dubochet authored
169
170 /** The visibility of `protected[this]` members. */
b2abe22 removed warnings (deprecation,unchecked)
michelou authored
171 case class ProtectedInInstance() extends Visibility {
86af709 [scaladoc] Considerably reduced size of documen...
Gilles Dubochet authored
172 override def isProtected = true
173 }
174
b2abe22 removed warnings (deprecation,unchecked)
michelou authored
175 /** The visibility of `private[owner]` members. An unqualified private members
176 * is encoded with `owner` equal to the members's `inTemplate`. */
86af709 [scaladoc] Considerably reduced size of documen...
Gilles Dubochet authored
177 case class PrivateInTemplate(owner: TemplateEntity) extends Visibility
178
b2abe22 removed warnings (deprecation,unchecked)
michelou authored
179 /** The visibility of `protected[owner]` members. An unqualified protected
180 * members is encoded with `owner` equal to the members's `inTemplate`.
181 * Note that whilst the member is visible in any template owned by `owner`,
182 * it is only visible in subclasses of the member's `inTemplate`. */
86af709 [scaladoc] Considerably reduced size of documen...
Gilles Dubochet authored
183 case class ProtectedInTemplate(owner: TemplateEntity) extends Visibility {
184 override def isProtected = true
185 }
186
187 /** The visibility of public members. */
b2abe22 removed warnings (deprecation,unchecked)
michelou authored
188 case class Public() extends Visibility {
86af709 [scaladoc] Considerably reduced size of documen...
Gilles Dubochet authored
189 override def isPublic = true
190 }
Something went wrong with that request. Please try again.