Class BehaviorSourceGenerator
Namespace: Cephalon.Behaviors.SourceGen
Assembly: Cephalon.Behaviors.SourceGen.dll
Incremental source generator that validates classes decorated with
[AppBehavior], emits compile-time diagnostics for common authoring mistakes,
and generates zero-reflection registration code with pre-built topology descriptors.
Diagnostic IDs: ABT-010 through ABT-026.
[Generator]public sealed class BehaviorSourceGenerator : IIncrementalGeneratorInheritance
Section titled “Inheritance”object ← BehaviorSourceGenerator
Implements
Section titled “Implements”Inherited Members
Section titled “Inherited Members”object.Equals(object), object.Equals(object, object), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object, object), object.ToString()
Fields
Section titled “Fields”Abt010MustImplementIAppBehavior
Section titled “ Abt010MustImplementIAppBehavior”ABT-010: Class with [AppBehavior] must implement IAppBehavior<TIn, TOut>.
public static readonly DiagnosticDescriptor Abt010MustImplementIAppBehaviorField Value
Section titled “Field Value”Abt011EmptyBehaviorId
Section titled “ Abt011EmptyBehaviorId”ABT-011: [AppBehavior] id must not be empty or whitespace.
public static readonly DiagnosticDescriptor Abt011EmptyBehaviorIdField Value
Section titled “Field Value”Abt012MustNotBeAbstract
Section titled “ Abt012MustNotBeAbstract”ABT-012: [AppBehavior] class must not be abstract.
public static readonly DiagnosticDescriptor Abt012MustNotBeAbstractField Value
Section titled “Field Value”Abt013MustNotBeStatic
Section titled “ Abt013MustNotBeStatic”ABT-013: [AppBehavior] class must not be static.
public static readonly DiagnosticDescriptor Abt013MustNotBeStaticField Value
Section titled “Field Value”Abt014RestMustBeModuleOwned
Section titled “ Abt014RestMustBeModuleOwned”ABT-014: REST is module-owned only and must not be declared in behavior topology.
public static readonly DiagnosticDescriptor Abt014RestMustBeModuleOwnedField Value
Section titled “Field Value”Abt015RestProfileMethodMustBeSpecified
Section titled “ Abt015RestProfileMethodMustBeSpecified”ABT-015: [BehaviorRestProfile] must select a supported REST method.
public static readonly DiagnosticDescriptor Abt015RestProfileMethodMustBeSpecifiedField Value
Section titled “Field Value”Abt016RestProfilePatternMustNotBeEmpty
Section titled “ Abt016RestProfilePatternMustNotBeEmpty”ABT-016: [BehaviorRestProfile] relative pattern must not be empty.
public static readonly DiagnosticDescriptor Abt016RestProfilePatternMustNotBeEmptyField Value
Section titled “Field Value”Abt017RestProfileVersionMustBePositive
Section titled “ Abt017RestProfileVersionMustBePositive”ABT-017: [BehaviorRestProfile] API version must be positive when specified.
public static readonly DiagnosticDescriptor Abt017RestProfileVersionMustBePositiveField Value
Section titled “Field Value”Abt018RestProfilePatternMustStartWithSlash
Section titled “ Abt018RestProfilePatternMustStartWithSlash”ABT-018: [BehaviorRestProfile] relative pattern must start with ’/’.
public static readonly DiagnosticDescriptor Abt018RestProfilePatternMustStartWithSlashField Value
Section titled “Field Value”Abt019RestBindingPropertyNameMustNotBeEmpty
Section titled “ Abt019RestBindingPropertyNameMustNotBeEmpty”ABT-019: [BehaviorRestBinding] target property name must not be empty.
public static readonly DiagnosticDescriptor Abt019RestBindingPropertyNameMustNotBeEmptyField Value
Section titled “Field Value”Abt020RestBindingSourceMustBeSupported
Section titled “ Abt020RestBindingSourceMustBeSupported”ABT-020: [BehaviorRestBinding] source must select a supported binding source.
public static readonly DiagnosticDescriptor Abt020RestBindingSourceMustBeSupportedField Value
Section titled “Field Value”Abt021RestBindingsRequireObjectInput
Section titled “ Abt021RestBindingsRequireObjectInput”ABT-021: Explicit REST bindings require an object input with public properties.
public static readonly DiagnosticDescriptor Abt021RestBindingsRequireObjectInputField Value
Section titled “Field Value”Abt022RestBindingPropertyMustExistOnInput
Section titled “ Abt022RestBindingPropertyMustExistOnInput”ABT-022: [BehaviorRestBinding] property must exist on the behavior input.
public static readonly DiagnosticDescriptor Abt022RestBindingPropertyMustExistOnInputField Value
Section titled “Field Value”Abt023RestBindingPropertyMustNotBeDuplicated
Section titled “ Abt023RestBindingPropertyMustNotBeDuplicated”ABT-023: [BehaviorRestBinding] must not target the same property twice.
public static readonly DiagnosticDescriptor Abt023RestBindingPropertyMustNotBeDuplicatedField Value
Section titled “Field Value”Abt024RestBodyBindingMustUseBodyCapableMethod
Section titled “ Abt024RestBodyBindingMustUseBodyCapableMethod”ABT-024: GET/DELETE REST profiles must not bind from the request body.
public static readonly DiagnosticDescriptor Abt024RestBodyBindingMustUseBodyCapableMethodField Value
Section titled “Field Value”Abt025RestRouteBindingMustMatchRoutePlaceholder
Section titled “ Abt025RestRouteBindingMustMatchRoutePlaceholder”ABT-025: Route bindings must target placeholders declared in the profile pattern.
public static readonly DiagnosticDescriptor Abt025RestRouteBindingMustMatchRoutePlaceholderField Value
Section titled “Field Value”Abt026RestProfilePatternMustUseValidPlaceholderSyntax
Section titled “ Abt026RestProfilePatternMustUseValidPlaceholderSyntax”ABT-026: REST profile patterns must use valid route placeholder syntax.
public static readonly DiagnosticDescriptor Abt026RestProfilePatternMustUseValidPlaceholderSyntaxField Value
Section titled “Field Value”Abt027RestPreservedImplicitQueryFallbackRequiresExplicitBindings
Section titled “ Abt027RestPreservedImplicitQueryFallbackRequiresExplicitBindings”ABT-027: Preserved implicit query fallback requires at least one explicit binding.
public static readonly DiagnosticDescriptor Abt027RestPreservedImplicitQueryFallbackRequiresExplicitBindingsField Value
Section titled “Field Value”Methods
Section titled “Methods”Initialize(IncrementalGeneratorInitializationContext)
Section titled “ Initialize(IncrementalGeneratorInitializationContext)”Called to initialize the generator and register generation steps via callbacks
on the context
public void Initialize(IncrementalGeneratorInitializationContext context)Parameters
Section titled “Parameters”context IncrementalGeneratorInitializationContext
The