summaryrefslogtreecommitdiff
path: root/src/main/java/com/c2kernel/persistency/outcome/Outcome.java
diff options
context:
space:
mode:
authorAndrew Branson <andrew.branson@cern.ch>2014-10-03 23:18:47 +0200
committerAndrew Branson <andrew.branson@cern.ch>2014-10-03 23:18:47 +0200
commitb68ea0f2b12c4c5189c5fc7c182a1b242dc63579 (patch)
tree85b1cc4713ba978c044bfa0656f9115c9f9bf9e3 /src/main/java/com/c2kernel/persistency/outcome/Outcome.java
parent275d0bbf555c8917be82ce4cc21eb4cabb00f4c5 (diff)
Rolled back the renaming of existing exceptions.
Diffstat (limited to 'src/main/java/com/c2kernel/persistency/outcome/Outcome.java')
-rw-r--r--src/main/java/com/c2kernel/persistency/outcome/Outcome.java28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/main/java/com/c2kernel/persistency/outcome/Outcome.java b/src/main/java/com/c2kernel/persistency/outcome/Outcome.java
index ac2d970..e039476 100644
--- a/src/main/java/com/c2kernel/persistency/outcome/Outcome.java
+++ b/src/main/java/com/c2kernel/persistency/outcome/Outcome.java
@@ -40,8 +40,8 @@ import org.w3c.dom.ls.DOMImplementationLS;
import org.w3c.dom.ls.LSSerializer;
import org.xml.sax.InputSource;
-import com.c2kernel.common.InvalidData;
-import com.c2kernel.common.ObjectNotFound;
+import com.c2kernel.common.InvalidDataException;
+import com.c2kernel.common.ObjectNotFoundException;
import com.c2kernel.common.PersistencyException;
import com.c2kernel.entity.C2KLocalObject;
import com.c2kernel.persistency.ClusterStorage;
@@ -144,10 +144,10 @@ public class Outcome implements C2KLocalObject {
mData = null;
}
- public String getFieldByXPath(String xpath) throws XPathExpressionException, InvalidData {
+ public String getFieldByXPath(String xpath) throws XPathExpressionException, InvalidDataException {
Node field = getNodeByXPath(xpath);
if (field == null)
- throw new InvalidData(xpath);
+ throw new InvalidDataException(xpath);
else if (field.getNodeType()==Node.TEXT_NODE || field.getNodeType()==Node.CDATA_SECTION_NODE)
return field.getNodeValue();
@@ -155,28 +155,28 @@ public class Outcome implements C2KLocalObject {
else if (field.getNodeType()==Node.ELEMENT_NODE) {
NodeList fieldChildren = field.getChildNodes();
if (fieldChildren.getLength() == 0)
- throw new InvalidData("No child node for element");
+ throw new InvalidDataException("No child node for element");
else if (fieldChildren.getLength() == 1) {
Node child = fieldChildren.item(0);
if (child.getNodeType()==Node.TEXT_NODE || child.getNodeType()==Node.CDATA_SECTION_NODE)
return child.getNodeValue();
else
- throw new InvalidData("Can't get data from child node of type "+child.getNodeName());
+ throw new InvalidDataException("Can't get data from child node of type "+child.getNodeName());
}
else
- throw new InvalidData("Element "+xpath+" has too many children");
+ throw new InvalidDataException("Element "+xpath+" has too many children");
}
else if (field.getNodeType()==Node.ATTRIBUTE_NODE)
return field.getNodeValue();
else
- throw new InvalidData("Don't know what to do with node "+field.getNodeName());
+ throw new InvalidDataException("Don't know what to do with node "+field.getNodeName());
}
- public void setFieldByXPath(String xpath, String data) throws XPathExpressionException, InvalidData {
+ public void setFieldByXPath(String xpath, String data) throws XPathExpressionException, InvalidDataException {
Node field = getNodeByXPath(xpath);
if (field == null)
- throw new InvalidData(xpath);
+ throw new InvalidDataException(xpath);
else if (field.getNodeType()==Node.ELEMENT_NODE) {
NodeList fieldChildren = field.getChildNodes();
@@ -191,16 +191,16 @@ public class Outcome implements C2KLocalObject {
child.setNodeValue(data);
break;
default:
- throw new InvalidData("Can't set child node of type "+child.getNodeName());
+ throw new InvalidDataException("Can't set child node of type "+child.getNodeName());
}
}
else
- throw new InvalidData("Element "+xpath+" has too many children");
+ throw new InvalidDataException("Element "+xpath+" has too many children");
}
else if (field.getNodeType()==Node.ATTRIBUTE_NODE)
field.setNodeValue(data);
else
- throw new InvalidData("Don't know what to do with node "+field.getNodeName());
+ throw new InvalidDataException("Don't know what to do with node "+field.getNodeName());
}
@@ -211,7 +211,7 @@ public class Outcome implements C2KLocalObject {
return mData;
}
- public Schema getSchema() throws ObjectNotFound {
+ public Schema getSchema() throws ObjectNotFoundException {
return LocalObjectLoader.getSchema(mSchemaType, mSchemaVersion);
}