@SuppressWarnings("unchecked") private static <T extends Structure> T unmodifiableStructure(T structure) { if (isUnmodifiable(structure)) return structure; if (structure instanceof Message) return (T) new UnmodifiableMessage((Message) structure); if (structure instanceof Group) return (T) new UnmodifiableGroup((Group) structure); return (T) new UnmodifiableSegment((Segment) structure); }
public Structure get(String name) throws HL7Exception { return get(name, 0); }
/** * This method does NOT append a trailing repetition, but will instead throw an {@link IndexOutOfBoundsException} * * @param name name of the structure * @param rep repetition (zero-based) * @return element of the repeating structure * @throws HL7Exception if name does not exist * @throws IndexOutOfBoundsException if repetition does not exist */ public Structure get(String name, int rep) throws HL7Exception { return getAll(name)[rep]; }
public boolean isGroup(String name) throws HL7Exception { return getDelegate().isGroup(name); }
public Class<? extends Structure> getClass(String name) { return getDelegate().getClass(name); }
public String[] getNames() { return getDelegate().getNames(); }
public boolean isRepeating(String name) throws HL7Exception { return getDelegate().isRepeating(name); }
public String[] getNames() { return getDelegate().getNames(); }
public boolean isRepeating(String name) throws HL7Exception { return getDelegate().isRepeating(name); }
public boolean isChoiceElement(String name) throws HL7Exception { return getDelegate().isChoiceElement(name); }
public boolean isGroup(String name) throws HL7Exception { return getDelegate().isGroup(name); }
public boolean isRequired(String name) throws HL7Exception { return getDelegate().isRequired(name); }
public Class<? extends Structure> getClass(String name) { return getDelegate().getClass(name); }
public boolean isChoiceElement(String name) throws HL7Exception { return getDelegate().isChoiceElement(name); }
public Structure[] getAll(String name) throws HL7Exception { Structure[] structures = getDelegate().getAll(name); Structure[] unmodifiableStructures = new Structure[structures.length]; if (structures.length > 0) { for (int i = 0; i < structures.length; i++) { unmodifiableStructures[i] = unmodifiableStructure(structures[i]); } } return unmodifiableStructures; }
public boolean isRequired(String name) throws HL7Exception { return getDelegate().isRequired(name); }
public Structure get(String name) throws HL7Exception { return get(name, 0); }
/** * This method does NOT append a trailing repetition, but will instead throw an {@link IndexOutOfBoundsException} * * @param name name of the structure * @param rep repetition (zero-based) * @return element of the repeating structure * @throws HL7Exception if name does not exist * @throws IndexOutOfBoundsException if repetition does not exist */ public Structure get(String name, int rep) throws HL7Exception { return getAll(name)[rep]; }
public Structure[] getAll(String name) throws HL7Exception { Structure[] structures = getDelegate().getAll(name); Structure[] unmodifiableStructures = new Structure[structures.length]; if (structures.length > 0) { for (int i = 0; i < structures.length; i++) { unmodifiableStructures[i] = unmodifiableStructure(structures[i]); } } return unmodifiableStructures; }
@SuppressWarnings("unchecked") private static <T extends Structure> T unmodifiableStructure(T structure) { if (isUnmodifiable(structure)) return structure; if (structure instanceof Message) return (T) new UnmodifiableMessage((Message) structure); if (structure instanceof Group) return (T) new UnmodifiableGroup((Group) structure); return (T) new UnmodifiableSegment((Segment) structure); }