// FIXME: make this configurable
private void initializeFop2x(XProcRuntime runtime, XStep step, Properties options) {
        Object fopFactoryBuilder = null;
        Constructor factBuilderConstructor = null;
        try {
            factBuilderConstructor = klass.getConstructor(URI.class);
        } catch (NoSuchMethodException nsme) {
            // nop;
        }
        resolver = runtime.getResolver();
        URI baseURI = step.getStep().getNode().getBaseURI();
        String s = getStringProp("BaseURL");
        if (s != null) {
            baseURI = baseURI.resolve(s);
        }
        try {
            if (resolver == null) {
                fopFactoryBuilder = factBuilderConstructor.newInstance(baseURI);
            } else {
                // FIXME: make an org.apache.xmlgraphics.io.ResourceResolver resolver!?
                fopFactoryBuilder = factBuilderConstructor.newInstance(baseURI);
            }
            Class fclass = fopFactoryBuilder.getClass();
            // FIXME: make this configurable
            Boolean b = false;
            /* Why doesn't this call work with reflection?
            method = fclass.getMethod("setStrictFOValidation", Boolean.class);
            method.invoke(fopFactoryBuilder, b);
            */
            b = getBooleanProp("BreakIndentInheritanceOnReferenceAreaBoundary");
            if (b != null) {
                method = fclass.getMethod("setBreakIndentInheritanceOnReferenceAreaBoundary", Boolean.class);
                method.invoke(fopFactoryBuilder, b);
            }
            Float f = getFloatProp("SourceResolution");
            if (f != null) {
                method = fclass.getMethod("setSourceResolution", Float.class);
                method.invoke(fopFactoryBuilder, f);
            }
            /* FIXME:
            s = getStringProp("FontBaseURL");
            if (s != null) {
                fopFactory.getFontManager().setFontBaseURL(s);
            }
            */
            b = getBooleanProp("Base14KerningEnabled");
            if (b != null) {
                Method getFontManager = fclass.getMethod("getFontManager");
                Object fontManager = getFontManager.invoke(fopFactoryBuilder);
                method = fontManager.getClass().getMethod("setBase14KerningEnabled", Boolean.class);
                method.invoke(fontManager, b);
            }
            /* FIXME:
            s = getStringProp("HyphenBaseURL");
            if (s != null) {
                fopFactory.setHyphenBaseURL(s);
            }
            */
            s = getStringProp("PageHeight");
            if (s != null) {
                method = fclass.getMethod("setPageHeight", String.class);
                method.invoke(fopFactoryBuilder, s);
            }
            s = getStringProp("PageWidth");
            if (s != null) {
                method = fclass.getMethod("setPageWidth", String.class);
                method.invoke(fopFactoryBuilder, s);
            }
            f = getFloatProp("TargetResolution");
            if (f != null) {
                method = fclass.getMethod("setTargetResolution", Float.class);
                method.invoke(fopFactoryBuilder, f);
            }
            b = getBooleanProp("StrictUserConfigValidation");
            if (b != null) {
                method = fclass.getMethod("setStrictUserConfigValidation", Boolean.class);
                method.invoke(fopFactoryBuilder, b);
            }
            b = getBooleanProp("StrictValidation");
            if (b != null) {
                method = fclass.getMethod("setStrictUserConfigValidation", Boolean.class);
                method.invoke(fopFactoryBuilder, b);
            }
            b = getBooleanProp("UseCache");
            if (b != null && !b) {
                Method getFontManager = fclass.getMethod("getFontManager");
                Object fontManager = getFontManager.invoke(fopFactoryBuilder);
                method = fontManager.getClass().getMethod("disableFontCache");
                method.invoke(fontManager);
            }
            /* FIXME:
            s = getStringProp("UserConfig");
            if (s != null) {
                fopFactory.setUserConfig(s);
            }
            */
            method = fclass.getMethod("build");
            fopFactory = method.invoke(fopFactoryBuilder);
        } catch (Exception e) {
            throw new XProcException(e);
        }
    }
}
Class fclass = fopFactoryBuilder.getClass();
// FIXME: make this configurable
Boolean b = false;
/* Why doesn't this call work with reflection?
baseURI = baseURI.resolve(s);
}
try {
if (resolver == null) {
fopFactoryBuilder = factBuilderConstructor.newInstance(baseURI);
} else {
// FIXME: make an org.apache.xmlgraphics.io.ResourceResolver resolver!?
fopFactoryBuilder = factBuilderConstructor.newInstance(baseURI);
}
Class fclass = fopFactoryBuilder.getClass();
// FIXME: make this configurable
Boolean b = false;
/* Why doesn't this call work with reflection?
method = fclass.getMethod("setStrictFOValidation", Boolean.class);
method.invoke(fopFactoryBuilder, b);
*/
b = getBooleanProp("BreakIndentInheritanceOnReferenceAreaBoundary");
if (b != null) {
method = fclass.getMethod("setBreakIndentInheritanceOnReferenceAreaBoundary", Boolean.class);
method.invoke(fopFactoryBuilder, b);
}
Constructor factBuilderConstructor = null;
try {
factBuilderConstructor = klass.getConstructor(URI.class);
} catch (NoSuchMethodException nsme) {
// nop;
}
resolver = runtime.getResolver();
URI baseURI = step.getStep().getNode().getBaseURI();
String s = getStringProp("BaseURL");
if (s != null) {
baseURI = baseURI.resolve(s);
}
try {
if (resolver == null) {
fopFactoryBuilder = factBuilderConstructor.newInstance(baseURI);
} else {
// FIXME: make an org.apache.xmlgraphics.io.ResourceResolver resolver!?
fopFactoryBuilder = factBuilderConstructor.newInstance(baseURI);
}
Class fclass = fopFactoryBuilder.getClass();
// FIXME: make this configurable
Boolean b = false;
/* Why doesn't this call work with reflection?
method = fclass.getMethod("setStrictFOValidation", Boolean.class);
method.invoke(fopFactoryBuilder, b);
*/
b = getBooleanProp("BreakIndentInheritanceOnReferenceAreaBoundary");
if (b != null) {
method = fclass.getMethod("setBreakIndentInheritanceOnReferenceAreaBoundary", Boolean.class);
method.invoke(fopFactoryBuilder, b);
}
Float f = getFloatProp("SourceResolution");
if (f != null) {
method = fclass.getMethod("setSourceResolution", Float.class);
method.invoke(fopFactoryBuilder, f);
}
/* FIXME:
s = getStringProp("FontBaseURL");
if (s != null) {
fopFactory.getFontManager().setFontBaseURL(s);
}