Registers a tag class.

@param id  ID of the tag.
@param tag Tag class to register.
@throws TagRegisterException If an error occurs while registering the tag.
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);
    }
673783
private static void register(String className) {
        if (!TextUtils.isEmpty(className)) {
            try {
                Class<?> clazz = Class.forName(className);
                Object obj = clazz.getConstructor().newInstance();
                if (obj instanceof IRouteRoot) {
                    registerRouteRoot((IRouteRoot) obj);
                } else if (obj instanceof IProviderGroup) {
                    registerProvider((IProviderGroup) obj);
                } else if (obj instanceof IInterceptorGroup) {
                    registerInterceptor((IInterceptorGroup) obj);
                } else {
                    logger.info(TAG, "register failed, class name: " + className
                            + " should implements one of IRouteRoot/IProviderGroup/IInterceptorGroup.");
                }
            } catch (Exception e) {
                logger.error(TAG,"register class error:" + className);
            }
        }
    }
773075
public void registerObject(final Object object, final UUID id) {
        objectToId.put(object, id);
        idToObject.put(id, object);
    }
378681
@com.fasterxml.jackson.annotation.JsonProperty("registryId")
    public void setRegistryId(String registryId) {
        this.registryId = registryId;
    }
1333822
public void registerBlueprint(String className) throws RegisterBlueprintException {
        try {
            registerBlueprint(Class.forName(className));
        } catch (ClassNotFoundException e) {
            throw new RegisterBlueprintException(e);
        }
    }
935503
private synchronized void addToMap(Class clazz, byte id) {
    if (classToIdMap.containsKey(clazz)) {
      byte b = classToIdMap.get(clazz);
      if (b != id) {
        throw new IllegalArgumentException ("Class " + clazz.getName() +
          " already registered but maps to " + b + " and not " + id);
      }
    }
    if (idToClassMap.containsKey(id)) {
      Class c = idToClassMap.get(id);
      if (!c.equals(clazz)) {
        throw new IllegalArgumentException("Id " + id + " exists but maps to " +
            c.getName() + " and not " + clazz.getName());
      }
    }
    classToIdMap.put(clazz, id);
    idToClassMap.put(id, clazz);
  }
152777
protected void appendInputTag(String tag) {
        final TagView previousInputTag = getInputTag();
        if (previousInputTag != null) {
            throw new IllegalStateException("Already has a INPUT tag in group.");
        }

        final TagView newInputTag = new TagView(getContext(), TagView.STATE_INPUT, tag);
        newInputTag.setOnClickListener(mInternalTagClickListener);
        addView(newInputTag);
    }
661873
public void setTags(java.util.Collection<String> tags) {
        if (tags == null) {
            this.tags = null;
            return;
        }

        this.tags = new java.util.ArrayList<String>(tags);
    }
1234295
public void reuse(Tag tag) {
	tag.release();
	Queue<Tag> queue = getQueue(tag.getClass().getName());
	queue.add(tag);
    }
771781
public void setTags(java.util.Collection<TagListEntry> tags) {
        if (tags == null) {
            this.tags = null;
            return;
        }

        this.tags = new java.util.ArrayList<TagListEntry>(tags);
    }
1352751
@SuppressWarnings("unchecked")
	public T tag(final String tag) {
		if (this.tags == null) {
			this.tags = new HashSet<>();
		}

		this.tags.add(tag);
		return (T) this;
	}
1047459
public void addTag(Tag tag) {
    set(PackageMetadata.TAGS, concat(getTags(), singletonList(tag)));
  }
17286
public void setTags( Collection<String> tags ) {

		synchronized( this.tags ) {
			this.tags.clear();
			if( tags != null )
				this.tags.addAll( tags );
		}
	}
212846
public static void register(Map<String, Taglet> tagletMap) {
        InlineTaglet tag = new InlineTaglet();
        tagletMap.put(tag.getName(), tag);
    }
743785
public Tag use(String className, String tagBundleName, String tagBundleVersion, Identification id) throws PageException {
	Queue<Tag> queue = getQueue(toId(className, tagBundleName, tagBundleVersion));
	Tag tag = queue.poll();
	if (tag != null) return tag;
	return loadTag(className, tagBundleName, tagBundleVersion, id);
    }
620273
protected void addTag(IcyTag tag)
	{
		tags.put(tag.getName(), tag);
		fireTagParsed(this, tag);
	}
539599
protected final void applyTagId(AbstractHtmlState state, String tagId)
        throws JspException {
        state.id = generateTagId(tagId);
    }