system/src/sc/lang/java/VariableDefinition.java
public void init() {
      if (initialized)
         return;

      // Propagate the old-school C array dimension syntax to the type
      if (variableName != null && variableName.endsWith("[]")) {
         int dimsIx = variableName.indexOf("[]");
         arrayDimensions = variableName.substring(dimsIx);
         variableName = variableName.substring(0,dimsIx);
      }

      // The annotation makes us bindable, or this gets set if we are used in a binding expression
      Object annot = null;
      bindable = bindable || (annot = ModelUtil.getBindableAnnotation(getDefinition())) != null;

      bindingDirection = ModelUtil.initBindingDirection(operator);
      if (bindingDirection != null) {
         Definition def = getDefinition();
         if (!(def instanceof FieldDefinition)) {
            def.displayError("Data binding operator only valid for field definitions: ");
            bindingDirection = null;
         }
         else if (initializer == null) {
            displayError("Invalid empty binding expression: ");
            bindingDirection = null;
         }
         else
            initializer.setBindingInfo(bindingDirection, getDefinition(), false);
      }

      if (bindable) {
         needsDynAccess = true;

         if (!(getDefinition() instanceof FieldDefinition)) {
            displayError("@Bindable annotation invalid on non-fields: ");
         }
         if (annot != null && ModelUtil.isAutomaticBindingAnnotation(annot)) {
            if (canMakeBindable())
               enableConvertGetSet();
            else
               displayError("@Bindable not allowed on static interface properties for: ");
         }
      }

      if (!convertGetSet) {
         Statement def = getDefinition();
         Object annotObj = ModelUtil.getAnnotation(def, "sc.obj.GetSet");
         if (annotObj != null) {
            if (!(def instanceof FieldDefinition)) {
               displayError("@GetSet annotation invalid on non-fields: ");
            }
            else {
               Object value = ModelUtil.getAnnotationValue(annotObj, "value");
               if (value == null || (value instanceof Boolean && ((Boolean) value)))
                  enableConvertGetSet();
            }
         }
         /*
          * TODO: If we have a field which lives in a type with an abstract getX and setX methods, but no implementation, should we set convertGetSet to
          * automatically fill that contract?  What are the side-effects of doing that for an abstract class where maybe a getX or setX is already implemented downstream?
          * Need to match the public/private modifiers... since a private field should not convertGetSet on an interface.
         if (!convertGetSet && def instanceof FieldDefinition) {
            TypeDeclaration enclType = getEnclosingType();
            Object getXMeth = enclType.definesMethod("get" + CTypeUtil.capitalizePropertyName(variableName), null, )
            if (getMeth.isAbstract() && modifiers match) convertGetSet = true;
         }
         */
      }
      super.init();
   }
// We create these VariableDefinition's for the metadata of a property - they are properties even if they are not part of a FieldDefinition
We create these VariableDefinition's for the metadata of a property - they are properties even if they are not part of a FieldDefinition
We create these VariableDefinition ' s for the metadata of a property - they are properties even if they are not part of a FieldDefinition
public void init() {
      if (initialized)
         return;
      if (variableName != null && variableName.endsWith("[]")) {
         int dimsIx = variableName.indexOf("[]");
         arrayDimensions = variableName.substring(dimsIx);
         variableName = variableName.substring(0,dimsIx);
      }
      Object annot = null;
      bindable = bindable || (annot = ModelUtil.getBindableAnnotation(getDefinition())) != null;
      bindingDirection = ModelUtil.initBindingDirection(operator);
      if (bindingDirection != null) {
         Definition def = getDefinition();
         if (!(def instanceof FieldDefinition)) {
            def.displayError("Data binding operator only valid for field definitions: ");
            bindingDirection = null;
         }
         else if (initializer == null) {
            displayError("Invalid empty binding expression: ");
            bindingDirection = null;
         }
         else
            initializer.setBindingInfo(bindingDirection, getDefinition(), false);
      }
      if (bindable) {
         needsDynAccess = true;
         if (!(getDefinition() instanceof FieldDefinition)) {
            displayError("@Bindable annotation invalid on non-fields: ");
         }
         if (annot != null && ModelUtil.isAutomaticBindingAnnotation(annot)) {
            if (canMakeBindable())
               enableConvertGetSet();
            else
               displayError("@Bindable not allowed on static interface properties for: ");
         }
      }
      if (!convertGetSet) {
         Statement def = getDefinition();
         Object annotObj = ModelUtil.getAnnotation(def, "sc.obj.GetSet");
         if (annotObj != null) {
            if (!(def instanceof FieldDefinition)) {
               displayError("@GetSet annotation invalid on non-fields: ");
            }
            else {
               Object value = ModelUtil.getAnnotationValue(annotObj, "value");
               if (value == null || (value instanceof Boolean && ((Boolean) value)))
                  enableConvertGetSet();
            }
         }
         /*
          * TODO: If we have a field which lives in a type with an abstract getX and setX methods, but no implementation, should we set convertGetSet to
          * automatically fill that contract?  What are the side-effects of doing that for an abstract class where maybe a getX or setX is already implemented downstream?
          * Need to match the public/private modifiers... since a private field should not convertGetSet on an interface.
         if (!convertGetSet && def instanceof FieldDefinition) {
            TypeDeclaration enclType = getEnclosingType();
            Object getXMeth = enclType.definesMethod("get" + CTypeUtil.capitalizePropertyName(variableName), null, )
            if (getMeth.isAbstract() && modifiers match) convertGetSet = true;
         }
         */
      }
      super.init();
   }
public void init ( ) { if ( initialized ) return ; if ( variableName != null && variableName . endsWith ( "[]" ) ) { int dimsIx = variableName . indexOf ( "[]" ) ; arrayDimensions = variableName . substring ( dimsIx ) ; variableName = variableName . substring ( 0 , dimsIx ) ; } Object annot = null ; bindable = bindable || ( annot = ModelUtil . getBindableAnnotation ( getDefinition ( ) ) ) != null ; bindingDirection = ModelUtil . initBindingDirection ( operator ) ; if ( bindingDirection != null ) { Definition def = getDefinition ( ) ; if ( ! ( def instanceof FieldDefinition ) ) { def . displayError ( "Data binding operator only valid for field definitions: " ) ; bindingDirection = null ; } else if ( initializer == null ) { displayError ( "Invalid empty binding expression: " ) ; bindingDirection = null ; } else initializer . setBindingInfo ( bindingDirection , getDefinition ( ) , false ) ; } if ( bindable ) { needsDynAccess = true ; if ( ! ( getDefinition ( ) instanceof FieldDefinition ) ) { displayError ( "@Bindable annotation invalid on non-fields: " ) ; } if ( annot != null && ModelUtil . isAutomaticBindingAnnotation ( annot ) ) { if ( canMakeBindable ( ) ) enableConvertGetSet ( ) ; else displayError ( "@Bindable not allowed on static interface properties for: " ) ; } } if ( ! convertGetSet ) { Statement def = getDefinition ( ) ; Object annotObj = ModelUtil . getAnnotation ( def , "sc.obj.GetSet" ) ; if ( annotObj != null ) { if ( ! ( def instanceof FieldDefinition ) ) { displayError ( "@GetSet annotation invalid on non-fields: " ) ; } else { Object value = ModelUtil . getAnnotationValue ( annotObj , "value" ) ; if ( value == null || ( value instanceof Boolean && ( ( Boolean ) value ) ) ) enableConvertGetSet ( ) ; } } /*
          * TODO: If we have a field which lives in a type with an abstract getX and setX methods, but no implementation, should we set convertGetSet to
          * automatically fill that contract?  What are the side-effects of doing that for an abstract class where maybe a getX or setX is already implemented downstream?
          * Need to match the public/private modifiers... since a private field should not convertGetSet on an interface.
         if (!convertGetSet && def instanceof FieldDefinition) {
            TypeDeclaration enclType = getEnclosingType();
            Object getXMeth = enclType.definesMethod("get" + CTypeUtil.capitalizePropertyName(variableName), null, )
            if (getMeth.isAbstract() && modifiers match) convertGetSet = true;
         }
         */ } super . init ( ) ; }
We create these VariableDefinition's for the metadata of a property - they are properties even if they are not part of a FieldDefinition
We create these VariableDefinition ' s for the metadata of a property - they are properties even if they are not part of a FieldDefinition
// Propagate the old-school C array dimension syntax to the type // The annotation makes us bindable, or this gets set if we are used in a binding expression