system/src/sc/lang/java/TransformUtil.java
public static void makePropertyBindable(TypeDeclaration typeDeclaration, String propertyName, ILanguageModel.RuntimeType runtime) {
      PropertyDefinitionParameters params = PropertyDefinitionParameters.create(propertyName);
      TypeContext tctx = new TypeContext();
      tctx.transformed = true;
      Object variableDef = typeDeclaration.definesMember(propertyName, JavaSemanticNode.MemberType.FieldSet, null, tctx);
      // Skipping interfaces here.  We want to only find implementation methods that we have to rename or contend with if we are converting a field and there are already get/set methods in the same type.
      Object getMethod = params.getMethod = typeDeclaration.definesMember(propertyName, JavaSemanticNode.MemberType.GetMethodSet, null, tctx);
      Object setMethod = params.setMethod = typeDeclaration.definesMember(propertyName, JavaSemanticNode.MemberType.SetMethodSet, null, tctx);

      LayeredSystem sys = typeDeclaration.getLayeredSystem();

      if (variableDef == null) {
         if (setMethod == null) {
            System.err.println("*** Can't make property: " + propertyName + " bindable in type:" + typeDeclaration.typeName + " - no set method or field found");
            return;
         }
         if (getMethod == null) {
            System.err.println("*** Can't make property: " + propertyName + " bindable in type:" + typeDeclaration.typeName + " - no get method or field found");
            return;
         }
      }

      if ((getMethod != null && ModelUtil.isAbstractMethod(getMethod)) || (setMethod != null && ModelUtil.isAbstractMethod(setMethod))) {
         // If the variableDef is not null, this property should be converted in the convertFieldToGetSetMethods - the case where we have a field that
         // implements getX/setX methods from an interface or abstract class
         if (variableDef == null)
            typeDeclaration.displayError("Unable to make properties implemented with abstract methods bindable: " + propertyName + ": ");
         return;
      }

      params.propertyTypeName = ModelUtil.getGenericTypeName(typeDeclaration, getMethod == null ? variableDef : getMethod, true);
      params.overrideField = variableDef != null;
      params.useIndexSetForArrays = typeDeclaration.getLayeredSystem().useIndexSetForArrays;

      int aix = params.propertyTypeName.indexOf("[");
      if (aix != -1) {
         params.arrayDimensions = params.propertyTypeName.substring(aix);
         params.propertyTypeName = params.propertyTypeName.substring(0, aix);
      }

      params.initializer = "";

      int ix = typeDeclaration.body.size();

      makePropertyBindableInType(variableDef, typeDeclaration, propertyName, params, false, true);

      Layer refLayer = typeDeclaration.getLayer();
      DBPropertyDescriptor propDesc = DBProvider.getDBPropertyDescriptor(sys, refLayer, typeDeclaration, propertyName);
      if (propDesc != null)
         params.initForPropertyDesc(sys, refLayer, typeDeclaration, propDesc);

      params.omitField = params.overrideField || params.overrideGetSet;

      applyPropertyTemplate(typeDeclaration, ix, params, typeDeclaration, false, null);
   }
/**
    * This method makes a property that already exists in the base-class bindable in the typeDeclaration given.
    * It will call super.getX and super.setX to get and set the base-type's variable.
    *
    * This is related to convertFieldToGetSetMethods - that methods converts a field into getX/setX methods.
    */
This method makes a property that already exists in the base-class bindable in the typeDeclaration given.
It will call super.getX and super.setX to get and set the base-type's variable.

This is related to convertFieldToGetSetMethods - that methods converts a field into getX/setX methods.
This method makes a property that already exists in the base - class bindable in the typeDeclaration given . It will call super . getX and super . setX to get and set the base - type ' s variable . This is related to convertFieldToGetSetMethods - that methods converts a field into getX / setX methods .
public static void makePropertyBindable(TypeDeclaration typeDeclaration, String propertyName, ILanguageModel.RuntimeType runtime) {
      PropertyDefinitionParameters params = PropertyDefinitionParameters.create(propertyName);
      TypeContext tctx = new TypeContext();
      tctx.transformed = true;
      Object variableDef = typeDeclaration.definesMember(propertyName, JavaSemanticNode.MemberType.FieldSet, null, tctx);
      Object getMethod = params.getMethod = typeDeclaration.definesMember(propertyName, JavaSemanticNode.MemberType.GetMethodSet, null, tctx);
      Object setMethod = params.setMethod = typeDeclaration.definesMember(propertyName, JavaSemanticNode.MemberType.SetMethodSet, null, tctx);
      LayeredSystem sys = typeDeclaration.getLayeredSystem();
      if (variableDef == null) {
         if (setMethod == null) {
            System.err.println("*** Can't make property: " + propertyName + " bindable in type:" + typeDeclaration.typeName + " - no set method or field found");
            return;
         }
         if (getMethod == null) {
            System.err.println("*** Can't make property: " + propertyName + " bindable in type:" + typeDeclaration.typeName + " - no get method or field found");
            return;
         }
      }
      if ((getMethod != null && ModelUtil.isAbstractMethod(getMethod)) || (setMethod != null && ModelUtil.isAbstractMethod(setMethod))) {
         if (variableDef == null)
            typeDeclaration.displayError("Unable to make properties implemented with abstract methods bindable: " + propertyName + ": ");
         return;
      }
      params.propertyTypeName = ModelUtil.getGenericTypeName(typeDeclaration, getMethod == null ? variableDef : getMethod, true);
      params.overrideField = variableDef != null;
      params.useIndexSetForArrays = typeDeclaration.getLayeredSystem().useIndexSetForArrays;
      int aix = params.propertyTypeName.indexOf("[");
      if (aix != -1) {
         params.arrayDimensions = params.propertyTypeName.substring(aix);
         params.propertyTypeName = params.propertyTypeName.substring(0, aix);
      }
      params.initializer = "";
      int ix = typeDeclaration.body.size();
      makePropertyBindableInType(variableDef, typeDeclaration, propertyName, params, false, true);
      Layer refLayer = typeDeclaration.getLayer();
      DBPropertyDescriptor propDesc = DBProvider.getDBPropertyDescriptor(sys, refLayer, typeDeclaration, propertyName);
      if (propDesc != null)
         params.initForPropertyDesc(sys, refLayer, typeDeclaration, propDesc);
      params.omitField = params.overrideField || params.overrideGetSet;
      applyPropertyTemplate(typeDeclaration, ix, params, typeDeclaration, false, null);
   }
public static void makePropertyBindable ( TypeDeclaration typeDeclaration , String propertyName , ILanguageModel . RuntimeType runtime ) { PropertyDefinitionParameters params = PropertyDefinitionParameters . create ( propertyName ) ; TypeContext tctx = new TypeContext ( ) ; tctx . transformed = true ; Object variableDef = typeDeclaration . definesMember ( propertyName , JavaSemanticNode . MemberType . FieldSet , null , tctx ) ; Object getMethod = params . getMethod = typeDeclaration . definesMember ( propertyName , JavaSemanticNode . MemberType . GetMethodSet , null , tctx ) ; Object setMethod = params . setMethod = typeDeclaration . definesMember ( propertyName , JavaSemanticNode . MemberType . SetMethodSet , null , tctx ) ; LayeredSystem sys = typeDeclaration . getLayeredSystem ( ) ; if ( variableDef == null ) { if ( setMethod == null ) { System . err . println ( "*** Can't make property: " + propertyName + " bindable in type:" + typeDeclaration . typeName + " - no set method or field found" ) ; return ; } if ( getMethod == null ) { System . err . println ( "*** Can't make property: " + propertyName + " bindable in type:" + typeDeclaration . typeName + " - no get method or field found" ) ; return ; } } if ( ( getMethod != null && ModelUtil . isAbstractMethod ( getMethod ) ) || ( setMethod != null && ModelUtil . isAbstractMethod ( setMethod ) ) ) { if ( variableDef == null ) typeDeclaration . displayError ( "Unable to make properties implemented with abstract methods bindable: " + propertyName + ": " ) ; return ; } params . propertyTypeName = ModelUtil . getGenericTypeName ( typeDeclaration , getMethod == null ? variableDef : getMethod , true ) ; params . overrideField = variableDef != null ; params . useIndexSetForArrays = typeDeclaration . getLayeredSystem ( ) . useIndexSetForArrays ; int aix = params . propertyTypeName . indexOf ( "[" ) ; if ( aix != - 1 ) { params . arrayDimensions = params . propertyTypeName . substring ( aix ) ; params . propertyTypeName = params . propertyTypeName . substring ( 0 , aix ) ; } params . initializer = "" ; int ix = typeDeclaration . body . size ( ) ; makePropertyBindableInType ( variableDef , typeDeclaration , propertyName , params , false , true ) ; Layer refLayer = typeDeclaration . getLayer ( ) ; DBPropertyDescriptor propDesc = DBProvider . getDBPropertyDescriptor ( sys , refLayer , typeDeclaration , propertyName ) ; if ( propDesc != null ) params . initForPropertyDesc ( sys , refLayer , typeDeclaration , propDesc ) ; params . omitField = params . overrideField || params . overrideGetSet ; applyPropertyTemplate ( typeDeclaration , ix , params , typeDeclaration , false , null ) ; }
This method makes a property that already exists in the base-class bindable in the typeDeclaration given.
This method makes a property that already exists in the base - class bindable in the typeDeclaration given .
// Skipping interfaces here.  We want to only find implementation methods that we have to rename or contend with if we are converting a field and there are already get/set methods in the same type. // If the variableDef is not null, this property should be converted in the convertFieldToGetSetMethods - the case where we have a field that // implements getX/setX methods from an interface or abstract class