Exemplo n.º 1
0
 private void generateGetter(JetProperty p, PropertyDescriptor propertyDescriptor) {
   final JetPropertyAccessor getter = p.getGetter();
   if (getter != null) {
     if (getter.getBodyExpression() != null) {
       JvmPropertyAccessorSignature signature =
           state.getInjector().getJetTypeMapper().mapGetterSignature(propertyDescriptor, kind);
       functionCodegen.generateMethod(
           getter,
           signature.getJvmMethodSignature(),
           true,
           signature.getPropertyTypeKotlinSignature(),
           propertyDescriptor.getGetter());
     } else if (isExternallyAccessible(propertyDescriptor)) {
       generateDefaultGetter(p);
     }
   } else if (isExternallyAccessible(propertyDescriptor)) {
     generateDefaultGetter(p);
   }
 }
Exemplo n.º 2
0
 private void generateSetter(JetProperty p, PropertyDescriptor propertyDescriptor) {
   final JetPropertyAccessor setter = p.getSetter();
   if (setter != null) {
     if (setter.getBodyExpression() != null) {
       final PropertySetterDescriptor setterDescriptor = propertyDescriptor.getSetter();
       assert setterDescriptor != null;
       JvmPropertyAccessorSignature signature =
           state.getInjector().getJetTypeMapper().mapSetterSignature(propertyDescriptor, kind);
       functionCodegen.generateMethod(
           setter,
           signature.getJvmMethodSignature(),
           true,
           signature.getPropertyTypeKotlinSignature(),
           setterDescriptor);
     } else if (isExternallyAccessible(propertyDescriptor)) {
       generateDefaultSetter(p);
     }
   } else if (isExternallyAccessible(propertyDescriptor) && propertyDescriptor.isVar()) {
     generateDefaultSetter(p);
   }
 }