bump product version to 4.2.0.1
[LibreOffice.git] / qadevOOo / runner / util / compare / DocComparatorFactory.java
blob36889207135638601ec3527cd9bfc131dd35b76b
1 /*
2 * This file is part of the LibreOffice project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 * This file incorporates work covered by the following license notice:
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed
12 * with this work for additional information regarding copyright
13 * ownership. The ASF licenses this file to you under the Apache
14 * License, Version 2.0 (the "License"); you may not use this file
15 * except in compliance with the License. You may obtain a copy of
16 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 package util.compare;
21 import lib.TestParameters;
22 import util.compare.GraphicalComparator;
24 public class DocComparatorFactory
26 /**
27 * @param s is a name like 'ooo' 'pdf' or 'msoffice'
28 * @return a new DocComparator Object
30 static public DocComparator createComparator(String s, TestParameters aParams) throws IllegalArgumentException
32 if (s.toLowerCase().equals("gfx") || s.toLowerCase().equals("graphical"))
34 return GraphicalComparator.getInstance(aParams);
37 else if (s.toLowerCase().equals("xml"))
39 return new XMLCompare.create(aParams);
42 else if (s.toLowerCase().equals("pdf"))
44 // return new PDFComparator.create(aParams);
45 throw new IllegalArgumentException("PDF not implemented yet.");
47 else
49 throw new IllegalArgumentException("DocComparator for '" + s + "' not supported!");
52 // unreachable: return null;