struct Noir::TreeSitterKotlinParameterExtractor::FieldInfo

Defined in:

miniparsers/kotlin_parameter_extractor_ts.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(name : String, access_modifier : String, has_setter : Bool, init_value : String, null_validation_groups : Array(String) = [] of String, server_managed : Bool = false, validation_annotations : Array(String) = [] of String, init_string_literal : Bool = false) #

[View source]

Instance Method Detail

def access_modifier : String #

[View source]
def has_setter? : Bool #

[View source]
def init_string_literal? : Bool #

True when #init_value came from a string_literal node and was therefore already decoded (quotes stripped) on the way in.


[View source]
def init_value : String #

[View source]
def literal_default : String #

The request-ready value of this field's initializer, or "" when the initializer is an expression with no literal form.

#init_value cannot be handed to Noir::JvmLiteral.value_of directly, because Kotlin's collector stores mixed shapes: a string_literal is decoded (= "untitled" -> untitled) while every other initializer keeps its raw source (= LocalDateTime.now()). A decoded string is indistinguishable from a bare identifier once stored, so running the literal check over it erased every string default in a Kotlin DTO. The flag is what tells the two apart. Java's collector keeps raw text throughout, which is why its call site passes #init_value straight in.


[View source]
def name : String #

[View source]
def null_for_any_group?(groups : Array(String)) : Bool #

[View source]
def null_validation_groups : Array(String) #

[View source]
def server_managed? : Bool #

[View source]
def validation_annotations : Array(String) #

[View source]