Creates an instance of the tag with the given id, using the String constructor.

@param id      Id of the tag.
@param tagName Name to give the tag.
@return The created tag.
@throws TagCreateException If an error occurs while creating the tag.
965702
public static Tag createInstance(int id, String tagName) throws TagCreateException {
        Class<? extends Tag> clazz = idToTag.get(id);
        if(clazz == null) {
            throw new TagCreateException("Could not find tag with ID \"" + id + "\".");
        }

        try {
            Constructor<? extends Tag> constructor = clazz.getDeclaredConstructor(String.class);
            constructor.setAccessible(true);
            return constructor.newInstance(tagName);
        } catch(Exception e) {
            throw new TagCreateException("Failed to create instance of tag \"" + clazz.getSimpleName() + "\".", e);
        }
    }
648495
public static BeanId create(final String instanceId, final String schemaName) {
        if (instanceId == null || "".equals(instanceId)) {
            throw CFG107_MISSING_ID();
        }
        return new BeanId(instanceId, schemaName);
    }
609926
private static String createTagletPattern(String tagNames) {
        final StringBuilder regex = new StringBuilder();
        final int size = STR_TAGS_REGEX_LIST.size();
        for (int regexIdx = 0; regexIdx < size; regexIdx++) {
            final String tagRegex = STR_TAGS_REGEX_LIST.get(regexIdx);
            final String argsRex = STR_ARGS_REGEX_LIST.get(regexIdx);
            if (regexIdx > 0) {
                regex.append('|');
            }
            regex.append(tagRegex).append(tagNames).append(STR_TAG_ARG_REGEX_SEPARATOR).append(argsRex);

        }
        return regex.toString();
    }
226563
def create_tag(self, tag_name):
        
        # Make sure the local repository exists and supports a working tree.
        self.create()
        self.ensure_working_tree()
        # Create the new tag in the local repository.
        logger.info("Creating tag '%s' in %s ..", tag_name, format_path(self.local))
        self.context.execute(*self.get_create_tag_command(tag_name))
767605
public static void register(int id, Class<? extends Tag> tag) throws TagRegisterException {
        if(idToTag.containsKey(id)) {
            throw new TagRegisterException("Tag ID \"" + id + "\" is already in use.");
        }

        if(tagToId.containsKey(tag)) {
            throw new TagRegisterException("Tag \"" + tag.getSimpleName() + "\" is already registered.");
        }

        idToTag.put(id, tag);
        tagToId.put(tag, id);
    }
339468
public static String getTagValue(Id id, String k) {
    Preconditions.checkNotNull(id, "id");
    return getTagValue(id.tags(), k);
  }
304356
private static final TagKey createTagKey(String name) throws TagContextDeserializationException {
    try {
      return TagKey.create(name);
    } catch (IllegalArgumentException e) {
      throw new TagContextDeserializationException("Invalid tag key: " + name, e);
    }
  }
333548
private TagScript createTagScript(QName n, Map<?, ?> attributes) throws JellyException {
        TagLibrary lib = context.getTagLibrary(n.getNamespaceURI());
        if(lib!=null) {
            String localName = n.getLocalPart();

            TagScript tagScript = lib.createTagScript(localName, null/*this parameter appears to be unused.*/);
            if (tagScript==null)    tagScript = lib.createTagScript(localName.replace('_','-'), null);

            if (tagScript!=null) {
                if (attributes != null) {
                    for (Entry e : attributes.entrySet()) {
                        Object v = e.getValue();
                        if (v!=null)
                            tagScript.addAttribute(e.getKey().toString(), new ConstantExpression(v));
                    }
                }

                return tagScript;
            }
        }

        // otherwise treat it as a literal.
        return null;
    }
816457
def create_tag(tag_name, kind='z'):
        '''
        
        '''
        cur_recs = TabTag.select().where(
            (TabTag.name == tag_name) &
            (TabTag.kind == kind)
        )
        if cur_recs.count():
            uid = cur_recs.get().uid

            # TabTag.delete().where(
            #     (TabTag.name == tag_name) &
            #     (TabTag.kind == kind)
            # ).execute()
        else:
            uid = tools.get_uu4d_v2()  # Label with the ID of v2.
            while TabTag.select().where(TabTag.uid == uid).count() > 0:
                uid = tools.get_uu4d_v2()

            TabTag.create(
                uid=uid,
                slug=uid,
                name=tag_name,
                order=1,
                count=0,
                kind='z',
                tmpl=9,
                pid='zzzz',
            )
        return uid
1352751
@SuppressWarnings("unchecked")
	public T tag(final String tag) {
		if (this.tags == null) {
			this.tags = new HashSet<>();
		}

		this.tags.add(tag);
		return (T) this;
	}
90576
public void setId(final String id) {
        // Set the DBId as well if it isn't a new id
        if (id.matches(CSConstants.EXISTING_TOPIC_ID_REGEX)) {
            DBId = Integer.parseInt(id);
        }
        this.id = id;
    }
315677
public static Element appendChild(Node node, String tagName) {
		Document doc = (node instanceof Document) ? (Document) node : node.getOwnerDocument();
		Element child = doc.createElement(tagName);
		node.appendChild(child);
		return child;
	}
586224
public CreateTagResponse create(String tagName) {
        BeanUtil.requireNonNull(tagName, "tagName is null");
        CreateTagResponse response;
        LOG.debug("创建标签.....");
        String url = BASE_API_URL + "cgi-bin/tags/create?access_token=#";
        Map<String, Object> param = new HashMap<String, Object>();
        Map<String, Object> tag = new HashMap<String, Object>();
        tag.put("name", tagName);
        param.put("tag", tag);
        BaseResponse r = executePost(url, JSONUtil.toJson(param));
        String resultJson = isSuccess(r.getErrcode()) ? r.getErrmsg() : r.toJsonString();
        response = JSONUtil.toBean(resultJson, CreateTagResponse.class);
        return response;
    }
107692
function createElement(tagName) {
  return function (...args) {
    const element  = document.createElement(tagName);
    const attrs    = isObject(args[0]) ? args[0] : {};
    const children = args.length === 2 ? args[1] : args[0];

    Object
      .keys(attrs)
      .forEach(name => element.setAttribute(name, attrs[name]));

    if (Array.isArray(children)) {
      children.forEach(node => append(element, node));
    }

    if (isString(children) && !isVoidElement(tagName.toLowerCase())) {
      append(element, children);
    }

    return element;
  };
}
163231
public Id<Attributes<T>> getOrCreateId()
   {
      List<Node> nodeList = childNode.get("id");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new IdImpl<Attributes<T>>(this, "id", childNode, nodeList.get(0));
      }
      return createId();
   }
435413
public Tag create(String name) {
        String url = WxEndpoint.get("url.tag.create");
        TagWrapper tag = new TagWrapper(name);
        String json = JsonMapper.nonEmptyMapper().toJson(tag);
        logger.debug("create tag: {}", json);
        String response = wxClient.post(url, json);
        TagWrapper wrapper = JsonMapper.defaultMapper().fromJson(response, TagWrapper.class);
        return wrapper.getTag();
    }
1208664
public static Bean create(final BeanId id) {
        Preconditions.checkNotNull(id);
        Bean bean = new Bean(id);
        bean.set(id.getSchema());
        return bean;
    }