use of com.intellij.struts2.dom.struts.strutspackage.StrutsPackage in project intellij-plugins by JetBrains.
the class GlobalResultImpl method getEffectiveResultType.
@Nullable
public ResultType getEffectiveResultType() {
final ResultType resultType = getType().getValue();
if (resultType != null) {
return resultType;
}
final StrutsPackage strutsPackage = getParentOfType(StrutsPackage.class, true);
return strutsPackage != null ? strutsPackage.searchDefaultResultType() : null;
}
use of com.intellij.struts2.dom.struts.strutspackage.StrutsPackage 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;
}
use of com.intellij.struts2.dom.struts.strutspackage.StrutsPackage in project intellij-plugins by JetBrains.
the class ResultImpl method getEffectiveResultType.
@Nullable
public ResultType getEffectiveResultType() {
final GenericAttributeValue<ResultType> typeAttribute = getType();
if (DomUtil.hasXml(typeAttribute)) {
return typeAttribute.getValue();
}
final StrutsPackage strutsPackage = getParentOfType(StrutsPackage.class, true);
return strutsPackage != null ? strutsPackage.searchDefaultResultType() : null;
}
use of com.intellij.struts2.dom.struts.strutspackage.StrutsPackage in project intellij-plugins by JetBrains.
the class ResultTypeResolvingConverterImpl method getVariants.
@NotNull
public Collection<? extends ResultType> getVariants(final ConvertContext context) {
final List<ResultType> results = new SmartList<>();
final Processor<StrutsPackage> processor = strutsPackage -> {
results.addAll(strutsPackage.getResultTypes());
return true;
};
final StrutsPackageHierarchyWalker walker = new StrutsPackageHierarchyWalker(ConverterUtil.getCurrentStrutsPackage(context), processor);
walker.walkUp();
return results;
}
use of com.intellij.struts2.dom.struts.strutspackage.StrutsPackage in project intellij-plugins by JetBrains.
the class StrutsPackageImpl method searchNamespace.
@NotNull
public String searchNamespace() {
final Ref<String> result = new Ref<>();
final StrutsPackageHierarchyWalker walker = new StrutsPackageHierarchyWalker(this, strutsPackage -> {
if (DomUtil.hasXml(strutsPackage.getNamespace())) {
result.set(strutsPackage.getNamespace().getStringValue());
return false;
}
return true;
});
walker.walkUp();
return result.isNull() ? DEFAULT_NAMESPACE : result.get();
}
Aggregations