JcrNodeDefinition with( ExecutionContext context ) { return new JcrNodeDefinition(context, this.nodeTypeManager, this.declaringNodeType, key(), name, getOnParentVersion(), isAutoCreated(), isMandatory(), isProtected(), allowsSameNameSiblings(), defaultPrimaryTypeName, requiredPrimaryTypeNames); }
JcrNodeDefinition with( ExecutionContext context ) { return new JcrNodeDefinition(context, this.nodeTypeManager, this.declaringNodeType, key(), name, getOnParentVersion(), isAutoCreated(), isMandatory(), isProtected(), allowsSameNameSiblings(), defaultPrimaryTypeName, requiredPrimaryTypeNames); }
JcrNodeDefinition with( RepositoryNodeTypeManager nodeTypeManager ) { return new JcrNodeDefinition(this.context, nodeTypeManager, this.declaringNodeType, key(), name, getOnParentVersion(), isAutoCreated(), isMandatory(), isProtected(), allowsSameNameSiblings(), defaultPrimaryTypeName, requiredPrimaryTypeNames); }
JcrNodeDefinition with( RepositoryNodeTypeManager nodeTypeManager ) { return new JcrNodeDefinition(this.context, nodeTypeManager, this.declaringNodeType, key(), name, getOnParentVersion(), isAutoCreated(), isMandatory(), isProtected(), allowsSameNameSiblings(), defaultPrimaryTypeName, requiredPrimaryTypeNames); }
/** * Creates a new <code>JcrNodeDefinition</code> that is identical to the current object, but with the given * <code>declaringNodeType</code>. Provided to support immutable pattern for this class. * * @param declaringNodeType the declaring node type for the new <code>JcrNodeDefinition</code> * @return a new <code>JcrNodeDefinition</code> that is identical to the current object, but with the given * <code>declaringNodeType</code>. */ JcrNodeDefinition with( JcrNodeType declaringNodeType ) { return new JcrNodeDefinition(this.context, declaringNodeType.nodeTypeManager(), declaringNodeType, key(), name, getOnParentVersion(), isAutoCreated(), isMandatory(), isProtected(), allowsSameNameSiblings(), defaultPrimaryTypeName, requiredPrimaryTypeNames); }
private JcrNodeDefinition childNodeDefinitionFrom( NodeDefinition childNodeDefn ) { Name childNodeName = nameFactory.create(childNodeDefn.getName()); Name defaultPrimaryTypeName = nameFactory.create(childNodeDefn.getDefaultPrimaryTypeName()); int onParentVersion = childNodeDefn.getOnParentVersion(); boolean mandatory = childNodeDefn.isMandatory(); boolean allowsSns = childNodeDefn.allowsSameNameSiblings(); boolean autoCreated = childNodeDefn.isAutoCreated(); boolean isProtected = childNodeDefn.isProtected(); Name[] requiredTypes; String[] requiredTypeNames = childNodeDefn.getRequiredPrimaryTypeNames(); if (requiredTypeNames != null) { List<Name> names = new ArrayList<Name>(requiredTypeNames.length); for (String typeName : requiredTypeNames) { names.add(nameFactory.create(typeName)); } requiredTypes = names.toArray(new Name[names.size()]); } else { requiredTypes = new Name[0]; } NodeKey prototypeKey = repository.repositoryCache().getSystemKey(); return new JcrNodeDefinition(this.context, null, prototypeKey, childNodeName, onParentVersion, autoCreated, mandatory, isProtected, allowsSns, defaultPrimaryTypeName, requiredTypes); }
private JcrNodeDefinition childNodeDefinitionFrom( NodeDefinition childNodeDefn ) { Name childNodeName = nameFactory.create(childNodeDefn.getName()); Name defaultPrimaryTypeName = nameFactory.create(childNodeDefn.getDefaultPrimaryTypeName()); int onParentVersion = childNodeDefn.getOnParentVersion(); boolean mandatory = childNodeDefn.isMandatory(); boolean allowsSns = childNodeDefn.allowsSameNameSiblings(); boolean autoCreated = childNodeDefn.isAutoCreated(); boolean isProtected = childNodeDefn.isProtected(); Name[] requiredTypes; String[] requiredTypeNames = childNodeDefn.getRequiredPrimaryTypeNames(); if (requiredTypeNames != null) { List<Name> names = new ArrayList<Name>(requiredTypeNames.length); for (String typeName : requiredTypeNames) { names.add(nameFactory.create(typeName)); } requiredTypes = names.toArray(new Name[names.size()]); } else { requiredTypes = new Name[0]; } NodeKey prototypeKey = repository.repositoryCache().getSystemKey(); return new JcrNodeDefinition(this.context, null, prototypeKey, childNodeName, onParentVersion, autoCreated, mandatory, isProtected, allowsSns, defaultPrimaryTypeName, requiredTypes); }
/** * Creates a new <code>JcrNodeDefinition</code> that is identical to the current object, but with the given * <code>declaringNodeType</code>. Provided to support immutable pattern for this class. * * @param declaringNodeType the declaring node type for the new <code>JcrNodeDefinition</code> * @return a new <code>JcrNodeDefinition</code> that is identical to the current object, but with the given * <code>declaringNodeType</code>. */ JcrNodeDefinition with( JcrNodeType declaringNodeType ) { return new JcrNodeDefinition(this.context, declaringNodeType.nodeTypeManager(), declaringNodeType, key(), name, getOnParentVersion(), isAutoCreated(), isMandatory(), isProtected(), allowsSameNameSiblings(), defaultPrimaryTypeName, requiredPrimaryTypeNames); }