From b68ea0f2b12c4c5189c5fc7c182a1b242dc63579 Mon Sep 17 00:00:00 2001 From: Andrew Branson Date: Fri, 3 Oct 2014 23:18:47 +0200 Subject: Rolled back the renaming of existing exceptions. --- .../com/c2kernel/persistency/outcome/Outcome.java | 28 +++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'src/main/java/com/c2kernel/persistency/outcome/Outcome.java') 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); } -- cgit v1.2.3