}
}
+ /**
+ * Whether this node has this property.
+ *
+ * @see Node#hasProperty(String)
+ * @throws JcrException caused by {@link RepositoryException}
+ */
+ public static boolean hasProperty(Node node, String property) {
+ try {
+ return node.hasProperty(property);
+ } catch (RepositoryException e) {
+ throw new JcrException("Cannot check whether " + node + " has property " + property, e);
+ }
+ }
+
/**
* Set a property to the given value, or remove it if the value is
* <code>null</code>.
}
}
+ @SuppressWarnings("unchecked")
public static <T> T getAs(Node node, String property, Class<T> clss) {
if (String.class.isAssignableFrom(clss)) {
return (T) get(node, property);