* Updates {@link HtmlEntry}s that correspond to the previously known and new Angular application
* information.
*/
private void recordAngularEntryPoint(HtmlEntryImpl entry, ResolveAngularEntryHtmlTask task)
throws AnalysisException {
AngularApplication application = task.getApplication();
if (application != null) {
angularApplications.add(application);
// if this is an entry point, then we already resolved it
entry.setValue(HtmlEntry.ANGULAR_ERRORS, task.getEntryErrors());
// schedule HTML templates analysis
AngularElement[] newAngularElements = application.getElements();
for (AngularElement angularElement : newAngularElements) {
if (angularElement instanceof AngularHasTemplateElement) {
AngularHasTemplateElement hasTemplate = (AngularHasTemplateElement) angularElement;
Source templateSource = hasTemplate.getTemplateSource();
if (templateSource != null) {
HtmlEntry htmlEntry = getReadableHtmlEntry(templateSource);
HtmlEntryImpl htmlCopy = htmlEntry.getWritableCopy();
htmlCopy.setValue(HtmlEntry.ANGULAR_APPLICATION, application);
if (hasTemplate instanceof AngularComponentElement) {
AngularComponentElement component = (AngularComponentElement) hasTemplate;
htmlCopy.setValue(HtmlEntry.ANGULAR_COMPONENT, component);
}
htmlCopy.setState(HtmlEntry.ANGULAR_ERRORS, CacheState.INVALID);
cache.put(templateSource, htmlCopy);
workManager.add(templateSource, SourcePriority.HTML);
}
}
}
// update Dart sources errors
Source[] newElementSources = application.getElementSources();
for (Source elementSource : newElementSources) {
DartEntry dartEntry = getReadableDartEntry(elementSource);
DartEntryImpl dartCopy = dartEntry.getWritableCopy();
dartCopy.setValue(DartEntry.ANGULAR_ERRORS, task.getErrors(elementSource));
cache.put(elementSource, dartCopy);