Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 335439 - optional or required parameters in queries
Summary: optional or required parameters in queries
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EMF-Facet (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-26 07:42 EST by Missing name CLA
Modified: 2020-05-01 11:27 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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