/** * Returns the class name (excluding package). * * @see Structure#getName() */ public String getName() { return getName(getClass()); }
/** * Returns the class name (excluding package). * * @see Structure#getName() */ public String getName() { return getName(getClass()); }
/** * Adds a new Structure (group or segment) to this Group. A place for the Structure is added to * the group but there are initially zero repetitions. This method should be used by the * constructors of implementing classes to specify which Structures the Group contains - * Structures should be added in the order in which they appear. Note that the class is supplied * instead of an instance because we want there initially to be zero instances of each structure * but we want the AbstractGroup code to be able to create instances as necessary to support * get(...) calls. * * @return the actual name used to store this structure (may be appended with an integer if * there are duplicates in the same Group). */ protected String add(Class<? extends Structure> c, boolean required, boolean repeating, boolean choiceElement) throws HL7Exception { String name = getName(c); return insert(c, required, repeating, choiceElement, this.names.size(), name); }
/** * Adds a new Structure (group or segment) to this Group. A place for the Structure is added to * the group but there are initially zero repetitions. This method should be used by the * constructors of implementing classes to specify which Structures the Group contains - * Structures should be added in the order in which they appear. Note that the class is supplied * instead of an instance because we want there initially to be zero instances of each structure * but we want the AbstractGroup code to be able to create instances as necessary to support * get(...) calls. * * @return the actual name used to store this structure (may be appended with an integer if * there are duplicates in the same Group). */ protected String add(Class<? extends Structure> c, boolean required, boolean repeating, boolean choiceElement) throws HL7Exception { String name = getName(c); return insert(c, required, repeating, choiceElement, this.names.size(), name); }
/** * Adds a new Structure (group or segment) to this Group. A place for the Structure is added to * the group but there are initially zero repetitions. This method should be used by the * constructors of implementing classes to specify which Structures the Group contains - * Structures should be added in the order in which they appear. Note that the class is supplied * instead of an instance because we want there initially to be zero instances of each structure * but we want the AbstractGroup code to be able to create instances as necessary to support * get(...) calls. * * @return the actual name used to store this structure (may be appended with an integer if * there are duplicates in the same Group). */ protected String add(Class<? extends Structure> c, boolean required, boolean repeating, int index) throws HL7Exception { String name = getName(c); return insert(c, required, repeating, index, name); }
/** * Adds a new Structure (group or segment) to this Group. A place for the Structure is added to * the group but there are initially zero repetitions. This method should be used by the * constructors of implementing classes to specify which Structures the Group contains - * Structures should be added in the order in which they appear. Note that the class is supplied * instead of an instance because we want there initially to be zero instances of each structure * but we want the AbstractGroup code to be able to create instances as necessary to support * get(...) calls. * * @return the actual name used to store this structure (may be appended with an integer if * there are duplicates in the same Group). */ protected String add(Class<? extends Structure> c, boolean required, boolean repeating, int index) throws HL7Exception { String name = getName(c); return insert(c, required, repeating, index, name); }
/** * Remove message name prefix from group names for compatibility with getters. Due to * 3558962 we also need to look at the message's super classes to enable custom * messages that reuse groups from their ancestors. * * @param name the simple name of the group * @return the abbreviated group in name in case of matching prefixes */ private String getGroupName(String name) { Class<?> messageClass = getMessage().getClass(); while (Message.class.isAssignableFrom(messageClass)) { @SuppressWarnings("unchecked") // actually we should call getName() instead of getName(Class), but this // is due to issue 3558962 String messageName = getName((Class<? extends Message>)messageClass); if (name.startsWith(messageName) && name.length() > messageName.length()) { return name.substring(messageName.length() + 1); } messageClass = messageClass.getSuperclass(); } return name; }
/** * Remove message name prefix from group names for compatibility with getters. Due to * 3558962 we also need to look at the message's super classes to enable custom * messages that reuse groups from their ancestors. * * @param name the simple name of the group * @return the abbreviated group in name in case of matching prefixes */ private String getGroupName(String name) { Class<?> messageClass = getMessage().getClass(); while (Message.class.isAssignableFrom(messageClass)) { @SuppressWarnings("unchecked") // actually we should call getName() instead of getName(Class), but this // is due to issue 3558962 String messageName = getName((Class<? extends Message>)messageClass); if (name.startsWith(messageName) && name.length() > messageName.length()) { return name.substring(messageName.length() + 1); } messageClass = messageClass.getSuperclass(); } return name; }
public Location provideLocation(Location location, int index, int repetition) { return new Location(location).pushGroup(getName(), repetition); }
public Location provideLocation(Location location, int index, int repetition) { return new Location(location).pushGroup(getName(), repetition); }