summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpelder2006-08-16 22:20:26 (EDT)
committer pelder2006-08-16 22:20:26 (EDT)
commitc1bcfadcf3d8e772434c45967973b64dad10ccf9 (patch)
treecf2dd848cc487505994908a824a6965dead54ec2
parente34a2691216d2a49f3c2b9c5af04aa249bff6c86 (diff)
downloadorg.eclipse.jet-c1bcfadcf3d8e772434c45967973b64dad10ccf9.zip
org.eclipse.jet-c1bcfadcf3d8e772434c45967973b64dad10ccf9.tar.gz
org.eclipse.jet-c1bcfadcf3d8e772434c45967973b64dad10ccf9.tar.bz2
[154175] Check for UnsupportedOperationException in IElementInspector methods and handle appropriately.
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/XPathContextExtender.java49
1 files changed, 46 insertions, 3 deletions
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/XPathContextExtender.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/XPathContextExtender.java
index 879dde6..2d0633e 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/XPathContextExtender.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/XPathContextExtender.java
@@ -255,7 +255,15 @@ public final class XPathContextExtender extends AbstractContextExtender implemen
{
IElementInspector elementInspector = getElementInspector(element);
- boolean isSet = elementInspector.createAttribute(element, name, bodyContent);
+ boolean isSet = false;
+ try
+ {
+ isSet = elementInspector.createAttribute(element, name, bodyContent);
+ }
+ catch (UnsupportedOperationException e)
+ {
+ // continue, ;
+ }
if(!isSet && getData().annotationManager != null) {
Object annotation = getData().annotationManager.getAnnotationObject(element);
@@ -322,14 +330,35 @@ public final class XPathContextExtender extends AbstractContextExtender implemen
// cannot happend, as we're passing null as the third argument;
throw new JET2TagException(e);
}
+ catch(UnsupportedOperationException e)
+ {
+ throw convertToTagException(e);
+ }
}
public void removeElement(Object element) throws JET2TagException
{
IElementInspector inspector = getElementInspector(element);
- inspector.removeElement(element);
+ try
+ {
+ inspector.removeElement(element);
+ }
+ catch (UnsupportedOperationException e)
+ {
+ throw convertToTagException(e);
+ }
+
+ }
+ /**
+ * @param e
+ * @return
+ */
+ private JET2TagException convertToTagException(UnsupportedOperationException e)
+ {
+ // FIXME: add a message for this
+ return new JET2TagException(e.toString());
}
/**
@@ -355,6 +384,10 @@ public final class XPathContextExtender extends AbstractContextExtender implemen
{
throw new JET2TagException(e.getLocalizedMessage(), e);
}
+ catch (UnsupportedOperationException e)
+ {
+ throw convertToTagException(e);
+ }
}
/**
@@ -391,6 +424,9 @@ public final class XPathContextExtender extends AbstractContextExtender implemen
{
throw new JET2TagException(e.getLocalizedMessage(), e);
}
+ catch (UnsupportedOperationException e) {
+ throw convertToTagException(e);
+ }
}
/**
@@ -447,7 +483,14 @@ public final class XPathContextExtender extends AbstractContextExtender implemen
public void removeAttribute(Object element, String attributeName) throws JET2TagException
{
IElementInspector inspector = getElementInspector(element);
- inspector.removeAttribute(element, attributeName);
+ try
+ {
+ inspector.removeAttribute(element, attributeName);
+ }
+ catch (UnsupportedOperationException e)
+ {
+ throw convertToTagException(e);
+ }
}