/** * Iterates over the contained fields and calls the visitor for each * of them. * * @param visitor MessageVisitor instance to be called back. * @param location location of the group * @return true if visiting shall continue, false if not * @throws HL7Exception */ public boolean accept(MessageVisitor visitor, Location location) throws HL7Exception { if (visitor.start(this, location)) { String[] names = getNames(); for (int i = 1; i <= names.length; i++) { Field f = new Field(getField(i), getMaxCardinality(i)); Location nextLocation = f.provideLocation(location, i, -1); if (!f.accept(visitor, nextLocation)) break; } } return visitor.end(this, location); }
/** * Iterates over the contained fields and calls the visitor for each * of them. * * @param visitor MessageVisitor instance to be called back. * @param location location of the group * @return true if visiting shall continue, false if not * @throws HL7Exception */ public boolean accept(MessageVisitor visitor, Location location) throws HL7Exception { if (visitor.start(this, location)) { String[] names = getNames(); for (int i = 1; i <= names.length; i++) { Field f = new Field(getField(i), getMaxCardinality(i)); Location nextLocation = f.provideLocation(location, i, -1); if (!f.accept(visitor, nextLocation)) break; } } return visitor.end(this, location); }