}
// 4. node type constraints
if ((options & CHECK_CONSTRAINTS) == CHECK_CONSTRAINTS) {
QItemDefinition parentDef = itemMgr.getDefinition(parentState).unwrap();
// make sure parent node is not protected
if (parentDef.isProtected()) {
throw new ConstraintViolationException(
safeGetJCRPath(parentState.getNodeId())
+ ": cannot add child node to protected parent node");
}
// make sure there's an applicable definition for new child node