Class ClassModifierChangePredicate
java.lang.Object
org.ek9lang.compiler.common.ClassModifierChangePredicate
Decides whether a construct's modifier (
as open / as abstract) may legally be
toggled to a proposed state — the "declaration viability" of the modifier refactoring.
Supports classes, records, components, and functions. Uses the same symbol-table queries the
compiler enforces (ICanBeGeneric.isOpenForExtension(),
ISymbol.isMarkedAbstract(),
IAggregateSymbol.getAllAbstractMethods()) so the predicate can never drift from what
the compiler accepts.
Intended to be shared by the compiler-services MCP tools and the IDE Refactor menu.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe four modifier toggle modes. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncanChange(ISymbol symbol, ClassModifierChangePredicate.Mode mode)
-
Constructor Details
-
ClassModifierChangePredicate
public ClassModifierChangePredicate()
-
-
Method Details
-
canChange
public ClassModifierChangeViability canChange(ISymbol symbol, ClassModifierChangePredicate.Mode mode) - Parameters:
symbol- the symbol whose modifier a change is proposed formode- the proposed change- Returns:
- whether the change is structurally possible, with a reason when not
-