summaryrefslogtreecommitdiffstats
path: root/container-core/src/main/java/com/yahoo/container/xml/providers/XPathFactoryProvider.java
blob: 407369032cf36b14831c9a18899091551023061a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.container.xml.providers;

import com.yahoo.container.di.componentgraph.Provider;

import javax.xml.xpath.XPathFactory;
import javax.xml.xpath.XPathFactoryConfigurationException;

/**
 * @author Einar M R Rosenvinge
 * @deprecated Do not use!
 */
@Deprecated
public class XPathFactoryProvider implements Provider<XPathFactory> {

    public static final String FACTORY_CLASS = "com.sun.org.apache.xpath.internal.jaxp.XPathFactoryImpl";

    @Override
    public XPathFactory get() {
        try {
            return XPathFactory.newInstance(XPathFactory.DEFAULT_OBJECT_MODEL_URI,
                                            FACTORY_CLASS,
                                            this.getClass().getClassLoader());
        } catch (XPathFactoryConfigurationException e) {
            throw new IllegalStateException(e);
        }
    }

    @Override
    public void deconstruct() { }

}