throw new ContentException( element, slotID, content, ContentException.DESIGN_EXCEPTION_INVALID_TEMPLATE_ELEMENT );
if ( content instanceof TemplateElement ) throw new ContentException( element, slotID, content, ContentException.DESIGN_EXCEPTION_INVALID_TEMPLATE_ELEMENT );     else { try { PropertyCommand cmd = new PropertyCommand( module, content ); cmd .clearProperty( IDesignElementModel.REF_TEMPLATE_PARAMETER_PROP ); } catch ( SemanticException e ) { assert false; } return; } } else if ( !( content instanceof TemplateElement ) ) { try { if ( needClearParameterDefinition( content, templateParam .getName( ) ) ) { PropertyCommand cmd = new PropertyCommand( module, content ); cmd .clearProperty( IDesignElementModel.REF_TEMPLATE_PARAMETER_PROP ); } } catch ( SemanticException e ) { assert false; } return;
	private void addTemplateParameterDefinition( Object obj,			DesignElement content, int slotID ) throws ContentException	{		ElementRefValue templateParam = (ElementRefValue) obj;		if ( templateParam == null || templateParam.getElement( ) == null )		{			throw new ContentException( element, slotID, content,					ContentException.DESIGN_EXCEPTION_INVALID_TEMPLATE_ELEMENT );		}		if ( !templateParam.isResolved( ) )		{			return;		}		TemplateParameterDefinition definition = (TemplateParameterDefinition) templateParam				.getElement( );		if ( module.findTemplateParameterDefinition( templateParam.getName( ) ) != definition )		{			try			{				DesignElement copyTemplateParam = ModelUtil						.getCopy( definition );				module.makeUniqueName( copyTemplateParam );				ContentCommand cmd = new ContentCommand( module, module );				cmd.add( copyTemplateParam,						ReportDesign.TEMPLATE_PARAMETER_DEFINITION_SLOT );				PropertyCommand propertyCmd = new PropertyCommand( module,						content );				propertyCmd.setProperty(						TemplateElement.REF_TEMPLATE_PARAMETER_PROP,						copyTemplateParam );			}			catch ( NameException e )			{				assert false;			}			catch ( SemanticException e )			{				assert false;			}		}	}