Search in sources :

Example 1 with JSONException

use of org.eclipse.wst.json.core.document.JSONException in project webtools.sourceediting by eclipse.

the class JSONStructureImpl method removeChildNodes.

/**
 * removeChildNodes method
 */
public void removeChildNodes() {
    if (!isChildEditable()) {
        // JSONMessages.NO_MODIFICATION_ALLOWED_ERR);
        throw new JSONException();
    }
    IJSONNode nextChild = null;
    for (IJSONNode child = getFirstChild(); child != null; child = nextChild) {
        nextChild = child.getNextSibling();
        removeChild(child);
    }
}
Also used : JSONException(org.eclipse.wst.json.core.document.JSONException) IJSONNode(org.eclipse.wst.json.core.document.IJSONNode)

Aggregations

IJSONNode (org.eclipse.wst.json.core.document.IJSONNode)1 JSONException (org.eclipse.wst.json.core.document.JSONException)1