~ubuntu-branches/ubuntu/trusty/libjaxp1.3-java/trusty

« back to all changes in this revision

Viewing changes to org/w3c/css/sac/helpers/ParserFactory.java

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2010-11-17 14:36:04 UTC
  • mfrom: (3.2.2 sid)
  • Revision ID: james.westby@ubuntu.com-20101117143604-o14s4i5mg3sr0s0v
Tags: 1.3.05-1ubuntu1
* Merge with Debian, remaining changes:
  - Adjust versioned conflict with libxalan2-java.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (c) 1999 World Wide Web Consortium,
 
3
 * (Massachusetts Institute of Technology, Institut National de
 
4
 * Recherche en Informatique et en Automatique, Keio University). All
 
5
 * Rights Reserved. This program is distributed under the W3C's Software
 
6
 * Intellectual Property License. This program is distributed in the
 
7
 * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
 
8
 * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
 
9
 * PURPOSE.
 
10
 * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
 
11
 *
 
12
 * $Id: ParserFactory.java 477010 2006-11-20 02:54:38Z mrglavas $
 
13
 */
 
14
package org.w3c.css.sac.helpers;
 
15
 
 
16
import org.w3c.css.sac.Parser;
 
17
 
 
18
/**
 
19
 * @version $Revision: 477010 $
 
20
 * @author  Philippe Le Hegaret
 
21
 */
 
22
public class ParserFactory {
 
23
    
 
24
    /**
 
25
     * Create a parser with given selectors factory and conditions factory.
 
26
     */    
 
27
    public Parser makeParser()
 
28
        throws ClassNotFoundException,
 
29
               IllegalAccessException, 
 
30
               InstantiationException,
 
31
               NullPointerException,
 
32
               ClassCastException {
 
33
        String className = System.getProperty("org.w3c.css.sac.parser");
 
34
        if (className == null) {
 
35
            throw new NullPointerException("No value for sac.parser property");
 
36
        } else {
 
37
            return (Parser)(Class.forName(className).newInstance());
 
38
        }
 
39
    }
 
40
}