/** Scans through this mapping class looking for a field whose * name matches the name passed in. * @param name name of the field to find. * @return the mapping field whose name matches the name parameter */ public MappingFieldElement getField (String name) { Iterator fieldIterator = getFields().iterator(); while (fieldIterator.hasNext()) { MappingFieldElement field = (MappingFieldElement)fieldIterator.next(); if (name.equals(field.getName())) return field; } return null; }
/** Scans through this mapping class looking for a field whose * name matches the name passed in. * @param name name of the field to find. * @return the mapping field whose name matches the name parameter */ public MappingFieldElement getField (String name) { Iterator fieldIterator = getFields().iterator(); while (fieldIterator.hasNext()) { MappingFieldElement field = (MappingFieldElement)fieldIterator.next(); if (name.equals(field.getName())) return field; } return null; }
/** Returns the list of version fields (MappingFieldElements) in this * mapping class. This list only includes fields if the consistency * level is {@link #VERSION_CONSISTENCY}. * @return the version fields in this mapping class */ public List getVersionFields () { List versionFields = new ArrayList(); if (VERSION_CONSISTENCY == getConsistencyLevel()) { Iterator iterator = getFields().iterator(); while (iterator.hasNext()) { MappingFieldElement fieldCandidate = (MappingFieldElement)iterator.next(); if (fieldCandidate.isVersion()) versionFields.add(fieldCandidate); } } return versionFields; }
/** Returns the list of version fields (MappingFieldElements) in this * mapping class. This list only includes fields if the consistency * level is {@link #VERSION_CONSISTENCY}. * @return the version fields in this mapping class */ public List getVersionFields () { List versionFields = new ArrayList(); if (VERSION_CONSISTENCY == getConsistencyLevel()) { Iterator iterator = getFields().iterator(); while (iterator.hasNext()) { MappingFieldElement fieldCandidate = (MappingFieldElement)iterator.next(); if (fieldCandidate.isVersion()) versionFields.add(fieldCandidate); } } return versionFields; }
/** Adds a field to the list of fields in this mapping class. * @param field field element to be added * @exception ModelException if impossible */ public void addField (MappingFieldElement field) throws ModelException { ArrayList fields = getFields(); if (!fields.contains(field)) { try { fireVetoableChange(PROP_FIELDS, null, null); fields.add(field); firePropertyChange(PROP_FIELDS, null, null); } catch (PropertyVetoException e) { throw new ModelVetoException(e); } } }
/** Adds a field to the list of fields in this mapping class. * @param field field element to be added * @exception ModelException if impossible */ public void addField (MappingFieldElement field) throws ModelException { ArrayList fields = getFields(); if (!fields.contains(field)) { try { fireVetoableChange(PROP_FIELDS, null, null); fields.add(field); firePropertyChange(PROP_FIELDS, null, null); } catch (PropertyVetoException e) { throw new ModelVetoException(e); } } }
/** Removes a field from the list of fields in this mapping class. * @param field field element to be removed * @exception ModelException if impossible */ public void removeField (MappingFieldElement field) throws ModelException { try { fireVetoableChange(PROP_FIELDS, null, null); if (!getFields().remove(field)) { throw new ModelException(I18NHelper.getMessage(getMessages(), "mapping.element.element_not_removed", field)); // NOI18N } firePropertyChange(PROP_FIELDS, null, null); } catch (PropertyVetoException e) { throw new ModelVetoException(e); } }
/** Removes a field from the list of fields in this mapping class. * @param field field element to be removed * @exception ModelException if impossible */ public void removeField (MappingFieldElement field) throws ModelException { try { fireVetoableChange(PROP_FIELDS, null, null); if (!getFields().remove(field)) { throw new ModelException(I18NHelper.getMessage(getMessages(), "mapping.element.element_not_removed", field)); // NOI18N } firePropertyChange(PROP_FIELDS, null, null); } catch (PropertyVetoException e) { throw new ModelVetoException(e); } }
iterator = getFields().iterator(); while (iterator.hasNext())
iterator = getFields().iterator(); while (iterator.hasNext())