}
private void readPropagationSpec(Element propagation, PropagationSpecs propagationSpecs) throws MaltChainedException {
int nFrom = propagation.getElementsByTagName("from").getLength();
if (nFrom < 1 && nFrom > 1) {
throw new PropagationException("Propagation specification wrongly formatted: Number of 'from' elements is '"+nFrom+"', must be 1.");
}
int nTo = propagation.getElementsByTagName("to").getLength();
if (nTo < 1 && nTo > 1) {
throw new PropagationException("Propagation specification wrongly formatted: Number of 'to' elements is '"+nTo+"', must be 1.");
}
int nFor = propagation.getElementsByTagName("for").getLength();
if (nFor > 1) {
throw new PropagationException("Propagation specification wrongly formatted: Number of 'for' elements is '"+nFor+"', at most 1.");
}
int nOver = propagation.getElementsByTagName("over").getLength();
if (nOver > 1) {
throw new PropagationException("Propagation specification wrongly formatted: Number of 'over' elements is '"+nOver+"',at most 1.");
}
String fromText = ((Element)propagation.getElementsByTagName("from").item(0)).getTextContent().trim();
if (fromText.length() == 0) {
throw new PropagationException("Propagation specification wrongly formatted: The 'from' element is empty");
}
String toText = ((Element)propagation.getElementsByTagName("to").item(0)).getTextContent().trim();
if (toText.length() == 0) {
throw new PropagationException("Propagation specification wrongly formatted: The 'to' element is empty");
}
String forText = "";
if (nFor != 0) {
forText = ((Element)propagation.getElementsByTagName("for").item(0)).getTextContent().trim();
}