KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > osgi > framework > FrameworkUtil


1 /*
2  * $Header: /cvsroot/eclipse/org.eclipse.osgi/osgi/src/org/osgi/framework/FrameworkUtil.java,v 1.8 2007/02/26 16:37:21 twatson Exp $
3  *
4  * Copyright (c) OSGi Alliance (2005, 2007). All Rights Reserved.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */

18
19 package org.osgi.framework;
20
21 import org.eclipse.osgi.framework.internal.core.FilterImpl;
22
23 /**
24  * Framework Utility class.
25  *
26  * <p>
27  * This class contains utility methods which access Framework functions that may
28  * be useful to bundles.
29  *
30  * @since 1.3
31  * @ThreadSafe
32  * @version $Revision: 1.8 $
33  */

34 public class FrameworkUtil {
35     /*
36      * NOTE: A framework implementor may also choose to replace this class in
37      * their distribution with a class that directly interfaces with the
38      * framework implementation.
39      */

40
41     /**
42      * FrameworkUtil objects may not be constructed.
43      */

44     private FrameworkUtil() {}
45     
46     /**
47      * Creates a <code>Filter</code> object. This <code>Filter</code> object
48      * may be used to match a <code>ServiceReference</code> object or a
49      * <code>Dictionary</code> object.
50      *
51      * <p>
52      * If the filter cannot be parsed, an {@link InvalidSyntaxException} will be
53      * thrown with a human readable message where the filter became unparsable.
54      *
55      * @param filter The filter string.
56      * @return A <code>Filter</code> object encapsulating the filter string.
57      * @throws InvalidSyntaxException If <code>filter</code> contains an
58      * invalid filter string that cannot be parsed.
59      * @throws NullPointerException If <code>filter</code> is null.
60      *
61      * @see Filter
62      */

63     public static Filter createFilter(String JavaDoc filter)
64             throws InvalidSyntaxException {
65         return new FilterImpl(filter);
66     }
67 }
68
Popular Tags