summaryrefslogtreecommitdiffstats
path: root/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/Registration.java
blob: 157f4963f9e0ee0df5262f1ca1474fac56ec7ec2 (plain)
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
33
34
35
36
37
38
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

package com.sun.star.comp.Calc.NLPSolver;

import com.sun.star.lib.uno.helper.Factory;
import com.sun.star.lang.XSingleComponentFactory;

public final class Registration {

    private static final String[] m_serviceNames = {
        "com.sun.star.beans.PropertySet",
        "com.sun.star.sheet.Solver"
    };

    public static XSingleComponentFactory __getComponentFactory( String sImplementationName )
    {
        XSingleComponentFactory xFactory = null;

        if ( sImplementationName.equals( "com.sun.star.comp.Calc.NLPSolver.DEPSSolverImpl" ) )
            xFactory = Factory.createComponentFactory( com.sun.star.comp.Calc.NLPSolver.DEPSSolverImpl.class,
                                                       m_serviceNames );
        if ( sImplementationName.equals( "com.sun.star.comp.Calc.NLPSolver.SCOSolverImpl" ) )
            xFactory = Factory.createComponentFactory( com.sun.star.comp.Calc.NLPSolver.SCOSolverImpl.class,
                                                       m_serviceNames );

        return xFactory;
    }
    private Registration() {}
}

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */