private Class<?> findAndRemoveRemoveFromMethod( final List<Facet> collectionFacets, final MethodRemover methodRemover, final Class<?> cls, final Method getMethod, final String capitalizedName, final FacetHolder collection) { final Method method = findMethod(cls, OBJECT, REMOVE_FROM_PREFIX + capitalizedName, void.class); removeMethod(methodRemover, method); final Class<?> removeType = (method == null || method.getParameterTypes().length != 1) ? null : method.getParameterTypes()[0]; if (method != null) { collectionFacets.add(new CollectionRemoveFromFacetViaMethod(method, collection)); } else { // TODO need to distinguish between Java collections, arrays and other collections! collectionFacets.add(new CollectionRemoveFromFacetViaAccessor(getMethod, collection, getRuntimeContext())); } return removeType; }
private Class<?> findAndRemoveRemoveFromMethod( final List<Facet> collectionFacets, final MethodRemover methodRemover, final Class<?> cls, final Method getMethod, final String capitalizedName, final FacetHolder collection) { final Method method = findMethod(cls, OBJECT, REMOVE_FROM_PREFIX + capitalizedName, void.class); removeMethod(methodRemover, method); final Class<?> removeType = (method == null || method.getParameterTypes().length != 1) ? null : method .getParameterTypes()[0]; if (method != null) { collectionFacets.add(new CollectionRemoveFromFacetViaMethod(method, collection)); } else { // TODO need to distinguish between Java collections, arrays and other collections! collectionFacets.add(new CollectionRemoveFromFacetViaAccessor(getMethod, collection, getRuntimeContext())); } return removeType; }