Populate the container, converting raw data into Java types.

@param field custom field to which these values belong
@param values raw value data
@param descriptions raw description data
345376
private void populateContainer(FieldType field, byte[] values, byte[] descriptions)
   {
      CustomField config = m_container.getCustomField(field);
      CustomFieldLookupTable table = config.getLookupTable();

      List<Object> descriptionList = convertType(DataType.STRING, descriptions);
      List<Object> valueList = convertType(field.getDataType(), values);
      for (int index = 0; index < descriptionList.size(); index++)
      {
         CustomFieldValueItem item = new CustomFieldValueItem(Integer.valueOf(0));
         item.setDescription((String) descriptionList.get(index));
         if (index < valueList.size())
         {
            item.setValue(valueList.get(index));
         }
         table.add(item);
      }
   }
1010423
private static FieldDefinition fillFieldDefinitionData(final JSONObject fieldDefinitionObject) throws JSONException {
        final FieldDefinition ret = new FieldDefinition();
        ret.setName(fieldDefinitionObject.getString(NAME));
        ret.setDescription(fieldDefinitionObject.optString(DESCRIPTION));
        ret.setType(fieldDefinitionObject.getString(TYPE));
        ret.setNullable(fieldDefinitionObject.optBoolean(NULLABLE));
        ret.setLength(fieldDefinitionObject.optInt(LENGTH));
        ret.setIsKey(fieldDefinitionObject.optBoolean(ISKEY));
        if (defaultKeyName.equals(ret.getName())) {
            ret.setIsKey(true);
        }

        return ret;
    }
1177997
private void buildSlots(ObjectStreamField[] fields) {
        slotsToSerialize = new ObjectSlot[fields.length];
        for (int i = 0; i < fields.length; i++) {
            ObjectSlot s = new ObjectSlot();
            slotsToSerialize[i] = s;
            s.field = fields[i];
        }
        // We assume the slots are already sorted in the right shape for dumping
    }
1042880
def populate_values(self, rows, field):
        
        self._values.clear()
        for row in rows:
            condition = SimpleConditionFactory.create_condition(self._field, row[field])
            if condition.scheme == 'plain':
                self._values.append(condition.expression)
            else:
                self._conditions.append(condition)
1101514
@Override
    // TODO Accept final values
    // TODO put explicit IllegalArgumentException in throws clause (just to be clear)
    public FilterMutableType description(final String... values) throws IllegalArgumentException {
        // TODO Added precondition checks per the docs
        for (final String name : values) {
            if (name == null || name.length() == 0) {
                throw new IllegalArgumentException("no value for description may be null or blank");
            }
            this.getRootNode().createChild("description").text(name);
        }
        return this;
    }
1298624
def render_field_description(field):
    
    if hasattr(field, 'description') and field.description != '':
        html = """<p class="help-block">{field.description}</p>"""
        html = html.format(
            field=field
        )
        return HTMLString(html)
    
    return ''
195077
public void addMemberDescription(FieldDoc field, Content contentTree) {
        if (field.inlineTags().length > 0) {
            writer.addInlineComment(field, contentTree);
        }
        Tag[] tags = field.tags("serial");
        if (tags.length > 0) {
            writer.addInlineComment(field, tags[0], contentTree);
        }
    }
204743
protected void processDescriptions(List<MonolingualTextValue> descriptions) {
        for(MonolingualTextValue description : descriptions) {
        	NameWithUpdate currentValue = newDescriptions.get(description.getLanguageCode());
        	// only mark the description as added if the value we are writing is different from the current one
        	if (currentValue == null || !currentValue.value.equals(description)) {
        		newDescriptions.put(description.getLanguageCode(),
                    new NameWithUpdate(description, true));
        	}
        }
    }
1097994
private void writeField(String fieldName, DataType fieldType, Object value) throws IOException
   {
      switch (fieldType)
      {
         case INTEGER:
         {
            writeIntegerField(fieldName, value);
            break;
         }

         case PERCENTAGE:
         case CURRENCY:
         case NUMERIC:
         case UNITS:
         {
            writeDoubleField(fieldName, value);
            break;
         }

         case BOOLEAN:
         {
            writeBooleanField(fieldName, value);
            break;
         }

         case WORK:
         case DURATION:
         {
            writeDurationField(fieldName, value);
            break;
         }

         case DATE:
         {
            writeDateField(fieldName, value);
            break;
         }

         case TIME_UNITS:
         {
            writeTimeUnitsField(fieldName, value);
            break;
         }

         case PRIORITY:
         {
            writePriorityField(fieldName, value);
            break;
         }

         case RELATION_LIST:
         {
            writeRelationList(fieldName, value);
            break;
         }

         case MAP:
         {
            writeMap(fieldName, value);
            break;
         }

         case BINARY:
         {
            // Don't write binary data
            break;
         }

         default:
         {
            writeStringField(fieldName, value);
            break;
         }
      }
   }
963194
void setFields(Field[] fields) {
    this.fields = fields;
    this.resultSetColumnNameIndexMap = null;
    this.cachedMaxResultRowSize = null;
    this.needUpdateFieldFormats = fields != null;
    this.hasBinaryFields = false; // just in case
  }
590003
public static void writeField(final FieldDescriptorLite<?> descriptor,
                                final Object value,
                                final CodedOutputStream output)
                                throws IOException {
    WireFormat.FieldType type = descriptor.getLiteType();
    int number = descriptor.getNumber();
    if (descriptor.isRepeated()) {
      final List<?> valueList = (List<?>)value;
      if (descriptor.isPacked()) {
        output.writeTag(number, WireFormat.WIRETYPE_LENGTH_DELIMITED);
        // Compute the total data size so the length can be written.
        int dataSize = 0;
        for (final Object element : valueList) {
          dataSize += computeElementSizeNoTag(type, element);
        }
        output.writeRawVarint32(dataSize);
        // Write the data itself, without any tags.
        for (final Object element : valueList) {
          writeElementNoTag(output, type, element);
        }
      } else {
        for (final Object element : valueList) {
          writeElement(output, type, number, element);
        }
      }
    } else {
      if (value instanceof LazyField) {
        writeElement(output, type, number, ((LazyField) value).getValue());
      } else {
        writeElement(output, type, number, value);
      }
    }
  }
559628
public T mapObject(final Map<String, String> values) throws Exception {

        T result = createInstance();

        // for each field
        for (Map.Entry<String, String> entry : values.entrySet()) {

            String field = entry.getKey();
            //get field raw value
            String value = values.get(field);

            Method setter = setters.get(field);
            if (setter == null) {
                LOGGER.warn("No public setter found for field {}, this field will be set to null (if object type) or default value (if primitive type)", field);
                continue;
            }

            Class<?> type = setter.getParameterTypes()[0];
            TypeConverter<String, ?> typeConverter = typeConverters.get(type);
            if (typeConverter == null) {
                LOGGER.warn(
                        "Type conversion not supported for type {}, field {} will be set to null (if object type) or default value (if primitive type)",
                        type, field);
                continue;
            }

            if (value == null) {
                LOGGER.warn("Attempting to convert null to type {} for field {}, this field will be set to null (if object type) or default value (if primitive type)", type, field);
                continue;
            }

            if (value.isEmpty()) {
                LOGGER.debug("Attempting to convert an empty string to type {} for field {}, this field will be ignored", type, field);
                continue;
            }

            convertValue(result, field, value, setter, type, typeConverter);

        }

        return result;
    }
739964
public void addFields(GenericField[] fields)
	{
		for (int i=0; i < fields.length;i++)
		{
			this.fieldMap.put(fields[i].getFieldName(), fields[i]);
		}
	}
310599
public void put(Field field, Class<?> arrayComponentType, Object value) {
    ArrayValueMap.ArrayValue arrayValue = fieldMap.get(field);
    if (arrayValue == null) {
      arrayValue = new ArrayValue(arrayComponentType);
      fieldMap.put(field, arrayValue);
    }
    arrayValue.addValue(arrayComponentType, value);
  }
114020
private static void defineField(Map<String, FieldType> container, String name, FieldType type)
   {
      defineField(container, name, type, null);
   }
1162715
private void writeField(FieldType field, Object value) throws IOException
   {
      String fieldName = field.name().toLowerCase();
      writeField(fieldName, field.getDataType(), value);
   }
1161624
@SuppressWarnings({"unchecked", "rawtypes"})
    public void registerFieldFormatter(final String field, final Class<?> fieldType, final FieldFormatter<?> formatter,
            final boolean strippedIndex) {
        
        String fieldPath = buildFieldPath(field);
        
        if(strippedIndex) {
            // パスからインデックスやキーを削除する
            List<String> strippedPaths = new ArrayList<>();
            fieldFormatterRegistry.addStrippedPropertyPaths(strippedPaths, "", fieldPath);
            
            if(strippedPaths.size() > 0) {
                // 辞書順位並び変えて先頭に来るのが、インデックスを全て削除されたパス
                Collections.sort(strippedPaths);
                fieldPath = strippedPaths.get(0);
            }
        }
        
        fieldFormatterRegistry.registerFormatter(fieldPath, (Class)fieldType, (FieldFormatter)formatter);
        
    }