Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 335439

Summary: optional or required parameters in queries
Product: z_Archived Reporter: Missing name <trostren>
Component: EMF-FacetAssignee: Project Inbox <emft.facet-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3 CC: gdupe, nicolas.bros
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Missing name CLA 2011-01-26 07:42:43 EST
Build Identifier: 

i am writing a java query that needs a parameter (ex : stereotypeName).

public class isStereotyped implements IJavaModelQuery<Element, Boolean> {

       public Boolean evaluate(Element context, ParameterValueList
parameterValues) throws ModelQueryExecutionException {
               String stereotypeName ="";
               if(parameterValues.getParameterValueByName("stereotypeName") ==
null ){
                       //TODO what must i do ?
               }else {
                       stereotypeName  =
(String)parameterValues.getParameterValueByName("stereotypeName").getValue
();
               }
               ....

how will the query user know that the query needs a parameter ?

i think queries need to specify if they have parameters and if the parameters are mandatory or optionnal.

must i throw an IllegalArgumentException, ModelQueryException or ModelQueryExecutionException ?

        

Reproducible: Always