ElementDefn contentDefn = (ElementDefn) content.getDefn( );
	protected boolean addToSlot( DesignElement container, int slotID,			DesignElement content )	{		ElementDefn containerDefn = (ElementDefn) container.getDefn( );		ElementDefn contentDefn = (ElementDefn) content.getDefn( );		// The following conditions should not occur in the parser --		// they indicate parser design errors since they can be prevented		// with the right syntax checks.		assert containerDefn.isContainer( );		SlotDefn slotInfo = (SlotDefn) containerDefn.getSlot( slotID );		assert slotInfo != null;		assert slotInfo.canContain( content );		// Can not change the structure of an element if it is a child element		// or it is within a child element.		if ( container.getExtendsElement( ) != null )		{			handler					.getErrorHandler( )					.semanticWarning(							new ContentException(									container,									slotID,									content,									ContentException.DESIGN_EXCEPTION_STRUCTURE_CHANGE_FORBIDDEN ) );			return false;		}		// If this is a single-item slot, ensure that the slot is empty.		if ( !slotInfo.isMultipleCardinality( )				&& container.getSlot( slotID ).getCount( ) > 0 )		{			handler.getErrorHandler( ).semanticError(					new ContentException( container, slotID,							ContentException.DESIGN_EXCEPTION_SLOT_IS_FULL ) );			return false;		}		// The name should not be null if it is required. The parser state		// should have already caught this case.		addToNamespace( content );		Module module = handler.getModule( );		// Add the item to the element ID map, check whether the id is unique		// if the element has no ID, we will allocate it in the endDocument		long elementID = content.getID( );		if ( elementID > 0 )		{			DesignElement element = module.getElementByID( elementID );			// the content never add to the container before			assert element != content;			if ( element == null )				module.addElementID( content );			else			{				handler						.getErrorHandler( )						.semanticError(								new DesignParserException(										new String[]{content.getIdentifier( ),												element.getIdentifier( )},										DesignParserException.DESIGN_EXCEPTION_DUPLICATE_ELEMENT_ID ) );				return false;			}		}		// Add the item to the container.		container.getSlot( slotID ).add( content );		// Cache the inverse relationship.		content.setContainer( container, slotID );		return true;	}