Overloaded to make variables appear as bean properties or via the subscript operator
544257
public Object getProperty(String property) {
        try {
            return getProxyBuilder().doGetProperty(property);
        } catch (MissingPropertyException mpe) {
            if ((getContext() != null) && (getContext().containsKey(property))) {
                return getContext().get(property);
            } else {
                try {
                    return getMetaClass().getProperty(this, property);
                } catch(MissingPropertyException mpe2) {
                    if(mpe2.getProperty().equals(property) && propertyMissingDelegate != null) {
                        return propertyMissingDelegate.call(new Object[]{property});
                    }
                    throw mpe2;
                }
            }
        }
    }
849798
def p_encaps_var_object_property(p):
    ''
    p[0] = ast.ObjectProperty(ast.Variable(p[1], lineno=p.lineno(1)), p[3],
                              lineno=p.lineno(2))
462117
protected Object getBeanProperty(final Object object, String propertyName) {
        Object value;
        try {
            value = BeanUtils.getProperty(object, propertyName);
        } catch (InvocationTargetException e) {
            // ignore
            value = null;
        }
        return value;
    }
778301
function AbstractFormField(element, variableManager) {
  this.element = $( element );
  this.variableManager = variableManager;

  this.variableName = null;

  this.initialize();
}
935111
@Override
    public void readFromObject(Object object) {
        try {
            Method method = BeanUtils.getReadMethod(object.getClass(), getName());
            if (method != null) {
                Object value = method.invoke(object);
                initializeValue(value); // avoid updating parent or firing property change
                if (value != null) {
                    for (Property subProperty : subProperties) {
                        subProperty.readFromObject(value);
                    }
                }
            }
        } catch (IllegalAccessException e) {
            throw new RuntimeException(e);
        } catch (IllegalArgumentException e) {
            throw new RuntimeException(e);
        } catch (InvocationTargetException e) {
            throw new RuntimeException(e);
        }
    }
1322066
private void addToUsedVariables(final java.util.List<VariableAndValue> usedVariables, final MethodAndParameter top, final Variable variable) {
        VariableAndValue variableAndValue = new VariableAndValue(variable, top.getParameter());
        if (!usedVariables.contains(variableAndValue)) {
            usedVariables.add(variableAndValue);
        } else {
            int i = 0;
            do {
                i++;
                variableAndValue = new VariableAndValue(
                        new Variable(
                                elementUtils.getName(variable.getName().toString() + i),
                                variable.getType()
                        ),
                        top.getParameter()
                );
            } while (usedVariables.contains(variableAndValue));
            usedVariables.add(variableAndValue);
        }
    }
1122157
private void addFieldsForComputedMethod(TypeElement component, Set<String> alreadyDone) {
    getMethodsWithAnnotation(component, Computed.class).forEach(method -> {
      String propertyName = computedPropertyNameToFieldName(getComputedPropertyName(method));

      if (alreadyDone.contains(propertyName)) {
        return;
      }

      TypeMirror propertyType = getComputedPropertyTypeFromMethod(method);
      componentExposedTypeBuilder
          .addField(FieldSpec
              .builder(TypeName.get(propertyType),
                  propertyName,
                  Modifier.PROTECTED)
              .addAnnotation(JsProperty.class)
              .build());
      alreadyDone.add(propertyName);
    });

    getSuperComponentType(component)
        .ifPresent(superComponent -> addFieldsForComputedMethod(superComponent, alreadyDone));
  }
381504
private Map<String, Object> writeBean(Bean bean, Class<?> declaredType) {
        Map<String, Object> result = new LinkedHashMap<>();
        // property information
        for (MetaProperty<?> prop : bean.metaBean().metaPropertyIterable()) {
            if (prop.style().isSerializable() || (prop.style().isDerived() && settings.isIncludeDerived())) {
                Object value = SerOptional.extractValue(prop, bean);
                if (value != null) {
                    Object outputValue = null;
                    Class<?> propType = SerOptional.extractType(prop, bean.getClass());
                    if (value instanceof Bean) {
                        if (settings.getConverter().isConvertible(value.getClass())) {
                            outputValue = writeSimple(propType, value);
                        } else {
                            outputValue = writeBean((Bean) value, propType);
                        }
                    } else {
                        SerIterator itemIterator = settings.getIteratorFactory().create(value, prop, bean.getClass(), true);
                        if (itemIterator != null) {
                            outputValue = writeElements(itemIterator);
                        } else {
                            outputValue = writeSimple(propType, value);
                        }
                    }
                    result.put(prop.name(), outputValue);
                }
            }
        }
        return result;
    }
401935
@Override public void makeBuildVariables(AbstractBuild build, Map<String,String> variables) {
        super.makeBuildVariables(build, variables);
    }
124010
@Override
  public String toObjectExpr(String columnName)
  {
    if (_value == null) {
      return "null";
    }
    else if (_value instanceof String) {
      return "'" + _value + "'";
    }
    else {
      return String.valueOf(_value);
    }
  }
298331
private boolean extendsVariableContext(final TypeElement typeElement) {
        boolean extendsVariableContext = false;
        for (TypeMirror extendingInterface : typeElement.getInterfaces()) {
            if (extendingInterface.toString().equals(VariableContext.class.getCanonicalName())) {
                extendsVariableContext = true;
            }
        }
        return extendsVariableContext;
    }
276342
@Override
    protected void fillConstructorProperties(IdFunctionObject ctor)
    {
        ctor.put("BYTES_PER_ELEMENT", ctor, ScriptRuntime.wrapInt(getBytesPerElement()));
    }
834293
public JFieldVar searchSuperClassesForField(String property, JDefinedClass jclass) {
    JClass superClass = jclass._extends();
    JDefinedClass definedSuperClass = definedClassOrNullFromType(superClass);
    if (definedSuperClass == null) {
      return null;
    }
    return searchClassAndSuperClassesForField(property, definedSuperClass);
  }
475136
private void addInjectedVariable(VariableElement element, String fieldName) {
    TypeName typeName = resolveVariableTypeName(element, messager);

    // Create field
    FieldSpec.Builder fieldBuilder = FieldSpec.builder(typeName, fieldName, Modifier.PUBLIC);

    // Copy field annotations
    element
        .getAnnotationMirrors()
        .stream()
        .map(AnnotationSpec::get)
        .forEach(fieldBuilder::addAnnotation);

    // If the variable element is a method parameter, it might not have the Inject annotation
    if (!hasInjectAnnotation(element)) {
      fieldBuilder.addAnnotation(Inject.class);
    }

    // And add field
    builder.addField(fieldBuilder.build());
  }
627242
@Override
    public void makeBuildVariables(AbstractBuild build, Map<String, String> variables) {
        // global var/password pairs
        MaskPasswordsConfig config = MaskPasswordsConfig.getInstance();
        List<VarPasswordPair> globalVarPasswordPairs = config.getGlobalVarPasswordPairs();
        // we can't use variables.putAll() since passwords are ciphered when in varPasswordPairs
        for(VarPasswordPair globalVarPasswordPair: globalVarPasswordPairs) {
            variables.put(globalVarPasswordPair.getVar(), globalVarPasswordPair.getPassword());
        }

        // job's var/password pairs
        if(varPasswordPairs != null) {
            // cf. comment above
            for(VarPasswordPair varPasswordPair: varPasswordPairs) {
                if(StringUtils.isNotBlank(varPasswordPair.getVar())) {
                    variables.put(varPasswordPair.getVar(), varPasswordPair.getPassword());
                }
            }
        }
    }
171168
private void registerFieldsAndMethodsInContext(TemplateParserContext templateParserContext,
      TypeElement componentTypeElement, Set<String> alreadyDoneVariable,
      Set<String> alreadyDoneMethods) {
    ElementFilter
        .fieldsIn(componentTypeElement.getEnclosedElements())
        .stream()
        .filter(field -> field.getAnnotation(Data.class) != null
            || field.getAnnotation(Prop.class) != null)
        .forEach(field -> {
          String name = field.getSimpleName().toString();
          if (alreadyDoneVariable.contains(name)) {
            return;
          }

          alreadyDoneVariable.add(name);
          templateParserContext.addRootVariable(ClassName.get(field.asType()), name);
        });

    ElementFilter
        .methodsIn(componentTypeElement.getEnclosedElements())
        .stream()
        .filter(method -> hasAnnotation(method, Computed.class))
        .filter(method -> !"void".equals(method.getReturnType().toString()))
        .forEach(method -> {
          String name = getComputedPropertyName(method);
          if (alreadyDoneVariable.contains(name)) {
            return;
          }
          alreadyDoneVariable.add(name);

          TypeMirror propertyType;
          if ("void".equals(method.getReturnType().toString())) {
            propertyType = method.getParameters().get(0).asType();
          } else {
            propertyType = method.getReturnType();
          }

          templateParserContext
              .addRootComputedProperty(ClassName.get(propertyType), name,
                  computedPropertyNameToFieldName(name));
        });

    ElementFilter
        .methodsIn(componentTypeElement.getEnclosedElements())
        .stream()
        .filter(ComponentGeneratorsUtil::isMethodVisibleInTemplate)
        .map(ExecutableElement::getSimpleName)
        .map(Object::toString)
        .forEach(methodName -> {
          if (alreadyDoneMethods.contains(methodName)) {
            return;
          }
          alreadyDoneMethods.add(methodName);

          templateParserContext.addRootMethod(methodName);
        });

    getSuperComponentType(componentTypeElement)
        .ifPresent(superComponent -> registerFieldsAndMethodsInContext(
            templateParserContext,
            superComponent,
            alreadyDoneVariable,
            alreadyDoneMethods));
  }
654969
function getSuperPropBinding(thisEnvFn, isAssignment, propName) {
  const op = isAssignment ? "set" : "get";

  return getBinding(thisEnvFn, `superprop_${op}:${propName || ""}`, () => {
    const argsList = [];

    let fnBody;
    if (propName) {
      // () => super.foo
      fnBody = t.memberExpression(t.super(), t.identifier(propName));
    } else {
      const method = thisEnvFn.scope.generateUidIdentifier("prop");
      // (method) => super[method]
      argsList.unshift(method);
      fnBody = t.memberExpression(
        t.super(),
        t.identifier(method.name),
        true /* computed */,
      );
    }

    if (isAssignment) {
      const valueIdent = thisEnvFn.scope.generateUidIdentifier("value");
      argsList.push(valueIdent);

      fnBody = t.assignmentExpression(
        "=",
        fnBody,
        t.identifier(valueIdent.name),
      );
    }

    return t.arrowFunctionExpression(argsList, fnBody);
  });
}