package org.zwobble.mammoth.tests.docx; import com.natpryce.makeiteasy.Instantiator; import com.natpryce.makeiteasy.Property; import org.zwobble.mammoth.internal.docx.*; import java.io.IOException; import java.io.InputStream; import java.util.Optional; import static com.natpryce.makeiteasy.Property.newProperty; public class BodyXmlReaderMakers { public static final Property STYLES = newProperty(); public static final Property NUMBERING = newProperty(); public static final Property RELATIONSHIPS = newProperty(); public static final Property CONTENT_TYPES = newProperty(); public static final Property DOCX_FILE = newProperty(); public static final Property FILE_READER = newProperty(); public static final Instantiator bodyReader = propertyLookup -> new BodyXmlReader( propertyLookup.valueOf(STYLES, Styles.EMPTY), propertyLookup.valueOf(NUMBERING, Numbering.EMPTY), propertyLookup.valueOf(RELATIONSHIPS, Relationships.EMPTY), propertyLookup.valueOf(CONTENT_TYPES, ContentTypes.DEFAULT), propertyLookup.valueOf(DOCX_FILE, new DocxFile() { @Override public Optional tryGetInputStream(String name) throws IOException { throw new UnsupportedOperationException(); } @Override public void close() throws IOException { } }), propertyLookup.valueOf(FILE_READER, new FileReader() { @Override public InputStream getInputStream(String uri) throws IOException { throw new UnsupportedOperationException(); } })); }