public void addStep(Step step) { super.addStep(step); }
protected boolean validBindings() { boolean valid = super.validBindings(); for (Variable var : getVariables()) { if (!checkOptionBinding(var, true)) { valid = false; } } return valid; }
public boolean valid() { boolean valid = validParams(); valid = valid && validOptions(); valid = valid && validBindings(); if (env.countVisibleSteps(getName()) > 1) { error("Duplicate step name: " + getName(), XProcConstants.staticError(2)); valid = false; } for (Step step : subpipeline) { boolean stepValid = step.valid(); valid = valid && stepValid; } valid = valid && validOutputBinding(); return valid; }
Input input = getInput("|" + output.getPort()); if (input == null) { input = new Input(runtime, output.getNode()); input.setSequence(true); // the other half will check input.setPrimary(output.getPrimary()); addInput(input); for (Input input : inputs()) { if (!input.getPort().startsWith("|") && !input.getPort().startsWith("#")) { Output output = new Output(runtime, input.getNode()); output.setSequence(true); // the other half will check output.setPrimary(input.getPrimary()); addOutput(output);
if (XProcConstants.p_declare_step.equals(this.getType())) { if (outputs().size() == 0 || (outputs().size() == 1 && "#current".equals(outputs().get(0).getPort()))) { Step last = subpipeline.get(subpipeline.size()-1); Output primary = last.getPrimaryOutput(); output.setPrimary(true); output.setSequence(primary.getSequence() || XProcConstants.p_for_each.equals(this.getType())); addOutput(output); input.setSequence(primary.getSequence()); input.setPrimary(true); addInput(input);
if (XProcConstants.p_pipeline.equals(getType())) { Step decl = declaration; for (Input dinput : decl.inputs()) { if (input.getPort().startsWith("|") && parent != null) { String oport = input.getPort().substring(1); output = getOutput(oport); } else { valid = false; error("Input " + input.getPort() + " unbound on " + getType() + " step named " + getName() + " and no default binding available.", XProcConstants.staticError(32)); Output output = env.readablePort(pipe.getStep(), pipe.getPort()); if (output == null) { error("Unreadable port: " + pipe.getPort() + " on " + pipe.getStep(), XProcException.err_E0001); valid = false;
public void checkPrimaryIO() { checkPrimaryInput(false); checkPrimaryInput(true); checkPrimaryOutput(); int count = 0; int pcount = 0; Port primary = null; Port defPrimary = null; for (Output output : outputs()) { if (!output.getPort().startsWith("#")) { count++; defPrimary = output; if (output.getPrimary()) { pcount++; primary = output; } } } if (pcount > 1) { throw XProcException.staticError(30); } if (count == 1 && (defPrimary.getPrimary() || !defPrimary.getPrimarySet())) { defPrimary.setPrimary(true); } }
@Override public void checkVariables() { for (Variable variable : variables) { for (Binding binding : variable.getBinding()) { if (binding.getBindingType() == Binding.PIPE_NAME_BINDING) { PipeNameBinding pipe = (PipeNameBinding) binding; String name = pipe.getStep(); boolean ancestor = false; Step step = this; while (step != null && !ancestor) { ancestor = name.equals(step.getName()); step = step.parent; } if (!ancestor) { logger.trace(MessageFormatter.nodeMessage(node, getName() + " variable depends on " + pipe.getStep())); addDependency(pipe.getStep()); } } } } }
Input input = getInput("|" + output.getPort()); if (input == null) { input = new Input(runtime, output.getNode()); input.setSequence(true); // the other half will check input.setPrimary(output.getPrimary()); addInput(input); for (Input input : inputs()) { if (!input.getPort().startsWith("|") && !input.getPort().startsWith("#")) { Output output = new Output(runtime, input.getNode()); output.setSequence(true); // the other half will check output.setPrimary(input.getPrimary()); addOutput(output);
if (XProcConstants.p_declare_step.equals(this.getType())) { if (outputs().size() == 0 || (outputs().size() == 1 && "#current".equals(outputs().get(0).getPort()))) { Step last = subpipeline.get(subpipeline.size()-1); Output primary = last.getPrimaryOutput(); output.setPrimary(true); output.setSequence(primary.getSequence() || XProcConstants.p_for_each.equals(this.getType())); addOutput(output); input.setSequence(primary.getSequence()); input.setPrimary(true); addInput(input);
if (XProcConstants.p_pipeline.equals(getType())) { Step decl = declaration; for (Input dinput : decl.inputs()) { if (input.getPort().startsWith("|") && parent != null) { String oport = input.getPort().substring(1); output = getOutput(oport); } else { valid = false; error("Input " + input.getPort() + " unbound on " + getType() + " step named " + getName() + " and no default binding available.", XProcConstants.staticError(32)); Output output = env.readablePort(pipe.getStep(), pipe.getPort()); if (output == null) { error("Unreadable port: " + pipe.getPort() + " on " + pipe.getStep(), XProcException.err_E0001); valid = false;
public void checkPrimaryIO() { checkPrimaryInput(false); checkPrimaryInput(true); checkPrimaryOutput(); int count = 0; int pcount = 0; Port primary = null; Port defPrimary = null; for (Output output : outputs()) { if (!output.getPort().startsWith("#")) { count++; defPrimary = output; if (output.getPrimary()) { pcount++; primary = output; } } } if (pcount > 1) { throw XProcException.staticError(30); } if (count == 1 && (defPrimary.getPrimary() || !defPrimary.getPrimarySet())) { defPrimary.setPrimary(true); } }
@Override public void checkVariables() { for (Variable variable : variables) { for (Binding binding : variable.getBinding()) { if (binding.getBindingType() == Binding.PIPE_NAME_BINDING) { PipeNameBinding pipe = (PipeNameBinding) binding; String name = pipe.getStep(); boolean ancestor = false; Step step = this; while (step != null && !ancestor) { ancestor = name.equals(step.getName()); step = step.parent; } if (!ancestor) { logger.trace(MessageFormatter.nodeMessage(node, getName() + " variable depends on " + pipe.getStep())); addDependency(pipe.getStep()); } } } } }
public boolean valid() { boolean valid = validParams(); valid = valid && validOptions(); valid = valid && validBindings(); if (env.countVisibleSteps(getName()) > 1) { error("Duplicate step name: " + getName(), XProcConstants.staticError(2)); valid = false; } for (Step step : subpipeline) { boolean stepValid = step.valid(); valid = valid && stepValid; } valid = valid && validOutputBinding(); return valid; }
protected boolean validBindings() { boolean valid = super.validBindings(); for (Variable var : getVariables()) { if (!checkOptionBinding(var, true)) { valid = false; } } return valid; }
public void addStep(Step step) { super.addStep(step); }