int tag = ((Integer) ((Field) requiredElements.get(i)).getKey()).intValue(); if (!fieldMap.isSetField(tag)) { throw new quickfix.FieldNotFound(tag);
Object element = requiredElements.get(i); if (element instanceof Field) { int tag = ((Integer) ((Field) element).getKey()).intValue(); if (!fieldMap.isSetField(tag)) { throw new quickfix.FieldNotFound(tag); } } else if (element instanceof Component) { ComponentSchema schema = ((Component)element).getSchema(); checkRequiredFields(fieldMap, schema.getRequiredElements());
    private void checkRequiredFields(FieldMap fieldMap, List requiredElements)            throws quickfix.FieldNotFound {        for (int i = 0; i < requiredElements.size(); i++) {            int tag = ((Integer) ((Field) requiredElements.get(i)).getKey()).intValue();            if (!fieldMap.isSetField(tag)) {                throw new quickfix.FieldNotFound(tag);            }        }    }