@Override @NotNull public List<? extends DomElement> getValues(@NotNull final DomElement element) { final List<DomElement> result = new SmartList<DomElement>(); final DomInvocationHandler handler = DomManagerImpl.getDomInvocationHandler(element); if (handler != null) { for (int i = 0; i < myCount; i++) { result.add(handler.getFixedChild(Pair.create(this, i)).getProxy()); } } else { for (Collection<JavaMethod> methods : myGetterMethods) { if (methods != null && !methods.isEmpty()) { result.add((DomElement)methods.iterator().next().invoke(element, ArrayUtil.EMPTY_OBJECT_ARRAY)); } } } return result; }
@NotNull public List<? extends DomElement> getValues(@NotNull final DomElement element) { final List<DomElement> result = new SmartList<DomElement>(); final DomInvocationHandler handler = DomManagerImpl.getDomInvocationHandler(element); if (handler != null) { for (int i = 0; i < myCount; i++) { result.add(handler.getFixedChild(Pair.create(this, i)).getProxy()); } } else { for (Collection<JavaMethod> methods : myGetterMethods) { if (methods != null && !methods.isEmpty()) { result.add((DomElement)methods.iterator().next().invoke(element, ArrayUtil.EMPTY_OBJECT_ARRAY)); } } } return result; }
@Override public JavaMethod getGetterMethod(int index) { if (myGetterMethods.length == 0) return null; final Collection<JavaMethod> methods = myGetterMethods[index]; return methods == null || methods.isEmpty() ? null : methods.iterator().next(); }
public FixedChildDescriptionImpl(final XmlName tagName, final Type type, final int count, final Collection<JavaMethod>[] getterMethods) { super(tagName, type); assert getterMethods.length == count || getterMethods == ArrayUtil.EMPTY_COLLECTION_ARRAY; myCount = count; myGetterMethods = getterMethods; }
@Override public Invocation createInvocation(final JavaMethod method) { return myStaticGenericInfo.createInvocation(method); }
@Nullable public abstract Invocation createInvocation(final JavaMethod method);
public PropertyAccessorInvocation(final JavaMethod[] methods) { myMethods = methods; myLastElement = myMethods.length - 1; }
@Nullable JavaMethod getGetterMethod();
public JavaMethod getGetterMethod(int index) { if (myGetterMethods.length == 0) return null; final Collection<JavaMethod> methods = myGetterMethods[index]; return methods == null || methods.isEmpty() ? null : methods.iterator().next(); }
public Invocation createInvocation(final JavaMethod method) { return myStaticGenericInfo.createInvocation(method); }
JavaMethod getGetterMethod(int index);