public Output getPrimaryOutput() { int count = 0; Output defPrimary = null; for (Output output : outputs) { if ("#current".equals(output.getPort())) { // nop; this one never counts } else { if (output.getPrimary() || !output.getPrimarySet()) { defPrimary = output; } count++; if (output.getPrimary()) { return output; } } } if (count == 1) { return defPrimary; } else { return null; } }
public PipelineConfiguration(XProcRuntime runtime, XPipeline xpipeline, Calendar expires) { this.runtime = runtime; this.pipeline = xpipeline; this.expires = expires; DeclareStep pipeline = xpipeline.getDeclareStep(); // Figure out the default input port for (String port : xpipeline.getInputs()) { inputPorts.add(port); com.xmlcalabash.model.Input input = pipeline.getInput(port); if (!input.getParameterInput() && input.getPrimary()) { definput = port; } } // Figure out the default output port for (String port : xpipeline.getOutputs()) { outputPorts.add(port); com.xmlcalabash.model.Output output = pipeline.getOutput(port); if (output.getPrimary()) { defoutput = port; } } }
public Output getPrimaryOutput() { int count = 0; Output defPrimary = null; for (Output output : outputs) { if ("#current".equals(output.getPort())) { // nop; this one never counts } else { if (output.getPrimary() || !output.getPrimarySet()) { defPrimary = output; } count++; if (output.getPrimary()) { return output; } } } if (count == 1) { return defPrimary; } else { return null; } }
public PipelineConfiguration(XProcRuntime runtime, XPipeline xpipeline, Calendar expires) { this.runtime = runtime; this.pipeline = xpipeline; this.expires = expires; DeclareStep pipeline = xpipeline.getDeclareStep(); // Figure out the default input port for (String port : xpipeline.getInputs()) { inputPorts.add(port); com.xmlcalabash.model.Input input = pipeline.getInput(port); if (!input.getParameterInput() && input.getPrimary()) { definput = port; } } // Figure out the default output port for (String port : xpipeline.getOutputs()) { outputPorts.add(port); com.xmlcalabash.model.Output output = pipeline.getOutput(port); if (output.getPrimary()) { defoutput = port; } } }
public Output getDefaultOutput() { // See if there's exactly one "ordinary" output int count = 0; Output defout = null; for (Output output : outputs) { if (!output.getPort().startsWith("#")) { if (output.getPrimary()) { return output; } if (!output.getPort().endsWith("|")) { count++; defout = output; } } } if (count == 1 && (defout.getPrimary() || !defout.getPrimarySet())) { return defout; } return null; }
if (s1output.getPrimary() != output.getPrimary()) { valid = false; runtime.error(null, p_group.getNode(), "Output port " + output.getPort() + " has different primary status.", XProcConstants.staticError(9));
public Output getDefaultOutput() { // See if there's exactly one "ordinary" output int count = 0; Output defout = null; for (Output output : outputs) { if (!output.getPort().startsWith("#")) { if (output.getPrimary()) { return output; } if (!output.getPort().endsWith("|")) { count++; defout = output; } } } if (count == 1 && (defout.getPrimary() || !defout.getPrimarySet())) { return defout; } return null; }
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); } }
private void checkPrimaryOutput() { int count = 0; int pcount = 0; Port defPrimary = null; Port primary = null; for (Output output : outputs()) { if (!output.getPort().endsWith("|")) { count++; if (output.getPrimary()) { pcount++; if (primary == null) { primary = output; } } if (defPrimary == null && !output.getPrimarySet()) { defPrimary = output; } } } if (pcount > 1) { throw XProcException.staticError(30); } if (count == 1 && primary == null && defPrimary != null) { if (defPrimary.getPrimary() || !defPrimary.getPrimarySet()) { defPrimary.setPrimary(true); } } }
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); } }
private void checkPrimaryOutput() { int count = 0; int pcount = 0; Port defPrimary = null; Port primary = null; for (Output output : outputs()) { if (!output.getPort().endsWith("|")) { count++; if (output.getPrimary()) { pcount++; if (primary == null) { primary = output; } } if (defPrimary == null && !output.getPrimarySet()) { defPrimary = output; } } } if (pcount > 1) { throw XProcException.staticError(30); } if (count == 1 && primary == null && defPrimary != null) { if (defPrimary.getPrimary() || !defPrimary.getPrimarySet()) { defPrimary.setPrimary(true); } } }
@Override protected void augmentIO() { // Output bindings on a compound step are really the input half of an input/output binding; // create the other half for (Output output : outputs) { Input input = getInput("|" + output.getPort()); if (input == null) { input = new Input(runtime, output.getNode()); input.setPort("|" + output.getPort()); input.setSequence(true); // the other half will check input.setPrimary(output.getPrimary()); addInput(input); } } // The only input on catch is errors and it's special } }
@Override protected void augmentIO() { // Output bindings on a compound step are really the input half of an input/output binding; // create the other half for (Output output : outputs) { Input input = getInput("|" + output.getPort()); if (input == null) { input = new Input(runtime, output.getNode()); input.setPort("|" + output.getPort()); input.setSequence(true); // the other half will check input.setPrimary(output.getPrimary()); addInput(input); } } // The only input on catch is errors and it's special } }
@Override protected void augmentIO() { // Assume that everything will be OK when we validate... if (subpipeline.size() > 0) { Step step = subpipeline.get(0); for (Input input : step.inputs()) { Input cinput = new Input(runtime, step.getNode()); cinput.setPort(input.getPort()); cinput.setPrimary(input.getPrimary()); cinput.setSequence(input.getSequence()); addInput(cinput); } for (Output output : step.outputs()) { Output coutput = new Output(runtime, step.getNode()); coutput.setPort(output.getPort()); coutput.setPrimary(output.getPrimary()); coutput.setSequence(output.getSequence()); addOutput(coutput); } } super.augmentIO(); }
input.setPort("|" + output.getPort()); input.setSequence(true); // the other half will check input.setPrimary(output.getPrimary()); addInput(input);
@Override protected void augmentIO() { // Assume that everything will be OK when we validate... if (subpipeline.size() > 0) { Step step = subpipeline.get(0); for (Input input : step.inputs()) { Input cinput = new Input(runtime, step.getNode()); cinput.setPort(input.getPort()); cinput.setPrimary(input.getPrimary()); cinput.setSequence(input.getSequence()); addInput(cinput); } for (Output output : step.outputs()) { Output coutput = new Output(runtime, step.getNode()); coutput.setPort(output.getPort()); coutput.setPrimary(output.getPrimary()); coutput.setSequence(output.getSequence()); addOutput(coutput); } } super.augmentIO(); }
input.setPort("|" + output.getPort()); input.setSequence(true); // the other half will check input.setPrimary(output.getPrimary()); addInput(input);
protected void augmentIO() { if (getInput("#xpath-context") == null) { Input isource = new Input(runtime, node); isource.setPort("#xpath-context"); addInput(isource); } // Assume that everything will be OK when we validate... if (subpipeline.size() > 0) { Step step = subpipeline.get(0); for (Input input : step.inputs()) { Input cinput = new Input(runtime, step.getNode()); cinput.setPort(input.getPort()); cinput.setPrimary(input.getPrimary()); cinput.setSequence(input.getSequence()); addInput(cinput); } for (Output output : step.outputs()) { Output coutput = new Output(runtime, step.getNode()); coutput.setPort(output.getPort()); coutput.setPrimary(output.getPrimary()); coutput.setSequence(output.getSequence()); addOutput(coutput); } } super.augmentIO(); }
protected void augmentIO() { if (getInput("#xpath-context") == null) { Input isource = new Input(runtime, node); isource.setPort("#xpath-context"); addInput(isource); } // Assume that everything will be OK when we validate... if (subpipeline.size() > 0) { Step step = subpipeline.get(0); for (Input input : step.inputs()) { Input cinput = new Input(runtime, step.getNode()); cinput.setPort(input.getPort()); cinput.setPrimary(input.getPrimary()); cinput.setSequence(input.getSequence()); addInput(cinput); } for (Output output : step.outputs()) { Output coutput = new Output(runtime, step.getNode()); coutput.setPort(output.getPort()); coutput.setPrimary(output.getPrimary()); coutput.setSequence(output.getSequence()); addOutput(coutput); } } super.augmentIO(); }
builder.withPort(XProcPortInfo.newOutputPort( output.getPort(), output.getSequence(), output.getPrimary()));