ConditionalOnMissingClass class

The ConditionalOnMissingClass annotation in Jetleaf allows developers to conditionally process a class or method only when certain classes are absent from the runtime classpath.

This is useful for providing default implementations or fallback configurations when optional libraries or classes are missing.

Usage Examples:

// Only load default cache if AdvancedCache is missing
@ConditionalOnMissingClass(value: [ClassType<AdvancedCache>()])
class DefaultCacheConfig {}

// Use fully qualified class names instead of direct references
@ConditionalOnMissingClass(name: ['package:jetleaf/example/jetleaf_example.dart.LoggingService'])
class DefaultLogger {}
Annotations
  • @Conditional([ClassType<OnClassCondition>()])
  • @Target.new({TargetKind.classType, TargetKind.method})

Constructors

ConditionalOnMissingClass({List<ClassType<Object>> value = const [], List<String> names = const []})
The ConditionalOnMissingClass annotation in Jetleaf allows developers to conditionally process a class or method only when certain classes are absent from the runtime classpath.
const

Properties

annotationType Type
Returns the annotation _type of this annotation.
no setter
hashCode int
The hash code for this object.
no setterinherited
names List<String>
ClassType names (fully qualified) that must be absent from the classpath.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value List<ClassType<Object>>
Classes that must be absent from the classpath.
final

Methods

equalizedProperties() List<Object?>
Mixin-style contract for value-based equality, hashCode, and toString.
equals(Object other) bool
Checks whether the given object is logically equivalent to this annotation.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
Returns a string representation of this annotation.

Operators

operator ==(Object other) bool
The equality operator.
inherited