blob: f5873bfb4fab74c278afca8e4e2337f948d5ab27 [file] [log] [blame]
The Android Open Source Project7c1b96a2008-10-21 07:00:00 -07001/*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17/**
18 * @author Rustem V. Rafikov
19 * @version $Revision: 1.3 $
20 */
21package javax.imageio.spi;
22
23import java.util.Locale;
24
25/**
26 * The IIOServiceProvider abstract class provides base functionality
27 * for imageio service provider interfaces (SPIs).
28 */
29public abstract class IIOServiceProvider implements RegisterableService {
30
31 /** The vendor name of this service provider. */
32 protected String vendorName;
33
34 /** The version of this service provider. */
35 protected String version;
36
37 /**
38 * Instantiates a new IIOServiceProvider.
39 *
40 * @param vendorName the vendor name of service provider.
41 * @param version the version of service provider.
42 */
43 public IIOServiceProvider(String vendorName, String version) {
44 if (vendorName == null) {
45 throw new NullPointerException("vendor name cannot be NULL");
46 }
47 if (version == null) {
48 throw new NullPointerException("version name cannot be NULL");
49 }
50 this.vendorName = vendorName;
51 this.version = version;
52 }
53
54 /**
55 * Instantiates a new IIOServiceProvider.
56 */
57 public IIOServiceProvider() {
58 throw new UnsupportedOperationException("Not supported yet");
59 }
60
61 public void onRegistration(ServiceRegistry registry, Class<?> category) {
62 // the default impl. does nothing
63 }
64
65 public void onDeregistration(ServiceRegistry registry, Class<?> category) {
66 throw new UnsupportedOperationException("Not supported yet");
67 }
68
69 /**
70 * Gets the vendor name of this service provider.
71 *
72 * @return the vendor name of this service provider.
73 */
74 public String getVendorName() {
75 return vendorName;
76 }
77
78 /**
79 * Gets the version of this service provider.
80 *
81 * @return the version of this service provider.
82 */
83 public String getVersion() {
84 return version;
85 }
86
87 /**
88 * Gets a description of this service provider.
89 * The result string should be localized for the specified
90 * Locale.
91 *
92 * @param locale the specified Locale.
93 *
94 * @return the description of this service provider.
95 */
96 public abstract String getDescription(Locale locale);
97}