Skip to content

Commit

Permalink
Implement method visibility modifiers' getters
Browse files Browse the repository at this point in the history
  • Loading branch information
zishkaz committed Jul 25, 2024
1 parent c2453bc commit 405ba75
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion jacodb-ets/src/main/kotlin/org/jacodb/ets/model/EtsMethod.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,23 @@ interface EtsMethod : CommonMethod {
val signature: EtsMethodSignature
val localsCount: Int
val cfg: EtsCfg
val modifiers: List<String>

val enclosingClass: EtsClassSignature
get() = signature.enclosingClass

val isStatic: Boolean
get() = modifiers.contains("StaticKeyword")

val isPrivate: Boolean
get() = modifiers.contains("PrivateKeyword")

val isPublic: Boolean
get() = !isPrivate

val isProtected: Boolean
get() = modifiers.contains("ProtectedKeyword")

override val name: String
get() = signature.name

Expand All @@ -48,7 +61,7 @@ class EtsMethodImpl(
override val signature: EtsMethodSignature,
// Default locals count is args + this
override val localsCount: Int = signature.parameters.size + 1,
val modifiers: List<String> = emptyList(),
override val modifiers: List<String> = emptyList(),
) : EtsMethod {
override lateinit var cfg: EtsCfg

Expand Down

0 comments on commit 405ba75

Please sign in to comment.