compiler-plugin / arrow.meta.quotes.nameddeclaration.stub.typeparameterlistowner / Property

Property

class Property : TypeParameterListOwner<KtProperty>, SyntheticElement

””” $modality $visibility $valOrVar $name $returnType $initializer “”“.property

*

A template destructuring Scope for a KtProperty.

import arrow.meta.Meta
import arrow.meta.CliPlugin
import arrow.meta.invoke
import arrow.meta.quotes.Transform
import arrow.meta.quotes.property

val Meta.reformatPropertySetter: CliPlugin
 get() =
  "Reformat Property Setter" {
   meta(
    property({ true }) { e ->
     Transform.replace(
      replacing = e,
      newDeclaration = """$modality $visibility $valOrVar $name $returnType $initializer
                             $getter
                             $setter
                             $delegate""".property
     )
     }
    )
   }

Constructors

| <init> | “”” $modality $visibility $valOrVar $name $returnType $initializer “”“.propertyProperty(value: KtProperty, modality: Name? = value.modalityModifierType()?.value?.let(Name::identifier), visibility: Name? = value.visibilityModifierType()?.value?.let(Name::identifier), (typeParameters): ScopedList<KtTypeParameter> = ScopedList(prefix = "<", value = value.typeParameters ?: listOf(), postfix = ">"), receiver: ScopedList<KtTypeReference> = ScopedList(listOfNotNull(value.receiverTypeReference), postfix = "."), name: Name? = value.nameAsName, typeReference: TypeReference? = TypeReference(value.typeReference), (params): ScopedList<KtParameter> = ScopedList( prefix = "(", value = value.valueParameters ?: listOf(), postfix = ")", forceRenderSurroundings = true ), delegate: Scope<KtPropertyDelegate> = Scope(value.delegate), delegateExpressionOrInitializer: Scope<KtExpression> = Scope(value.delegateExpressionOrInitializer), returnType: ScopedList<KtTypeReference> = ScopedList(listOfNotNull(value.typeReference), prefix = " : "), initializer: ScopedList<KtExpression> = ScopedList(listOfNotNull(value.initializer), prefix = " = "), valOrVar: Name = when { value.isVar -> "var" else -> "val" }.let(Name::identifier), getter: PropertyAccessor = PropertyAccessor(value.getter), setter: PropertyAccessor = PropertyAccessor(value.setter)) |

Properties

(params) val (params): ScopedList<KtParameter>
(typeParameters) val (typeParameters): ScopedList<KtTypeParameter>
delegate val delegate: Scope<KtPropertyDelegate>
delegateExpressionOrInitializer val delegateExpressionOrInitializer: Scope<KtExpression>
getter val getter: PropertyAccessor
initializer val initializer: ScopedList<KtExpression>
modality val modality: Name?
name val name: Name?
receiver val receiver: ScopedList<KtTypeReference>
returnType val returnType: ScopedList<KtTypeReference>
setter val setter: PropertyAccessor
typeReference val typeReference: TypeReference?
valOrVar val valOrVar: Name
value val value: KtProperty
visibility val visibility: Name?

Functions

identity fun ElementScope.identity(): Scope<KtProperty>

Extension Functions

map fun <K : KtElement> Scope<K>.map(f: (K) -> K): Scope<K>
orEmpty fun <K : KtElement> Scope<K>?.orEmpty(): Scope<K>

Do you like Arrow?

Arrow Org
<