001    package ca.uhn.hl7v2.model;
002    
003    import ca.uhn.hl7v2.parser.ModelClassFactory;
004    
005    /**
006     * An undefined segment group.  This is for storing undefined groups
007     * that appear in XML-encoded messages.  Note that if an undefined group appears 
008     * in an ER7-encoded message, the group structure won't be clear and we'll just assume 
009     * it's a flat list of segments.    
010     * @author Bryan Tripp
011     */
012    public class GenericGroup extends AbstractGroup {
013        
014        private String name;
015        
016        /** Creates a new instance of GenericGroup */
017        public GenericGroup(Group parent, String name, ModelClassFactory factory) {
018            super(parent, factory);
019            this.name = name;
020        }
021        
022        /** Returns the Message object to which this segment belongs.  This should normally be set at
023         * construction time.  A Structure can only belong to a single Message.  This is primarily
024         * to avoid a situation where intended changes in one message cause unintended changes
025         * in another that shares one of the same Structure objects.
026         */
027        /*public Message getMessage() {
028            return super.message;
029        }*/
030        
031        /**
032         * Returns the name specified at construction time. 
033         * @see Structure#getName() 
034         */
035        public String getName() {
036            return this.name;
037        }
038        
039    }