Create a new child {@code Context}. The name must not contain any slashes ({@code '/'}).

@throws IllegalArgumentException if a child or key-value pair with the given @{code name} exists.
5051
public Context createChild(String name) {
        Preconditions.checkArgument(name.indexOf('/') == -1, "name must not contain a slash");
        Preconditions.checkArgument(!children.containsKey(name), "child with name '%s' already exists", name);
        Preconditions.checkArgument(!values.containsKey(name), "name identifies a key-value pair",
                "createChild operation not allowed");
        Context child = new Context();
        children.put(name, child);
        return child;
    }
991262
public void createAndEditNewElement(String contextId) {

        Runnable action = m_createFunctions.get(contextId);
        if (action != null) {
            action.run();
        } else {
            log("Could not execute create action for context id '" + contextId + "'");
        }
    }
1304677
@Override
    public Object create(ActionParameter argument, Context context, ParameterFactories engine) {
        Object object = createNewInstance(argument.getRawType(), context, engine);

        for (Method method : argument.getRawType().getMethods()) {
            if (method.getName().startsWith(SETTER_PREFIX)) {
                if (method.getParameterTypes().length != 1) {
                    LOGGER.warn("The class {} has a setter method called {} but with too many parameters to be " +
                                    "injected with the 'BeanParameter' annotation", argument.getRawType().getName(),
                            method.getName());
                    continue;
                }

                // Only 1 parameter
                Annotation[] annotation = method.getParameterAnnotations()[0];
                Class<?> typesOfParameter = method.getParameterTypes()[0];
                Type genericTypeOfParameter = method.getGenericParameterTypes()[0];
                ActionParameter parameter = ActionParameter.from(method, annotation, typesOfParameter,
                        genericTypeOfParameter);
                // An exception is thrown if we can't build the parameter object.
                Object value = Bindings.create(parameter, context, engine);
                if (value != null) {
                    inject(object, method, value);
                }
            }
        }
        return object;
    }
785598
function create(context) {
    const options = Array.isArray(context.options) ? context.options : [];
    const isPathAndPatternsObject =
        typeof options[0] === "object" &&
        (Object.prototype.hasOwnProperty.call(options[0], "paths") ||
            Object.prototype.hasOwnProperty.call(options[0], "patterns"));

    const restrictedPaths =
        (isPathAndPatternsObject ? options[0].paths : options) || [];
    const restrictedPatterns =
        (isPathAndPatternsObject ? options[0].patterns : []) || [];

    const restrictedPathMessages = restrictedPaths.reduce(
        (memo, importName) => {
            if (typeof importName === "string") {
                memo[importName] = null;
            } else {
                memo[importName.name] = importName.message;
            }
            return memo;
        },
        {}
    );

    // if no modules are restricted we don"t need to check
    if (
        Object.keys(restrictedPaths).length === 0 &&
        restrictedPatterns.length === 0
    ) {
        return {};
    }

    const ig = ignore().add(restrictedPatterns);

    /**
     * Report a restricted path.
     * @param {node} node representing the restricted path reference
     * @returns {void}
     * @private
     */
    function reportPath(node) {
        const moduleName = node.value.trim();
        const customMessage = restrictedPathMessages[moduleName];
        const message = customMessage
            ? CUSTOM_MESSAGE_TEMPLATE
            : DEFAULT_MESSAGE_TEMPLATE;

        context.report({
            node,
            message,
            data: {
                moduleName,
                customMessage
            }
        });
    }

    /**
     * Check if the given name is a restricted path name
     * @param {string} name name of a variable
     * @returns {boolean} whether the variable is a restricted path or not
     * @private
     */
    function isRestrictedPath(name) {
        return Object.prototype.hasOwnProperty.call(
            restrictedPathMessages,
            name
        );
    }

    return {
        CallExpression(node) {
            if (!isAmdDefine(node) && !isAmdRequire(node)) return;

            const paths = getDependencyStringNodes(node);

            for (let i = 0; i < paths.length; i++) {
                const nodeCurrent = paths[i];
                const moduleName = nodeCurrent.value.trim();

                // check if argument value is in restricted modules array
                if (isRestrictedPath(moduleName)) {
                    reportPath(nodeCurrent);
                }

                if (restrictedPatterns.length > 0 && ig.ignores(moduleName)) {
                    context.report({
                        node,
                        message:
                            "'{{moduleName}}' module is restricted from being used by a pattern.",
                        data: { moduleName }
                    });
                    break;
                }
            }
        }
    };
}
43457
public boolean createChildScope(String name) {
        if (!scope.hasChildScope(name)) {
            return scope.createChildScope(name);
        }
        return false;
    }
1087190
function newContext(context, params) {
  if (!params) {
    return context;
  }

  return assign({}, context, {
    data: params.data ? arrayPush(params.data, context.data) : context.data,
    parent: params.newParent ? context : context.parent,
    index: 'index' in params ? params.index : context.index,
    item: 'item' in params ? params.item : context.item
  });
}
101156
private DevUtilsDemoObject create(final String name, ExecutionContext executionContext) {
        return executionContext.add(this, devUtilsDemoObjects.create(name));
    }
1190516
protected By createBy(TestContext context) {
        if (by != null) {
            return by;
        }

        switch (property) {
            case "id":
                return By.id(context.replaceDynamicContentInString(propertyValue));
            case "class-name":
                return By.className(context.replaceDynamicContentInString(propertyValue));
            case "link-text":
                return By.linkText(context.replaceDynamicContentInString(propertyValue));
            case "css-selector":
                return By.cssSelector(context.replaceDynamicContentInString(propertyValue));
            case "name":
                return By.name(context.replaceDynamicContentInString(propertyValue));
            case "tag-name":
                return By.tagName(context.replaceDynamicContentInString(propertyValue));
            case "xpath":
                return By.xpath(context.replaceDynamicContentInString(propertyValue));
        }

        throw new CitrusRuntimeException("Unknown selector type: " + property);
    }
734048
private Context createContext(String name) {
		Context context = new Context(this, this.nextContextIndex++);
		context.setName(name);
		return context;
	}
854534
public Object create(String name, Object... args)
    throws ClassNotFoundException,
           NoSuchMethodException,
           IllegalAccessException,
           InstantiationException,
           InvocationTargetException
    {
//StringBuilder sb = new StringBuilder("DefaultObjectFactory.create(").append(name).append(',');
//for (Object arg: args) {
//sb.append(arg.getClass().getName()).append(' ');
//}
//sb.append(')');
//System.err.println(sb);
        try {
            Class<?> type = Class.forName(name);
/*
            Constructor<?>[] constructors = type.getConstructors();
            for (Constructor<?> constructor: constructors) {
                Class<?>[] ptypes = constructor.getParameterTypes();
                if (ptypes.length == args.length) {
                    try {
                        return constructor.newInstance(args);
                    } catch (IllegalArgumentException x) {
                        // ignore and try the next one
                    } catch (IllegalAccessException x) {
                        throw x;
                    } catch (InstantiationException x) {
                        throw x;
                    } catch (InvocationTargetException x) {
                        throw x;
                    }
                }
            }
            throw new NoSuchMethodException("Can't locate a desired constructor in " + name);
*/
//System.err.println("DefaultObjectFactory.create: successful");
            return Beans.create(type, args);
        } catch (ClassNotFoundException x) {
            throw x;
        }
    }
475454
public static MutableInodeDirectory create(long id, long parentId, String name,
      CreateDirectoryContext context) {
    return new MutableInodeDirectory(id)
        .setParentId(parentId)
        .setName(name)
        .setTtl(context.getTtl())
        .setTtlAction(context.getTtlAction())
        .setOwner(context.getOwner())
        .setGroup(context.getGroup())
        .setMode(context.getMode().toShort())
        .setAcl(context.getAcl())
        // SetAcl call is also setting default AclEntries
        .setAcl(context.getDefaultAcl())
        .setMountPoint(context.isMountPoint());
  }
267588
public ChildChannelDataImpl createChild() {
        String childName = this.name + CHILD_STRING + nextChildId();
        ChildChannelDataImpl child = new ChildChannelDataImpl(childName, this);
        this.children.add(child);
        return child;
    }
141060
private void addContext(
      final EvaluatorRuntimeProtocol.AddContextProto addContextProto)
      throws ContextClientCodeException {

    synchronized (this.contextStack) {
      try {

        final ContextRuntime currentTopContext = this.contextStack.peek();

        if (!currentTopContext.getIdentifier().equals(addContextProto.getParentContextId())) {
          throw new IllegalStateException("Trying to instantiate a child context on context with id `" +
              addContextProto.getParentContextId() + "` while the current top context id is `" +
              currentTopContext.getIdentifier() + "`");
        }

        final Configuration contextConfiguration =
            this.configurationSerializer.fromString(addContextProto.getContextConfiguration());

        final ContextRuntime newTopContext;
        if (addContextProto.hasServiceConfiguration()) {
          newTopContext = currentTopContext.spawnChildContext(contextConfiguration,
              this.configurationSerializer.fromString(addContextProto.getServiceConfiguration()));
        } else {
          newTopContext = currentTopContext.spawnChildContext(contextConfiguration);
        }

        this.contextStack.push(newTopContext);

      } catch (final IOException | BindException e) {
        throw new RuntimeException("Unable to read configuration.", e);
      }

    }
  }
809503
function create(context) {
    return {
        CallExpression(node) {
            if (isObjectDefine(node)) {
                context.report(node, message);
            }
        }
    };
}
922442
public static Domain create(final String name) throws AppPlatformException, ParseException, Exception {
        return create(name, null);
    }
54502
@Override
    protected final T create(Object... args) {
        final K key = this.getKey(args);
        final T value = this.createInternal(key, args);
        this.objectCache.put(key, value);
        return value;
    }
637029
public static Object newInstance(String name) {
        try {
            return forName(name).newInstance();
        } catch (InstantiationException e) {
            throw new IllegalStateException(e.getMessage(), e);
        } catch (IllegalAccessException e) {
            throw new IllegalStateException(e.getMessage(), e);
        }
    }