001package io.jstach.opt.spring;
002
003import java.util.List;
004
005import io.jstach.jstachio.spi.AbstractJStachio;
006import io.jstach.jstachio.spi.JStachioExtension;
007import io.jstach.jstachio.spi.JStachioExtensions;
008
009/**
010 * A JStachio that does not use the service loader.
011 *
012 * @author agentgt
013 */
014public class SpringJStachio extends AbstractJStachio {
015
016        private final JStachioExtensions extensions;
017
018        /**
019         * Passed the found services usually injected by Spring.
020         * @param extensions not null.
021         */
022        public SpringJStachio(List<JStachioExtension> extensions) {
023                this.extensions = JStachioExtensions.of(extensions);
024        }
025
026        @Override
027        public JStachioExtensions extensions() {
028                return this.extensions;
029        }
030
031}