/** * @param root the root for the invisit * @return recursive invisit of all components included in the root component; includes the root * and all intermediate nodes. Annotations and other groups of elements will be * represented as streams or collections, same as if the accessor method on the object * was used. */ public static Stream<?> allComponents(HasComponents root) { List<Stream<?>> streams = new ArrayList<>(); streams.add(Stream.of(root)); root.components().forEach(o -> flat(root, streams, o)); return streams.stream().flatMap(Function.identity()); }
/** * @param root the root for the invisit * @return recursive invisit of all components included in the root component; includes the root * and all intermediate nodes. Annotations and other groups of elements will be * represented as streams or collections, same as if the accessor method on the object * was used. */ public static Stream<?> allComponents(HasComponents root) { List<Stream<?>> streams = new ArrayList<>(); streams.add(Stream.of(root)); root.components().forEach(o -> flat(root, streams, o)); return streams.stream().flatMap(Function.identity()); }
/** * @param root the root for the invisit * @return recursive invisit of all components included in the root component; includes the root * and all intermediate nodes. Annotations and other groups of elements will be * represented as streams or collections, same as if the accessor method on the object * was used. */ public static Stream<?> allComponents(HasComponents root) { List<Stream<?>> streams = new ArrayList<>(); streams.add(Stream.of(root)); root.components().forEach(o -> flat(root, streams, o)); return streams.stream().flatMap(Function.identity()); }