/** * Retrieve Option list * * @return Option list */ @JsonGetter("options") public List<Option> getOptions() { return getElementList(); }
/** * Stores if option is restricted or not * * @param resOpt Option is restricted */ public void setRestricted(boolean resOpt) { // Set restriction to actual option this.restrictedOption = resOpt; getLogger().debug("Setting restricted screen: {0}", new Object[]{this.getName()}); // Set restriction to children option if (this.getElementList() != null) { for (Element element : this.getElementList()) { Option option = (Option) element; option.setRestricted(resOpt); } } }
/** * Search an initial option by screen name * * @param screen Screen name * @return Option found */ @JsonIgnore public Option getOptionByScreen(String screen) { // Variable definition Option option = null; // Found screen if (this.getScreen() != null && this.getScreen().equals(screen)) { option = this; } else { // Search in child options List<Option> optionList = getElementList(); for (Option child : optionList) { // Check module if (option == null) { child.setParent(this); option = child.getOptionByScreen(screen); } } } return option; }
/** * Search an initial option by name * * @param optionName Option name * @return Option found */ @JsonIgnore public Option getOptionByName(String optionName) { // Variable definition Option option = null; // Found option if (this.getName() != null && this.getName().equals(optionName)) { option = this; } else { // Search in child options List<Option> optionList = getElementList(); for (Option child : optionList) { // Check module if (option == null) { child.setParent(this); option = child.getOptionByName(optionName); } } } return option; } }