Examples of FieldBinding


Examples of com.extjs.gxt.ui.client.binding.FieldBinding

    //Auto binding fields
    binding.autoBind();
    binding.bind(ficheStDto);

    //manually binding
    binding.addFieldBinding(new FieldBinding(lot, combineProps(FicheStDto.LOT, LotDto.NAME)));
//    binding.addFieldBinding(new FieldBinding(societe, combineProps(FicheStDto.SOCIETE, SocieteDto.NOM)));
    binding.addFieldBinding(new FieldBinding(chantierName, combineProps(
        FicheStDto.LOT, LotDto.CHANTIER, ChantierModel.NOM)));
    binding.addFieldBinding(new FieldBinding(chantierNameHidden, combineProps(
        FicheStDto.LOT, LotDto.CHANTIER, ChantierModel.NOM)));
    binding.addFieldBinding(new FieldBinding(chantierId, combineProps(
        FicheStDto.LOT, LotDto.CHANTIER, ChantierModel.ID)));
   
  }
View Full Code Here

Examples of org.apache.tapestry.binding.FieldBinding

        // BindingType.FIELD is on the way out, it is in the
        // 1.3 DTD but not the 1.4 DTD.

        if (type == BindingType.FIELD)
            return new FieldBinding(_resolver, value, location);

        // This code is unreachable, at least until a new type
        // of binding is created.

        throw new ApplicationRuntimeException("Unexpected type: " + type + ".");
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.FieldBinding

    if (mappingSequence == BlockScope.EmulationPathToImplicitThis) {
        this.aload_0();
        return;
    } else if (mappingSequence[0] instanceof FieldBinding) {
        FieldBinding fieldBinding = (FieldBinding) mappingSequence[0];
        this.aload_0();
        this.getfield(fieldBinding);
    } else {
        load((LocalVariableBinding) mappingSequence[0]);
    }
    for (int i = 1, length = mappingSequence.length; i < length; i++) {
        if (mappingSequence[i] instanceof FieldBinding) {
            FieldBinding fieldBinding = (FieldBinding) mappingSequence[i];
            this.getfield(fieldBinding);
        } else {
            this.invokestatic((MethodBinding) mappingSequence[i]);
        }
    }
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.FieldBinding

          output.append(pfb.name);
        } else if (snr.binding instanceof LocalVariableBinding) {
          LocalVariableBinding lvb = (LocalVariableBinding) snr.binding;
          output.append(lvb.name);
        } else if (snr.binding instanceof FieldBinding) {
          FieldBinding fb = (FieldBinding) snr.binding;
          ReferenceBinding rb = fb.declaringClass;
          if (fb.isStatic()) {
            // qualify it
            output.append(CharOperation.concatWith(rb.compoundName, '.'));
            output.append('.');
            output.append(fb.name);
          } else {
            output.append(snr.token);
          }
          int stop = 1;
        } else {
          throwit(snr.binding);
        }
        return output;
      } else if (e instanceof QualifiedNameReference) {
        QualifiedNameReference qnr = (QualifiedNameReference) e;
        if (qnr.binding instanceof FieldBinding) {
          FieldBinding fb = (FieldBinding) qnr.binding;
          ReferenceBinding rb = fb.declaringClass;
          if (fb.isStatic()) {
            output.append(CharOperation.concatWith(rb.compoundName, '.'));
            output.append('.');
            output.append(fb.name);
          } else {
            output.append(CharOperation.concatWith(qnr.tokens, '.'));// ((ReferenceBinding) qnr.binding).compoundName,
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.FieldBinding

    this.constant = Constant.NotAConstant;
    return null;
  }
  // the case receiverType.isArrayType and token = 'length' is handled by the scope API
  this.codegenBinding = this.binding = scope.getField(this.receiverType, this.token, this);
  FieldBinding firstAttempt = this.binding;
  boolean isNotVisible = false;
  if (!this.binding.isValidBinding()) {
    if (this.binding instanceof ProblemFieldBinding
      && ((ProblemFieldBinding) this.binding).problemId() == NotVisible) {
        isNotVisible = true;
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.FieldBinding

  this.bits |= Binding.FIELD;
  return getOtherFieldBindings(scope);
}
public void generateAssignment(BlockScope currentScope, CodeStream codeStream, Assignment assignment, boolean valueRequired) {

  FieldBinding lastFieldBinding = generateReadSequence(currentScope, codeStream);
  if (lastFieldBinding.canBeSeenBy(getReceiverType(currentScope), this, currentScope)) {
    // the last field access is a write access
    assignment.expression.generateCode(currentScope, codeStream, true);
    fieldStore(codeStream, lastFieldBinding, null, valueRequired);
  } else {
    codeStream.generateEmulationForField(lastFieldBinding);
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.FieldBinding

  if (this.constant != Constant.NotAConstant) {
    if (valueRequired) {
      codeStream.generateConstant(this.constant, this.implicitConversion);
    }
  } else {
    FieldBinding lastFieldBinding = generateReadSequence(currentScope, codeStream);
    if (valueRequired) {
      if (lastFieldBinding.declaringClass == null) { // array length
        codeStream.arraylength();
        codeStream.generateImplicitConversion(this.implicitConversion);
      } else {
        Constant fieldConstant = lastFieldBinding.constant();
        if (fieldConstant != Constant.NotAConstant) {
          if (!lastFieldBinding.isStatic()){
            codeStream.invokeObjectGetClass();
            codeStream.pop();
          }
          // inline the last field constant
          codeStream.generateConstant(fieldConstant, this.implicitConversion);
        } else
          if (lastFieldBinding.canBeSeenBy(getReceiverType(currentScope), this, currentScope)) {
            if (lastFieldBinding.isStatic()) {
              codeStream.getstatic(lastFieldBinding);
            } else {
              codeStream.getfield(lastFieldBinding);
            }
          } else {
            codeStream.generateEmulatedReadAccessForField(lastFieldBinding);
         
          codeStream.generateImplicitConversion(this.implicitConversion);
        }
      }
    } else {
      if (lastFieldBinding != null && !lastFieldBinding.isStatic()){
        codeStream.invokeObjectGetClass(); // perform null check
        codeStream.pop();
      }
    }   
  }
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.FieldBinding

  }
  codeStream.recordPositionsFrom(pc, this.sourceStart);
}
public void generateCompoundAssignment(BlockScope currentScope, CodeStream codeStream, Expression expression, int operator, int assignmentImplicitConversion, boolean valueRequired) {
 
  FieldBinding lastFieldBinding = generateReadSequence(currentScope, codeStream);
  if (lastFieldBinding.canBeSeenBy(getReceiverType(currentScope), this, currentScope)) {
    if (lastFieldBinding.isStatic()){
      codeStream.getstatic(lastFieldBinding);
    } else {
      codeStream.dup();
      codeStream.getfield(lastFieldBinding);
    }
    // the last field access is a write access
    // perform the actual compound operation
    int operationTypeID;
    switch(operationTypeID = (this.implicitConversion & IMPLICIT_CONVERSION_MASK) >> 4) {
      case T_JavaLangString :
      case T_JavaLangObject :
      case T_undefined :
        codeStream.generateStringConcatenationAppend(currentScope, null, expression);
        break;
      default :
        // promote the array reference to the suitable operation type
        codeStream.generateImplicitConversion(this.implicitConversion);
        // generate the increment value (will by itself  be promoted to the operation value)
        if (expression == IntLiteral.One){ // prefix operation
          codeStream.generateConstant(expression.constant, this.implicitConversion);     
        } else {
          expression.generateCode(currentScope, codeStream, true);
        }
        // perform the operation
        codeStream.sendOperator(operator, operationTypeID);
        // cast the value back to the array reference type
        codeStream.generateImplicitConversion(assignmentImplicitConversion);
    }
    // actual assignment
    fieldStore(codeStream, lastFieldBinding, null, valueRequired);
  } else {
    if (lastFieldBinding.isStatic()){
      codeStream.generateEmulationForField(lastFieldBinding);
      codeStream.swap();
      codeStream.aconst_null();
      codeStream.swap();
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.FieldBinding

    codeStream.generateEmulatedWriteAccessForField(lastFieldBinding);
  }
}
public void generatePostIncrement(BlockScope currentScope, CodeStream codeStream, CompoundAssignment postIncrement, boolean valueRequired) {

    FieldBinding lastFieldBinding = generateReadSequence(currentScope, codeStream);
  if (lastFieldBinding.canBeSeenBy(getReceiverType(currentScope), this, currentScope)) {
    if (lastFieldBinding.isStatic()){
      codeStream.getstatic(lastFieldBinding);
    } else {
      codeStream.dup();
      codeStream.getfield(lastFieldBinding);
   
    // duplicate the old field value
    if (valueRequired) {
      if (lastFieldBinding.isStatic()) {
        if ((lastFieldBinding.type == TypeBinding.LONG) || (lastFieldBinding.type == TypeBinding.DOUBLE)) {
          codeStream.dup2();
        } else {
          codeStream.dup();
        }
      } else { // Stack:  [owner][old field value]  ---> [old field value][owner][old field value]
        if ((lastFieldBinding.type == TypeBinding.LONG) || (lastFieldBinding.type == TypeBinding.DOUBLE)) {
          codeStream.dup2_x1();
        } else {
          codeStream.dup_x1();
        }
      }
    }
    codeStream.generateConstant(postIncrement.expression.constant, this.implicitConversion);
    codeStream.sendOperator(postIncrement.operator, lastFieldBinding.type.id);
    codeStream.generateImplicitConversion(postIncrement.preAssignImplicitConversion);
   
    fieldStore(codeStream, lastFieldBinding, null, false);
  } else {
    codeStream.generateEmulatedReadAccessForField(lastFieldBinding);
    if (valueRequired) {
      if ((lastFieldBinding.type == TypeBinding.LONG) || (lastFieldBinding.type == TypeBinding.DOUBLE)) {
        codeStream.dup2();
      } else {
        codeStream.dup();
      }
    }
    codeStream.generateEmulationForField(lastFieldBinding);
    if ((lastFieldBinding.type == TypeBinding.LONG) || (lastFieldBinding.type == TypeBinding.DOUBLE)) {
      codeStream.dup_x2();
      codeStream.pop();
      if (lastFieldBinding.isStatic()) {
        codeStream.aconst_null();
      } else {
        generateReadSequence(currentScope, codeStream);
      }
      codeStream.dup_x2();
      codeStream.pop();         
    } else {
      codeStream.dup_x1();
      codeStream.pop();
      if (lastFieldBinding.isStatic()) {
        codeStream.aconst_null();
      } else {
        generateReadSequence(currentScope, codeStream);
      }
      codeStream.dup_x1();
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.FieldBinding

public FieldBinding generateReadSequence(BlockScope currentScope, CodeStream codeStream) {
   
  // determine the rank until which we now we do not need any actual value for the field access
  int otherBindingsCount = this.otherCodegenBindings == null ? 0 : this.otherCodegenBindings.length;
  boolean needValue = otherBindingsCount == 0 || !this.otherBindings[0].isStatic();
  FieldBinding lastFieldBinding = null;
  TypeBinding lastGenericCast = null;
 
  switch (this.bits & RestrictiveFlagMASK) {
    case Binding.FIELD :
      lastFieldBinding = (FieldBinding) this.codegenBinding;
      lastGenericCast = this.genericCast;
      // if first field is actually constant, we can inline it
      if (lastFieldBinding.constant() != Constant.NotAConstant) {
        break;
      }
      if (needValue) {
        if (lastFieldBinding.canBeSeenBy(getReceiverType(currentScope), this, currentScope)) {
          if (!lastFieldBinding.isStatic()) {
            if ((this.bits & DepthMASK) != 0) {
              ReferenceBinding targetType = currentScope.enclosingSourceType().enclosingTypeAt((this.bits & DepthMASK) >> DepthSHIFT);
              Object[] emulationPath = currentScope.getEmulationPath(targetType, true /*only exact match*/, false/*consider enclosing arg*/);
              codeStream.generateOuterAccess(emulationPath, this, targetType, currentScope);
            } else {
              generateReceiver(codeStream);
            }
          }
        } else {
          if (!lastFieldBinding.isStatic()) {
            if ((this.bits & DepthMASK) != 0) {
              // internal error, per construction we should have found it
              // not yet supported
              currentScope.problemReporter().needImplementation();
            } else {
              generateReceiver(codeStream);
            }
          } else {
            codeStream.aconst_null();
          }
        }       
      }
      break;
    case Binding.LOCAL : // reading the first local variable
      if (!needValue) break; // no value needed
      LocalVariableBinding localBinding = (LocalVariableBinding) this.codegenBinding;
      // regular local variable read
      Constant localConstant = localBinding.constant();
      if (localConstant != Constant.NotAConstant) {
        codeStream.generateConstant(localConstant, 0);
        // no implicit conversion
      } else {
        // outer local?
        if ((bits & DepthMASK) != 0) {
          // outer local can be reached either through a synthetic arg or a synthetic field
          VariableBinding[] path = currentScope.getEmulationPath(localBinding);
          codeStream.generateOuterAccess(path, this, localBinding, currentScope);
        } else {
          codeStream.load(localBinding);
        }
      }
  }

  // all intermediate field accesses are read accesses
  // only the last field binding is a write access
  if (this.otherCodegenBindings != null) {
    for (int i = 0; i < otherBindingsCount; i++) {
      FieldBinding nextField = this.otherCodegenBindings[i];
      TypeBinding nextGenericCast = this.otherGenericCasts == null ? null : this.otherGenericCasts[i];
      if (lastFieldBinding != null) {
        needValue = !nextField.isStatic();
        if (needValue) {
          if (lastFieldBinding.canBeSeenBy(getReceiverType(currentScope), this, currentScope)) {
            Constant fieldConstant = lastFieldBinding.constant();
            if (fieldConstant != Constant.NotAConstant) {
              if (lastFieldBinding != this.codegenBinding && !lastFieldBinding.isStatic()) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.