Ejemplo n.º 1
0
  /** Returns the field value. */
  @Override
  public Value getField(Env env, StringValue name) {
    Value value = _classDef.getField(env, this, name);

    if (value != null) return value;
    else return UnsetValue.NULL;
  }
  /** Returns fields not explicitly specified by this value. */
  @Override
  protected Value getFieldExt(Env env, StringValue name) {
    if (_object == null) {
      _object = createJavaObject(env);
    }

    Value parentValue = super.getFieldExt(env, name);
    if (parentValue != NullValue.NULL && parentValue != UnsetValue.UNSET) return parentValue;

    Value value = _javaClassDef.getField(env, this, name);
    Value quercusValue = _quercusClass.getField(env, this, name);

    if (quercusValue != null
        && quercusValue != UnsetValue.UNSET
        && quercusValue != NullValue.NULL) {
      return quercusValue;
    }

    if (value != null) return value;
    else return super.getFieldExt(env, name);
  }