blob: e9476773ae6970b9f55a919c579254dfb0806552 [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 */
The Android Open Source Projecte09fd9e2008-12-17 18:05:43 -080021
The Android Open Source Project7c1b96a2008-10-21 07:00:00 -070022package javax.imageio.spi;
23
24import java.util.Locale;
25
26/**
The Android Open Source Projecte09fd9e2008-12-17 18:05:43 -080027 * The IIOServiceProvider abstract class provides base functionality for ImageIO
28 * service provider interfaces (SPIs).
29 *
30 * @since Android 1.0
The Android Open Source Project7c1b96a2008-10-21 07:00:00 -070031 */
32public abstract class IIOServiceProvider implements RegisterableService {
33
The Android Open Source Projecte09fd9e2008-12-17 18:05:43 -080034 /**
35 * The vendor name of this service provider.
36 */
The Android Open Source Project7c1b96a2008-10-21 07:00:00 -070037 protected String vendorName;
The Android Open Source Projecte09fd9e2008-12-17 18:05:43 -080038
39 /**
40 * The version of this service provider.
41 */
The Android Open Source Project7c1b96a2008-10-21 07:00:00 -070042 protected String version;
43
44 /**
45 * Instantiates a new IIOServiceProvider.
46 *
The Android Open Source Projecte09fd9e2008-12-17 18:05:43 -080047 * @param vendorName
48 * the vendor name of service provider.
49 * @param version
50 * the version of service provider.
The Android Open Source Project7c1b96a2008-10-21 07:00:00 -070051 */
52 public IIOServiceProvider(String vendorName, String version) {
53 if (vendorName == null) {
54 throw new NullPointerException("vendor name cannot be NULL");
55 }
56 if (version == null) {
57 throw new NullPointerException("version name cannot be NULL");
58 }
59 this.vendorName = vendorName;
60 this.version = version;
61 }
62
63 /**
64 * Instantiates a new IIOServiceProvider.
65 */
66 public IIOServiceProvider() {
67 throw new UnsupportedOperationException("Not supported yet");
68 }
69
70 public void onRegistration(ServiceRegistry registry, Class<?> category) {
71 // the default impl. does nothing
72 }
73
74 public void onDeregistration(ServiceRegistry registry, Class<?> category) {
75 throw new UnsupportedOperationException("Not supported yet");
76 }
77
78 /**
79 * Gets the vendor name of this service provider.
80 *
81 * @return the vendor name of this service provider.
82 */
83 public String getVendorName() {
84 return vendorName;
85 }
86
87 /**
88 * Gets the version of this service provider.
89 *
90 * @return the version of this service provider.
91 */
92 public String getVersion() {
93 return version;
94 }
95
96 /**
The Android Open Source Projecte09fd9e2008-12-17 18:05:43 -080097 * Gets a description of this service provider. The result string should be
98 * localized for the specified Locale.
The Android Open Source Project7c1b96a2008-10-21 07:00:00 -070099 *
The Android Open Source Projecte09fd9e2008-12-17 18:05:43 -0800100 * @param locale
101 * the specified Locale.
The Android Open Source Project7c1b96a2008-10-21 07:00:00 -0700102 * @return the description of this service provider.
103 */
104 public abstract String getDescription(Locale locale);
105}