/** * Returns the named structure. If this Structure is repeating then the first repetition is * returned. Creates the Structure if necessary. * * @throws HL7Exception if the named Structure is not part of this Group. */ public Structure get(String name) throws HL7Exception { return get(name, 0); }
/** * {@inheritDoc} */ public boolean isEmpty() throws HL7Exception { for (String name : getNames()) { if (!get(name).isEmpty()) return false; } return true; }
/** * {@inheritDoc} */ public boolean isEmpty() throws HL7Exception { for (String name : getNames()) { if (!get(name).isEmpty()) return false; } return true; }
/** * Returns the named structure. If this Structure is repeating then the first repetition is * returned. Creates the Structure if necessary. * * @throws HL7Exception if the named Structure is not part of this Group. */ public Structure get(String name) throws HL7Exception { return get(name, 0); }
protected <T extends Structure> T getTyped(String name, Class<T> type) { try { @SuppressWarnings("unchecked") T ret = (T) get(name); return ret; } catch (HL7Exception e) { log.error("Unexpected error accessing data - this is probably a bug in the source code generator.", e); throw new RuntimeException(e); } }
protected <T extends Structure> T getTyped(String name, Class<T> type) { try { @SuppressWarnings("unchecked") T ret = (T) get(name); return ret; } catch (HL7Exception e) { log.error("Unexpected error accessing data - this is probably a bug in the source code generator.", e); throw new RuntimeException(e); } }
protected <T extends Structure> T getTyped(String name, int rep, Class<T> type) { try { @SuppressWarnings("unchecked") T ret = (T) get(name, rep); return ret; } catch (HL7Exception e) { List<Structure> list = structures.get(name); if (list != null && list.size() < rep) { // This is programmer/user error so don't report that it's a bug in the generator } else { log.error("Unexpected error accessing data - this is probably a bug in the source code generator.", e); } throw new RuntimeException(e); } }
protected <T extends Structure> T getTyped(String name, int rep, Class<T> type) { try { @SuppressWarnings("unchecked") T ret = (T) get(name, rep); return ret; } catch (HL7Exception e) { List<Structure> list = structures.get(name); if (list != null && list.size() < rep) { // This is programmer/user error so don't report that it's a bug in the generator } else { log.error("Unexpected error accessing data - this is probably a bug in the source code generator.", e); } throw new RuntimeException(e); } }