/** * Returns an unmodifiable wrapper around the message. When accessing structures or types of the * {@link UnmodifiableMessage}, they will be unmodifiable as well. Copying these message parts into a regular * message should therefore be done using {@link ca.uhn.hl7v2.util.DeepCopy}. * * @param msg message to be wrapped * @return unmodifiable message wrapper */ public static Message unmodifiableMessage(Message msg) { return isUnmodifiable(msg) ? msg : new UnmodifiableMessage(msg); }
@Override public Message getMessage() { return unmodifiableMessage(delegate.getMessage()); }
@SuppressWarnings("unchecked") private static <T extends MessageVisitor> T unmodifiableVisitor(T visitor) { return isUnmodifiable(visitor) ? visitor : (T) new UnmodifiableMessageVisitor(visitor); }
@Override public Message getMessage() { return unmodifiableMessage(delegate.getMessage()); }
/** * Returns an unmodifiable wrapper around the message. When accessing structures or types of the * {@link UnmodifiableMessage}, they will be unmodifiable as well. Copying these message parts into a regular * message should therefore be done using {@link ca.uhn.hl7v2.util.DeepCopy}. * * @param msg message to be wrapped * @return unmodifiable message wrapper */ public static Message unmodifiableMessage(Message msg) { return isUnmodifiable(msg) ? msg : new UnmodifiableMessage(msg); }
public boolean start(Message message) throws HL7Exception { return getDelegate().start(unmodifiableMessage(message)); }
@SuppressWarnings("unchecked") private static ExtraComponents unmodifiableExtraComponents(ExtraComponents ec) { return isUnmodifiable(ec) ? ec : new UnmodifiableExtraComponents(ec); }
public boolean end(Message message) throws HL7Exception { return getDelegate().end(unmodifiableMessage(message)); }
@SuppressWarnings("unchecked") private static ExtraComponents unmodifiableExtraComponents(ExtraComponents ec) { return isUnmodifiable(ec) ? ec : new UnmodifiableExtraComponents(ec); }
public Message getMessage() { return unmodifiableMessage(getDelegate().getMessage()); }
@SuppressWarnings("unchecked") private static <T extends MessageVisitor> T unmodifiableVisitor(T visitor) { return isUnmodifiable(visitor) ? visitor : (T) new UnmodifiableMessageVisitor(visitor); }
public boolean start(Message message) throws HL7Exception { return getDelegate().start(unmodifiableMessage(message)); }
@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 Message getMessage() { return unmodifiableMessage(getDelegate().getMessage()); }
@SuppressWarnings("unchecked") private static <T extends Type> T unmodifiableType(T type) { if (isUnmodifiable(type)) return type; if (type instanceof Primitive) return (T) new UnmodifiablePrimitive((Primitive) type); if (type instanceof Composite) return (T) new UnmodifiableComposite((Composite) type); return (T) new UnmodifiableVaries((Variable) type); }
public boolean end(Message message) throws HL7Exception { return getDelegate().end(unmodifiableMessage(message)); }
@SuppressWarnings("unchecked") private static <T extends Type> T unmodifiableType(T type) { if (isUnmodifiable(type)) return type; if (type instanceof Primitive) return (T) new UnmodifiablePrimitive((Primitive) type); if (type instanceof Composite) return (T) new UnmodifiableComposite((Composite) type); return (T) new UnmodifiableVaries((Variable) type); }
@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); }