public List<QName> getOptions() { Vector<QName> names = new Vector<QName> (); for (Option option : options) { names.add(option.getName()); } return names; }
public List<QName> getOptions() { Vector<QName> names = new Vector<QName> (); for (Option option : options) { names.add(option.getName()); } return names; }
public Option getOption(QName name) { for (Option option : options) { if (name.equals(option.getName())) { return option; } } return null; }
public Option getOption(QName name) { for (Option option : options) { if (name.equals(option.getName())) { return option; } } return null; }
public void addOption(Option option) { // FIXME: Is it worth making a hash for this? QName optName = option.getName(); for (Option exoption : options) { if (optName.equals(exoption.getName())) { error(option.getNode(),"Duplication option name: " + optName,XProcConstants.staticError(4)); } } options.add(option); }
private void xmlReport(Option option) { String type = option.getType(); boolean req = option.getRequired(); String select = option.getSelect(); pr.print(" <option name='" + option.getName().getClarkName() + "' required='" + req + "'"); if (type != null) { pr.print(" type='" + type + '"'); } if (select != null) { pr.print(" select=\"" + select.replaceAll("\"",""") + "\""); } pr.println("/>"); }
public void addOption(Option option) { // FIXME: Is it worth making a hash for this? QName optName = option.getName(); for (Option exoption : options) { if (optName.equals(exoption.getName())) { error(option.getNode(),"Duplication option name: " + optName,XProcConstants.staticError(4)); } } options.add(option); }
private void xmlReport(Option option) { String type = option.getType(); boolean req = option.getRequired(); String select = option.getSelect(); pr.print(" <option name='" + option.getName().getClarkName() + "' required='" + req + "'"); if (type != null) { pr.print(" type='" + type + '"'); } if (select != null) { pr.print(" select=\"" + select.replaceAll("\"",""") + "\""); } pr.println("/>"); }
protected void dump(int depth) { String indent = ""; for (int count = 0; count < depth; count++) { indent += " "; } if (select != null) { logger.trace(indent + "option " + getName() + " select=" + select); } else { logger.trace(indent + "option " + getName()); if (getBinding().size() == 0) { if (XProcConstants.p_option.equals(node.getNodeName())) { // System.err.println(indent + " no binding allowed"); } else { logger.trace(indent + " no binding"); } } } for (Binding binding : getBinding()) { binding.dump(depth+2); } } }
protected void dump(int depth) { String indent = ""; for (int count = 0; count < depth; count++) { indent += " "; } if (select != null) { logger.trace(indent + "option " + getName() + " select=" + select); } else { logger.trace(indent + "option " + getName()); if (getBinding().size() == 0) { if (XProcConstants.p_option.equals(node.getNodeName())) { // System.err.println(indent + " no binding allowed"); } else { logger.trace(indent + " no binding"); } } } for (Binding binding : getBinding()) { binding.dump(depth+2); } } }
QName pName = p.getName(); if (pName == null) { valid = false; if (getOption(doption.getName()) == null) { valid = false; error("Required option not specified: " + doption.getName(), XProcConstants.staticError(18)); Option doption = decl.getOption(option.getName()); if (doption == null) { if (getVersion() > 1.0) { error("Undeclared option specified: " + option.getName(), XProcConstants.staticError(10));
protected void augmentOptions() { Step decl = declaration; if (decl == null) { throw new UnsupportedOperationException("Unexpected step type: " + getType()); } Hashtable<QName,Option> declOptions = new Hashtable<QName,Option> (); for (Option option : decl.options()) { declOptions.put(option.getName(), option); } // Add any options that have default values... for (QName oname : declOptions.keySet()) { Option doption = declOptions.get(oname); Option option = getOption(oname); if (option == null) { if (doption.getSelect() != null || doption.getBinding().size() != 0) { addOption(doption); } } else { option.setType(doption.getType(), doption.getNode()); // copy the type over } } }
protected void augmentOptions() { Step decl = declaration; if (decl == null) { throw new UnsupportedOperationException("Unexpected step type: " + getType()); } Hashtable<QName,Option> declOptions = new Hashtable<QName,Option> (); for (Option option : decl.options()) { declOptions.put(option.getName(), option); } // Add any options that have default values... for (QName oname : declOptions.keySet()) { Option doption = declOptions.get(oname); Option option = getOption(oname); if (option == null) { if (doption.getSelect() != null || doption.getBinding().size() != 0) { addOption(doption); } } else { option.setType(doption.getType(), doption.getNode()); // copy the type over } } }
QName pName = p.getName(); if (pName == null) { valid = false; if (getOption(doption.getName()) == null) { valid = false; error("Required option not specified: " + doption.getName(), XProcConstants.staticError(18)); Option doption = decl.getOption(option.getName()); if (doption == null) { if (getVersion() > 1.0) { error("Undeclared option specified: " + option.getName(), XProcConstants.staticError(10));
} else { if (option.getRequired() && option.getSelect() == null) { throw XProcException.staticError(18, option.getNode(), "No value provided for required option \"" + option.getName() + "\"");
} else { if (option.getRequired() && option.getSelect() == null) { throw XProcException.staticError(18, option.getNode(), "No value provided for required option \"" + option.getName() + "\"");