public String getString(int field) throws FieldNotFound { return getField(field).getObject(); }
public String getString(int field) throws FieldNotFound { return getField(field).getObject(); }
public String getString(int field) throws FieldNotFound { return getField(field).getObject(); }
/** * Warning! This method does not handle groups. * @param copyTo * @param copyFrom */ public static void copyFields(FieldMap copyTo, FieldMap copyFrom) { Iterator<Field<?>> iter = copyFrom.iterator(); while (iter.hasNext()){ Field<?> field = iter.next(); try { copyTo.setField(copyFrom.getField(new StringField(field.getTag()))); } catch (FieldNotFound e) { // do nothing } } }
protected void setGroupCount(int countTag, int groupSize) { try { StringField count; if (groupSize == 1) { count = new StringField(countTag, "1"); setField(countTag, count); } else { count = getField(countTag); } count.setValue(Integer.toString(groupSize)); } catch (final FieldNotFound e) { // Shouldn't happen throw new RuntimeError(e); } }
protected void setGroupCount(int countTag, int groupSize) { try { StringField count; if (groupSize == 1) { count = new StringField(countTag, "1"); setField(countTag, count); } else { count = getField(countTag); } count.setValue(Integer.toString(groupSize)); } catch (final FieldNotFound e) { // Shouldn't happen throw new RuntimeError(e); } }
protected void setGroupCount(int countTag, int groupSize) { try { StringField count; if (groupSize == 1) { count = new StringField(countTag, "1"); setField(countTag, count); } else { count = getField(countTag); } count.setValue(Integer.toString(groupSize)); } catch (final FieldNotFound e) { // Shouldn't happen throw new RuntimeError(e); } }
public static void insertFieldIfMissing(int fieldNumber, String value, FieldMap fieldMap) throws CoreException { if (fieldMap.isSetField(fieldNumber)){ StringField testField = new StringField(fieldNumber); try { fieldMap.getField(testField); if(testField.getValue().equals(value)){ return; } } catch (FieldNotFound ignored) { //Unexpected as isSetField() returned true //Don't do anything so that we set the field before we return. } } fieldMap.setField(new StringField(fieldNumber, value)); }
public void copyFrom(FieldMap fields) { try { for (int componentField : getFields()) { if (fields.isSetField(componentField)) { setField(componentField, fields.getField(componentField)); } } for (int groupField : getGroupFields()) { if (fields.isSetField(groupField)) { setField(groupField, fields.getField(groupField)); setGroups(groupField, fields.getGroups(groupField)); } } } catch (FieldNotFound e) { // should not happen } }
public void copyFrom(FieldMap fields) { try { for (int componentField : getFields()) { if (fields.isSetField(componentField)) { setField(componentField, fields.getField(componentField)); } } for (int groupField : getGroupFields()) { if (fields.isSetField(groupField)) { setField(groupField, fields.getField(groupField)); setGroups(groupField, fields.getGroups(groupField)); } } } catch (FieldNotFound e) { // should not happen } }
public void copyFrom(FieldMap fields) { try { for (int componentField : getFields()) { if (fields.isSetField(componentField)) { setField(componentField, fields.getField(componentField)); } } for (int groupField : getGroupFields()) { if (fields.isSetField(groupField)) { setField(groupField, fields.getField(groupField)); setGroups(groupField, fields.getGroups(groupField)); } } } catch (FieldNotFound e) { // should not happen } }