Hobo Fields field declaration
545816
def field_added(name, type, args, options)
      if (default = options[:ruby_default])
        attr_default name, default
      elsif (default = options[:default]) && default.is_a?(Proc)
        ActiveSupport::Deprecation.warn(':default => Proc has been deprecated. Use :ruby_default.', caller)
        attr_default name, default
        options.delete(:default)
        options[:ruby_default] = default
      end
    end
317257
def p_field_void(self, p):
        """"""
        p[0] = AstVoidField(self.path, p.lineno(1), p.lexpos(1), p[1])
        if len(p) > 3:
            if p[4] is not None:
                p[0].set_annotations(p[4])

            if p[5] is not None:
                p[0].set_doc(p[5])
689328
private void addFieldToDocument(Object object, Document document, java.lang.reflect.Field field, String colName,
        String indexName) {
        try {
            Object obj = PropertyAccessorHelper.getObject(object, field);
            // String str =
            // String value = (obj == null) ? null : obj.toString();
            if (obj != null) {
                Field luceneField =
                    new Field(getCannonicalPropertyName(indexName, colName), obj.toString(), Field.Store.YES,
                        Field.Index.ANALYZED_NO_NORMS);

                document.add(luceneField);
            } else {
                LOG.warn("value is null for field" + field.getName());
            }
        } catch (PropertyAccessException e) {
            LOG.error("Error in accessing field, Caused by:" + e.getMessage());
            throw new LuceneIndexingException("Error in accessing field:" + field.getName(), e);
        }
    }
1277874
private void checkFieldDescriptor(FieldDescriptor field) {
        if (field.getContainingType() != metadata.descriptor) {
            throw new RuntimeException("Wrong FieldDescriptor \"" + field.getFullName() + "\" used in message \""
                    + metadata.descriptor.getFullName());
        }
    }
838600
public void register(final Field field) {
        final OneOf oneOfAnnotation = field.getAnnotation(OneOf.class);

        String groupName = null;
        if (oneOfAnnotation != null) {
            groupName = oneOfAnnotation.value();
        } else {
            final CanSatisfyOneOf canSatisfyOneOf = field.getAnnotation(CanSatisfyOneOf.class);
            if (canSatisfyOneOf != null) {
                groupName = canSatisfyOneOf.value();
            }
        }

        if (groupName != null) {
            OneOfGroup oneOfGroup = this.mapping.get(groupName);
            if (oneOfGroup == null) {
                oneOfGroup = new OneOfGroup(groupName);
                this.mapping.put(groupName, oneOfGroup);
            }
            oneOfGroup.choices.add(field);
        }
    }
856369
function(field) {
            var
              $field      = module.get.field(field.identifier),
              fieldValid  = true,
              fieldErrors = []
            ;
            if(field.rules !== undefined) {
              $.each(field.rules, function(index, rule) {
                if( module.has.field(field.identifier) && !( module.validate.rule(field, rule) ) ) {
                  module.debug('Field is invalid', field.identifier, rule.type);
                  fieldErrors.push(rule.prompt);
                  fieldValid = false;
                }
              });
            }
            if(fieldValid) {
              module.remove.prompt(field, fieldErrors);
              $.proxy(settings.onValid, $field)();
            }
            else {
              formErrors = formErrors.concat(fieldErrors);
              module.add.prompt(field, fieldErrors);
              $.proxy(settings.onInvalid, $field)(fieldErrors);
              return false;
            }
            return true;
          }
773144
public void setupFields()
    {
        FieldInfo field = null;
        field = new FieldInfo(this, ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field.setHidden(true);
        field = new FieldInfo(this, LAST_CHANGED, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Date.class);
        field.setHidden(true);
        field = new FieldInfo(this, DELETED, 10, null, new Boolean(false));
        field.setDataClass(Boolean.class);
        field.setHidden(true);
        field = new FieldInfo(this, KEY_FILENAME, 40, null, null);
        field = new FieldInfo(this, KEY_NUMBER, 2, null, null);
        field.setDataClass(Short.class);
        field = new FieldInfo(this, KEY_FIELD_1, 40, null, null);
        field = new FieldInfo(this, KEY_FIELD_2, 40, null, null);
        field = new FieldInfo(this, KEY_FIELD_3, 40, null, null);
        field = new FieldInfo(this, KEY_FIELD_4, 40, null, null);
        field = new FieldInfo(this, KEY_FIELD_5, 40, null, null);
        field = new FieldInfo(this, KEY_FIELD_6, 40, null, null);
        field = new FieldInfo(this, KEY_FIELD_7, 40, null, null);
        field = new FieldInfo(this, KEY_FIELD_8, 40, null, null);
        field = new FieldInfo(this, KEY_FIELD_9, 40, null, null);
        field = new FieldInfo(this, KEY_NAME, 40, null, null);
        field = new FieldInfo(this, KEY_TYPE, 1, null, null);
        field = new FieldInfo(this, INCLUDE_SCOPE, 10, null, new Integer(0x004));
        field.setDataClass(Integer.class);
    }
138928
function handleFieldBelong (field, names, space, factory) {

            var curr = names.shift();
            if ( curr ) {
                space.forEach(function (item) {
                    if ( item && item.field === curr ) {
                        if ( names.length === 0 ) {
                            if ( !item[field] ) {
                                item[field] = [];
                            }
                            item[field].push(factory)
                        } else if ( item.param ) {
                            handleFieldBelong(field, names, item.param, factory);
                        }
                    }
                });
            }
        }
1226490
private void setFieldIf(int key, String value, String undef) {
    if (value == null) {
      this.fields[key] = value;
    } else {
      // Special case for language: replace BCP 47 field "root" with undefined value.
      if (key == LANGUAGE && value.equals("root")) {
        this.fields[key] = null;
      } else {
        this.fields[key] = value.equals("") || value.equals(undef) ? null : value;
      }
    }
  }
37878
def put_field(self, field):
        
        fpath = self.fields_json_path(field)
        # Open fields JSON, locking to prevent other processes
        # reading or writing
        with InterProcessLock(fpath + self.LOCK_SUFFIX, logger=logger):
            try:
                with open(fpath, 'r') as f:
                    dct = json.load(f)
            except IOError as e:
                if e.errno == errno.ENOENT:
                    dct = {}
                else:
                    raise
            if field.array:
                dct[field.name] = list(field.value)
            else:
                dct[field.name] = field.value
            with open(fpath, 'w') as f:
                json.dump(dct, f, indent=2)
189676
private ReadableProperty<Boolean> installFieldValidation(JTextField field) {
        // FieLd is valid if not empty
        SimpleBooleanProperty fieldResult = new SimpleBooleanProperty();
        on(new JTextFieldDocumentChangedTrigger(field)) //
                .read(new JTextFieldTextProvider(field)) //
                .check(new StringNotEmptyRule()) //
                .handleWith(new IconBooleanFeedback(field)) //
                .handleWith(fieldResult) //
                .getValidator().trigger();

        // Tab will be valid only if all fields are valid
        return fieldResult;
    }
892369
function fieldRelocate(elem, field, oldParent, newParent) {
        try {
            $(exports).triggerHandler('fieldRelocate', [elem, field, oldParent, newParent]);
        } catch (err) {
            console.error(err);
        }
        _currentOperation.ops.push({
            op: OP_FIELD_RELOCATE,
            arg: {
                _id: elem._id,
                f: field,
                op: oldParent._id,
                np: newParent._id
            }
        });
    }
1335886
private function discoverCustomFields()
    {
        $path = $this->rootDir.'/'.$this->directory;
        $finder = new Finder();
        $finder->files()->in($path);

        /** @var SplFileInfo $file */
        foreach ($finder as $file) {
            $class = $this->classForFile($file);
            /* @var \Lullabot\Mpx\DataService\Annotation\CustomField $annotation */
            $this->registerAnnotation($class);
        }
    }
1217727
public void markAsVisited(final Field field) {
        final OneOf oneOfAnnotation = field.getAnnotation(OneOf.class);
        if (oneOfAnnotation != null) {
            final OneOfGroup oneOfGroup = this.mapping.get(oneOfAnnotation.value());
            oneOfGroup.satisfiedBy.add(new OneOfSatisfier(field, false));
        }
        final CanSatisfyOneOf canSatisfyOneOf = field.getAnnotation(CanSatisfyOneOf.class);
        if (canSatisfyOneOf != null) {
            final OneOfGroup oneOfGroup = this.mapping.get(canSatisfyOneOf.value());
            oneOfGroup.satisfiedBy.add(new OneOfSatisfier(field, true));
        }
    }
779162
function(field, fieldName, showErrors) {
            showErrors = (showErrors !== undefined)
              ? showErrors
              : true
            ;
            if(typeof field == 'string') {
              module.verbose('Validating field', field);
              fieldName = field;
              field     = validation[field];
            }
            var
              identifier    = field.identifier || fieldName,
              $field        = module.get.field(identifier),
              $dependsField = (field.depends)
                ? module.get.field(field.depends)
                : false,
              fieldValid  = true,
              fieldErrors = []
            ;
            if(!field.identifier) {
              module.debug('Using field name as identifier', identifier);
              field.identifier = identifier;
            }
            if($field.prop('disabled')) {
              module.debug('Field is disabled. Skipping', identifier);
              fieldValid = true;
            }
            else if(field.optional && module.is.blank($field)){
              module.debug('Field is optional and blank. Skipping', identifier);
              fieldValid = true;
            }
            else if(field.depends && module.is.empty($dependsField)) {
              module.debug('Field depends on another value that is not present or empty. Skipping', $dependsField);
              fieldValid = true;
            }
            else if(field.rules !== undefined) {
              $.each(field.rules, function(index, rule) {
                if( module.has.field(identifier) && !( module.validate.rule(field, rule) ) ) {
                  module.debug('Field is invalid', identifier, rule.type);
                  fieldErrors.push(module.get.prompt(rule, field));
                  fieldValid = false;
                }
              });
            }
            if(fieldValid) {
              if(showErrors) {
                module.remove.prompt(identifier, fieldErrors);
                settings.onValid.call($field);
              }
            }
            else {
              if(showErrors) {
                formErrors = formErrors.concat(fieldErrors);
                module.add.prompt(identifier, fieldErrors);
                settings.onInvalid.call($field, fieldErrors);
              }
              return false;
            }
            return true;
          }
907048
def _bind_field(self, field_name, field_obj):
        
        try:
            if field_name in self.load_only:
                field_obj.load_only = True
            if field_name in self.dump_only:
                field_obj.dump_only = True
            field_obj._bind_to_schema(field_name, self)
            self.on_bind_field(field_name, field_obj)
        except TypeError:
            # field declared as a class, not an instance
            if (isinstance(field_obj, type) and
                    issubclass(field_obj, base.FieldABC)):
                msg = ('Field for "{}" must be declared as a '
                       'Field instance, not a class. '
                       'Did you mean "fields.{}()"?'
                       .format(field_name, field_obj.__name__))
                raise TypeError(msg)
1144722
def p_field(self, p):
        """"""
        has_annotations = len(p) > 5 and p[6] is not None
        has_docstring = len(p) > 5 and p[7] is not None
        has_anony_def = len(p) > 5 and p[8] is not None
        p[0] = AstField(
            self.path, p.lineno(1), p.lexpos(1), p[1], p[2])
        if p[3] is not None:
            if p[3] is NullToken:
                p[0].set_default(None)
            else:
                p[0].set_default(p[3])
        if has_annotations:
            p[0].set_annotations(p[6])
        if has_docstring:
            p[0].set_doc(p[7])
        if has_anony_def:
            p[8].name = p[2].name
            self.anony_defs.append(p[8])