Lines 99-114
Link Here
|
99 |
class RestScanTask { |
99 |
class RestScanTask { |
100 |
|
100 |
|
101 |
RestScanTask( RestConfigurationEditorAwareTaskFactory factory, |
101 |
RestScanTask( RestConfigurationEditorAwareTaskFactory factory, |
102 |
FileObject fileObject, CompilationInfo info ) |
102 |
FileObject fileObject) |
103 |
{ |
103 |
{ |
104 |
this.factory = factory; |
104 |
this.factory = factory; |
105 |
this.fileObject = fileObject; |
105 |
this.fileObject = fileObject; |
106 |
this.info = info; |
|
|
107 |
hints = new LinkedList<ErrorDescription>(); |
106 |
hints = new LinkedList<ErrorDescription>(); |
108 |
stop = new AtomicBoolean( false ); |
107 |
stop = new AtomicBoolean( false ); |
109 |
} |
108 |
} |
110 |
|
109 |
|
111 |
void run(){ |
110 |
void run(CompilationInfo info){ |
112 |
Project project = FileOwnerQuery.getOwner(fileObject); |
111 |
Project project = FileOwnerQuery.getOwner(fileObject); |
113 |
if ( project == null ){ |
112 |
if ( project == null ){ |
114 |
return; |
113 |
return; |
Lines 132-141
Link Here
|
132 |
} |
131 |
} |
133 |
} |
132 |
} |
134 |
if (needConfiguration) { |
133 |
if (needConfiguration) { |
135 |
configureRest(project, support); |
134 |
configureRest(project, support, info); |
136 |
} |
135 |
} |
137 |
else { |
136 |
else { |
138 |
checkApplicationConfiguration(project, support); |
137 |
checkApplicationConfiguration(project, support, info); |
139 |
} |
138 |
} |
140 |
} |
139 |
} |
141 |
catch(IOException e ){ |
140 |
catch(IOException e ){ |
Lines 158-171
Link Here
|
158 |
} |
157 |
} |
159 |
|
158 |
|
160 |
private void checkApplicationConfiguration( Project project, |
159 |
private void checkApplicationConfiguration( Project project, |
161 |
WebRestSupport support ) throws MetadataModelException,IOException, |
160 |
WebRestSupport support, CompilationInfo info ) throws MetadataModelException,IOException, |
162 |
InterruptedException, ExecutionException |
161 |
InterruptedException, ExecutionException |
163 |
{ |
162 |
{ |
164 |
List<RestApplication> applications = support.getRestApplications(); |
163 |
List<RestApplication> applications = support.getRestApplications(); |
165 |
if ( applications.isEmpty() ){ |
164 |
if ( applications.isEmpty() ){ |
166 |
return; |
165 |
return; |
167 |
} |
166 |
} |
168 |
List<TypeElement> restResources = getRestResources(support); |
167 |
List<TypeElement> restResources = getRestResources(support, info); |
169 |
for (TypeElement typeElement : restResources) { |
168 |
for (TypeElement typeElement : restResources) { |
170 |
String fqn = typeElement.getQualifiedName().toString(); |
169 |
String fqn = typeElement.getQualifiedName().toString(); |
171 |
if ( !support.hasApplicationResourceClass(fqn ) ){ |
170 |
if ( !support.hasApplicationResourceClass(fqn ) ){ |
Lines 187-197
Link Here
|
187 |
} |
186 |
} |
188 |
} |
187 |
} |
189 |
|
188 |
|
190 |
private void configureRest( Project project, WebRestSupport support ) |
189 |
private void configureRest( Project project, WebRestSupport support, CompilationInfo info ) |
191 |
throws MetadataModelException,IOException, |
190 |
throws MetadataModelException,IOException, |
192 |
InterruptedException, ExecutionException |
191 |
InterruptedException, ExecutionException |
193 |
{ |
192 |
{ |
194 |
List<TypeElement> rest = getRestResources(support); |
193 |
List<TypeElement> rest = getRestResources(support, info); |
195 |
if ( rest.isEmpty() ){ |
194 |
if ( rest.isEmpty() ){ |
196 |
return; |
195 |
return; |
197 |
} |
196 |
} |
Lines 209-215
Link Here
|
209 |
hints.add(description); |
208 |
hints.add(description); |
210 |
} |
209 |
} |
211 |
|
210 |
|
212 |
private List<TypeElement> getRestResources(WebRestSupport support) |
211 |
private List<TypeElement> getRestResources(WebRestSupport support, CompilationInfo info) |
213 |
throws MetadataModelException,IOException, |
212 |
throws MetadataModelException,IOException, |
214 |
InterruptedException, ExecutionException |
213 |
InterruptedException, ExecutionException |
215 |
{ |
214 |
{ |
Lines 309-315
Link Here
|
309 |
|
308 |
|
310 |
private FileObject fileObject; |
309 |
private FileObject fileObject; |
311 |
private RestConfigurationEditorAwareTaskFactory factory; |
310 |
private RestConfigurationEditorAwareTaskFactory factory; |
312 |
private CompilationInfo info; |
|
|
313 |
private List<ErrorDescription> hints; |
311 |
private List<ErrorDescription> hints; |
314 |
private AtomicBoolean stop; |
312 |
private AtomicBoolean stop; |
315 |
} |
313 |
} |