void registerId(final WComponent component) {
		if (!WebUtilities.isActiveNamingContext(this)) {
			throw new SystemException("Can only register a component on an active NamingContext");
		}

		// Get registered id names
		ComponentModel model = getOrCreateComponentModel();
		Map<String, WComponent> ids = model.getContextIds();
		if (ids == null) {
			ids = new HashMap<>();
			model.setContextIds(ids);
		}

		// Get id name
		String idName = component.getIdName();

		// Check if already used
		WComponent mapped = ids.get(idName);

		// Not in map
		if (mapped == null) {
			// Save ID / Component
			ids.put(idName, component);
		} else if (mapped != component) { // Check is same component
			String contextName = getId();
			throw new SystemException("Duplicate ID. ID \"" + idName + "\" for " + component.
					getClass().getName()
					+ " is already in use by " + mapped.getClass().getName() + " in context \"" + contextName + "\".");
		}

	}
void registerId ( final WComponent component ) { if ( ! WebUtilities . isActiveNamingContext ( this ) ) { throw new SystemException ( "Can only register a component on an active NamingContext" ) ; } ComponentModel model = getOrCreateComponentModel ( ) ; Map < String , WComponent > ids = model . getContextIds ( ) ; if ( ids == null ) { ids = new HashMap < > ( ) ; model . setContextIds ( ids ) ; } String idName = component . getIdName ( ) ; WComponent mapped = ids . get ( idName ) ; if ( mapped == null ) { ids . put ( idName , component ) ; } else if ( mapped != component ) { String contextName = getId ( ) ; throw new SystemException ( "Duplicate ID. ID \"" + idName + "\" for " + component . getClass ( ) . getName ( ) + " is already in use by " + mapped . getClass ( ) . getName ( ) + " in context \"" + contextName + "\"." ) ; } }
Helper method to be used by a {@link NamingContextable} to register a component.

@param component the component to register