public TemplateParameterDefinition checkAdd( DesignElement content, int slotID ) throws ContentException
public void checkAdd( DesignElement content, int slotID ) throws ContentException
	public TemplateParameterDefinition checkAdd( DesignElement content,			int slotID ) throws ContentException	{		// if this element is a template element, check the template parameter		// definition and add it first if the definition is not defined in the		if ( content instanceof TemplateElement )		{			ElementRefValue templateParam = (ElementRefValue) content					.getProperty( module,							DesignElement.REF_TEMPLATE_PARAMETER_PROP );			if ( templateParam == null )			{				throw new ContentException(						element,						slotID,						content,						ContentException.DESIGN_EXCEPTION_INVALID_TEMPLATE_ELEMENT );			}			else if ( templateParam.getElement( ) == null )			{				// try to resolve the unresolved value and finally the referred				// template definition does not exsit in the module, fire an				// error				// ElementRefValue refValue =				// resolveTemplateParameterDefinition(				// module, templateParam.getName( ) );				TemplateParameterDefinition templateDefn = resolveTemplateParameterDefinition(						module, templateParam.getName( ) );				if ( templateDefn == null )				{					throw new ContentException(							element,							slotID,							content,							ContentException.DESIGN_EXCEPTION_INVALID_TEMPLATE_ELEMENT );				}			}			else			{				// the template parameter reference is resolved and the				// definition is not inserted to the module, then clone it and				// add the cloned definition into module				TemplateParameterDefinition definition = (TemplateParameterDefinition) templateParam						.getElement( );				if ( module.findTemplateParameterDefinition( templateParam						.getName( ) ) != definition )				{					try					{						definition = (TemplateParameterDefinition) definition								.clone( );					}					catch ( CloneNotSupportedException e )					{						assert false;					}					module.makeUniqueName( definition );					return definition;				}			}		}		return null;	}