use of com.intellij.struts2.dom.struts.strutspackage.StrutsPackageHierarchyWalker in project intellij-plugins by JetBrains.
the class InterceptorRefResolveConverterImpl method fromString.
public InterceptorOrStackBase fromString(@Nullable @NonNls final String name, final ConvertContext context) {
if (name == null) {
return null;
}
final Condition<InterceptorOrStackBase> nameCondition = interceptorOrStackBase -> name.equals(interceptorOrStackBase.getName().getStringValue());
final Ref<InterceptorOrStackBase> resolveResult = new Ref<>();
final Processor<StrutsPackage> processor = strutsPackage -> {
final InterceptorOrStackBase result = ContainerUtil.find(getAllInterceptors(strutsPackage), nameCondition);
if (result != null) {
resolveResult.set(result);
return false;
}
return true;
};
final StrutsPackageHierarchyWalker walker = new StrutsPackageHierarchyWalker(ConverterUtil.getCurrentStrutsPackage(context), processor);
walker.walkUp();
return resolveResult.get();
}
use of com.intellij.struts2.dom.struts.strutspackage.StrutsPackageHierarchyWalker in project intellij-plugins by JetBrains.
the class ResultTypeResolvingConverterImpl method fromString.
public ResultType fromString(@Nullable @NonNls final String name, final ConvertContext context) {
if (StringUtil.isEmpty(name)) {
return null;
}
final Condition<ResultType> nameCondition = resultType -> Comparing.equal(name, resultType.getName().getStringValue());
final Ref<ResultType> resolveResult = new Ref<>();
final Processor<StrutsPackage> processor = strutsPackage -> {
final ResultType result = ContainerUtil.find(strutsPackage.getResultTypes(), nameCondition);
if (result != null) {
resolveResult.set(result);
return false;
}
return true;
};
final StrutsPackageHierarchyWalker walker = new StrutsPackageHierarchyWalker(ConverterUtil.getCurrentStrutsPackage(context), processor);
walker.walkUp();
return resolveResult.get();
}
use of com.intellij.struts2.dom.struts.strutspackage.StrutsPackageHierarchyWalker in project intellij-plugins by JetBrains.
the class DefaultInterceptorRefResolveConverterImpl method fromString.
public InterceptorStack fromString(@Nullable @NonNls final String name, final ConvertContext context) {
if (name == null) {
return null;
}
final Condition<InterceptorStack> nameCondition = interceptorStack -> name.equals(interceptorStack.getName().getStringValue());
final Ref<InterceptorStack> resolveResult = new Ref<>();
final Processor<StrutsPackage> processor = strutsPackage -> {
final InterceptorStack result = ContainerUtil.find(strutsPackage.getInterceptorStacks(), nameCondition);
if (result != null) {
resolveResult.set(result);
return false;
}
return true;
};
final StrutsPackageHierarchyWalker walker = new StrutsPackageHierarchyWalker(getCurrentStrutsPackage(context), processor);
walker.walkUp();
return resolveResult.get();
}
use of com.intellij.struts2.dom.struts.strutspackage.StrutsPackageHierarchyWalker in project intellij-plugins by JetBrains.
the class DefaultInterceptorRefResolveConverterImpl method getVariants.
@NotNull
public Collection<? extends InterceptorStack> getVariants(final ConvertContext context) {
final List<InterceptorStack> results = new SmartList<>();
final Processor<StrutsPackage> processor = strutsPackage -> {
results.addAll(strutsPackage.getInterceptorStacks());
return true;
};
final StrutsPackageHierarchyWalker walker = new StrutsPackageHierarchyWalker(getCurrentStrutsPackage(context), processor);
walker.walkUp();
return results;
}
use of com.intellij.struts2.dom.struts.strutspackage.StrutsPackageHierarchyWalker in project intellij-plugins by JetBrains.
the class InterceptorRefResolveConverterImpl method getVariants.
@NotNull
public Collection<? extends InterceptorOrStackBase> getVariants(final ConvertContext context) {
final List<InterceptorOrStackBase> results = new SmartList<>();
final Processor<StrutsPackage> processor = strutsPackage -> {
final List<InterceptorOrStackBase> allInterceptors = getAllInterceptors(strutsPackage);
results.addAll(allInterceptors);
return true;
};
final StrutsPackageHierarchyWalker walker = new StrutsPackageHierarchyWalker(ConverterUtil.getCurrentStrutsPackage(context), processor);
walker.walkUp();
return results;
}
Aggregations