private void setUpField() throws Exception {
    m_fieldIndex = -1;
    m_fieldValueIndex = -1;
    m_field = null;
    
    if (m_fieldDefs != null) {
      m_fieldIndex = getFieldDefIndex(m_fieldName);

      if (m_fieldIndex < 0) {
        throw new Exception("[NormDiscrete] Can't find field " + m_fieldName
            + " in the supplied field definitions.");
      }
      m_field = m_fieldDefs.get(m_fieldIndex);
      
      if (!(m_field.isString() || m_field.isNominal())) {
        throw new Exception("[NormDiscrete] reference field " + m_fieldName
            +" must be categorical");
      }
      
      if (m_field.isNominal()) {
        // set up the value index
        m_fieldValueIndex = m_field.indexOfValue(m_fieldValue);
        if (m_fieldValueIndex < 0) {
          throw new Exception("[NormDiscrete] Unable to find value " + m_fieldValue
              + " in nominal attribute " + m_field.name());
        }
      } else if (m_field.isString()) {
        // add our value to this attribute (if it is already there
        // then this will have no effect).
        m_fieldValueIndex = m_field.addStringValue(m_fieldValue);
      }
    }
  }