Java Code Examples for javax.xml.catalog.CatalogFeatures#Builder

The following examples show how to use javax.xml.catalog.CatalogFeatures#Builder . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JdkXmlUtils.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
/**
 * Creates an instance of a CatalogFeatures.
 *
 * @param defer the defer property defined in CatalogFeatures
 * @param file the file path to a catalog
 * @param prefer the prefer property defined in CatalogFeatures
 * @param resolve the resolve property defined in CatalogFeatures
 * @return a {@link javax.xml.transform.Source} object
 */
public static CatalogFeatures getCatalogFeatures(String defer, String file,
        String prefer, String resolve) {

    CatalogFeatures.Builder builder = CatalogFeatures.builder();
    if (file != null) {
        builder = builder.with(CatalogFeatures.Feature.FILES, file);
    }
    if (prefer != null) {
        builder = builder.with(CatalogFeatures.Feature.PREFER, prefer);
    }
    if (defer != null) {
        builder = builder.with(CatalogFeatures.Feature.DEFER, defer);
    }
    if (resolve != null) {
        builder = builder.with(CatalogFeatures.Feature.RESOLVE, resolve);
    }

    return builder.build();
}
 
Example 2
Source File: JdkXmlUtils.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates an instance of a CatalogFeatures.
 *
 * @param defer the defer property defined in CatalogFeatures
 * @param file the file path to a catalog
 * @param prefer the prefer property defined in CatalogFeatures
 * @param resolve the resolve property defined in CatalogFeatures
 * @return a {@link javax.xml.transform.Source} object
 */
public static CatalogFeatures getCatalogFeatures(String defer, String file,
        String prefer, String resolve) {

    CatalogFeatures.Builder builder = CatalogFeatures.builder();
    if (file != null) {
        builder = builder.with(CatalogFeatures.Feature.FILES, file);
    }
    if (prefer != null) {
        builder = builder.with(CatalogFeatures.Feature.PREFER, prefer);
    }
    if (defer != null) {
        builder = builder.with(CatalogFeatures.Feature.DEFER, defer);
    }
    if (resolve != null) {
        builder = builder.with(CatalogFeatures.Feature.RESOLVE, resolve);
    }

    return builder.build();
}