KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > api > xml > services > UserCatalog


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19 package org.netbeans.api.xml.services;
20
21 import java.util.Iterator JavaDoc;
22 import javax.xml.transform.URIResolver JavaDoc;
23
24 import org.xml.sax.EntityResolver JavaDoc;
25 import org.openide.util.Lookup;
26
27 // for JavaDoc
28
import org.openide.xml.EntityCatalog;
29
30 /**
31  * Factory of user's catalog service instaces. A client cannot instantiate and
32  * use it directly. It can indirectly use instances are registeretered in a
33  * {@link Lookup} by providers.
34  * <p>
35  * It is user's level equivalent of system's entity resolution support
36  * {@link EntityCatalog} in OpenIDE API. Do not mix these,
37  * always use <code>UserCatalog</code> while working with user's files.
38  * User may, depending on provider implementation, use system catalog as
39  * user's one if needed.
40  *
41  * @author Libor Kramolis
42  * @author Petr Kuzel
43  * @since 0.5
44  */

45 public abstract class UserCatalog {
46     
47     // abstract to avoid instantionalization by API clients
48

49     /**
50      * Utility method looking up for an instance in default Lookup.
51      * @return UserCatalog registered in default Lookup or <code>null</code>.
52      */

53     public static UserCatalog getDefault() {
54         return (UserCatalog) Lookup.getDefault().lookup(UserCatalog.class);
55     }
56     
57     /**
58      * User's JAXP/TrAX <code>URIResolver</code>.
59      * @return URIResolver or <code>null</code> if not supported.
60      */

61     public URIResolver JavaDoc getURIResolver() {
62         return null;
63     }
64     
65     /**
66      * User's SAX <code>EntityResolver</code>.
67      * @return EntityResolver or <code>null</code> if not supported.
68      */

69     public EntityResolver JavaDoc getEntityResolver() {
70         return null;
71     }
72             
73     /**
74      * Read-only "sampled" iterator over all registered entity public IDs.
75      * @return all known public IDs or <code>null</code> if not supported.
76      */

77     // Svata suggested here a live collection, but he accepts this solution if it
78
// is only for informational purposes. It is.
79
public Iterator JavaDoc getPublicIDs() {
80         return null;
81     }
82 }
83
Popular Tags