public MethodParameterInjection copyFrom(@NotNull BaseInjection o) { super.copyFrom(o); if (o instanceof MethodParameterInjection) { final MethodParameterInjection other = (MethodParameterInjection) o; myClassName = other.getClassName(); myParameterMap.clear(); for (MethodInfo info : other.myParameterMap.values()) { myParameterMap.put(info.methodSignature, info.copy()); } } return this; }
@NotNull public String getDisplayName() { final String className = getClassName(); if (StringUtil.isEmpty(className)) return "<unnamed>"; MethodInfo singleInfo = null; for (MethodInfo info : myParameterMap.values()) { if (info.isEnabled()) { if (singleInfo == null) { singleInfo = info; } else { singleInfo = null; break; } } } final String name = singleInfo != null ? StringUtil.getShortName(className) + "." + singleInfo.methodName : StringUtil.getShortName(className); return /*"["+getInjectedLanguageId()+"] " +*/ name + " (" + StringUtil.getPackageName(className) + ")"; }
public void setMethodInfos(final Collection<MethodInfo> newInfos) { myParameterMap.clear(); for (MethodInfo methodInfo : newInfos) { myParameterMap.put(methodInfo.getMethodSignature(), methodInfo); } }