Пример #1
0
  /** Get Collection of header names. */
  public Collection<String> getFieldNamesCollection() {
    final List<String> list = new ArrayList<String>(_fields.size());

    for (Field f : _fields) {
      if (f != null) list.add(BufferUtil.to8859_1_String(f._name));
    }
    return list;
  }
Пример #2
0
  /**
   * Get a header as a date value. Returns the value of a date field, or -1 if not found. The case
   * of the field name is ignored.
   *
   * @param name the case-insensitive field name
   */
  public long getDateField(String name) {
    Field field = getField(name);
    if (field == null) return -1;

    String val = valueParameters(BufferUtil.to8859_1_String(field._value), null);
    if (val == null) return -1;

    final long date = __dateParser.get().parse(val);
    if (date == -1) throw new IllegalArgumentException("Cannot convert date: " + val);
    return date;
  }
Пример #3
0
 /* ------------------------------------------------------------ */
 public String getValue() {
   return BufferUtil.to8859_1_String(_value);
 }
Пример #4
0
 /* ------------------------------------------------------------ */
 public String getName() {
   return BufferUtil.to8859_1_String(_name);
 }