Home | History | Annotate | Download | only in streamhtmlparser
      1 /*
      2  * Copyright (C) 2010 Google Inc.
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  * http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 package com.google.streamhtmlparser;
     18 
     19 import com.google.streamhtmlparser.impl.JavascriptParserImpl;
     20 
     21 /**
     22  * A factory class to obtain instances of an <code>JavascriptParser</code>.
     23  * Currently each instance is a new object given these are fairly
     24  * light-weight.
     25  *
     26  * <p>Note that we do not typically expect a caller of this package to require
     27  * an instance of a <code>JavascriptParser</code> since one is already
     28  * embedded in the more general-purpose <code>HtmlParser</code>. We still
     29  * make it possible to require one as it may be useful for more
     30  * specialized needs.
     31  *
     32  */
     33 
     34 public class JavascriptParserFactory {
     35 
     36   public static JavascriptParser getInstance() {
     37     return new JavascriptParserImpl();
     38   }
     39 
     40   // Static class.
     41   private JavascriptParserFactory() {
     42   }  // COV_NF_LINE
     43 }