Add an opening tag to a StringBuffer.

If the buffer is null, a new one is created.

@param buffer
StringBuffer to fill
@param tag
the tag to open
@return the buffer
779866
public static StringBuffer appendOpeningTag(StringBuffer buffer, String tag)
	{
		return appendOpeningTag(buffer, tag, EMPTY_MAP);
	}
569440
public static void setTag(String tag) {
        d("Changing log tag to %s", tag);
        TAG = tag;

        // Reinitialize the DEBUG "constant"
        DEBUG = Log.isLoggable(TAG, Log.VERBOSE);
    }
1034374
public static String open(Tag tag, AttributeValue... attrs) {

        StringBuffer sb = new StringBuffer();
        sb.append("<").append(tag.name());
        for (AttributeValue attr : attrs) {
            sb.append(" ").append(attr.toString());
        }
        sb.append(">");
        return sb.toString();
    }
340233
private static StringBuffer doAppendOpeningTag(StringBuffer buffer, String tag, Map<String, String> attributes)
	{
		buffer.append(SEQUENCE__TAG__BEGIN_OPENING_TAG).append(tag);
		for (String _attributeName : attributes.keySet())
		{
			String _attributeValue = attributes.get(_attributeName);
			_attributeValue = encodeAttributeValue(_attributeValue);
			buffer.append(SEQUENCE__ATTRIBUTE__BEGIN).append(_attributeName).append(SEQUENCE__ATTRIBUTE__EQUALS)
					.append(_attributeValue).append(SEQUENCE__ATTRIBUTE__END);
		}
		buffer.append(SEQUENCE__TAG__END_OF_TAG);
		return buffer;
	}
540667
public static function tag($tag, $content = null, array $attributes = array())
    {
        return self::openTag($tag, $attributes) . $content . self::closeTag($tag);
    }
908213
public CreateApplicationRequest withTags(java.util.Map<String, String> tags) {
        setTags(tags);
        return this;
    }
1234295
public void reuse(Tag tag) {
	tag.release();
	Queue<Tag> queue = getQueue(tag.getClass().getName());
	queue.add(tag);
    }
994027
public static String getClosingTag(String tag)
	{
		StringBuffer _result = new StringBuffer();
		return doAppendClosingTag(_result, tag).toString();
	}
536866
private static void appendTag(String tag, StringBuilder buffer) {
        if (buffer.length() != 0) {
            buffer.append(UNDERSCORE);
        }

        buffer.append(tag);
    }
620273
protected void addTag(IcyTag tag)
	{
		tags.put(tag.getName(), tag);
		fireTagParsed(this, tag);
	}
356865
function (tag) {
                var
                    len = this._openedTags.length;
                if (len && this._openedTags[len - 1] === tag) {
                    this._openedTags.pop();
                    this._output("</" + tag + ">");
                } else {
                    this._openTag(tag);
                }
            }
872408
@SuppressWarnings("unchecked")
    public T addTag(String tag) {
        if (this.tags_ == null) {
            tags_ = new ArrayList<>();
        }
        this.tags_.add(tag);
        return (T) this;
    }
131348
static final String createTag(final String name) {
		if (name.length() <= MAX_TAG_LEN) {
			return name;
		}

		final char[] tag = name.toCharArray();
		final int arrayLen = tag.length;
		int len = 0;
		int mark = 0;

		for (int i = 0; i < arrayLen; i++, len++) {
			if (tag[i] == '.') {
				len = mark;

				if (tag[len] != '.') {
					len++;
				}

				mark = len;

				if (i + 1 < arrayLen && tag[i + 1] != '.') {
					mark++;
				}
			}

			tag[len] = tag[i];
		}

		if (len > MAX_TAG_LEN) {
			int i = 0;

			mark--;

			for (int j = 0; j < len; j++) {
				if (tag[j] == '.' && ((j != mark) || (i >= MAX_TAG_LEN - 1))) {
					continue;
				}

				tag[i++] = tag[j];
			}

			len = i;

			if (len > MAX_TAG_LEN) {
				len = MAX_TAG_LEN;
			}
		}

		return new String(tag, 0, len);
	}
213476
protected boolean hasReadElfTag(String tag) {
        String tagValue = getReadElfTag(tag);
        return (tagValue != null && !tagValue.isEmpty());
    }
442060
@SuppressWarnings("unchecked")
    public <T extends XPathBuilder> T setTag(final String tag) {
        this.tag = tag;
        return (T) this;
    }
43123
public function addTag($tag)
    {
        $this->tags[] = (string)$tag;
        $this->ref = null;
        return $this;
    }
62843
public CreateNewNoteIntentBuilder addTags(@Nullable ArrayList<String> tags) {
        ArrayList<String> list = mArgs.getStringArrayList(EvernoteIntent.EXTRA_TAG_NAME_LIST);
        if (list == null) {
            list = tags;

        } else if (tags != null) {
            list.addAll(tags);
        }

        return setTags(list);
    }