| 1 |
/* |
| 2 |
* Copyright 2001-2004 The Apache Software Foundation. |
| 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 |
package javax.xml.rpc.encoding; |
| 17 |
|
| 18 |
/** |
| 19 |
* The interface <code>javax.xml.rpc.encoding.TypeMappingRegistry</code> |
| 20 |
* defines a registry of TypeMapping instances for various encoding |
| 21 |
* styles. |
| 22 |
* |
| 23 |
* @version 1.0 |
| 24 |
*/ |
| 25 |
public interface TypeMappingRegistry extends java.io.Serializable { |
| 26 |
|
| 27 |
/** |
| 28 |
* Registers a <code>TypeMapping</code> instance with the |
| 29 |
* <code>TypeMappingRegistry</code>. This method replaces any |
| 30 |
* existing registered <code>TypeMapping</code> instance for |
| 31 |
* the specified <code>encodingStyleURI</code>. |
| 32 |
* |
| 33 |
* @param encodingStyleURI An encoding style specified as an URI. |
| 34 |
* An example is "http://schemas.xmlsoap.org/soap/encoding/" |
| 35 |
* @param mapping TypeMapping instance |
| 36 |
* |
| 37 |
* @return Previous TypeMapping associated with the specified |
| 38 |
* <code>encodingStyleURI</code>, or <code>null</code> |
| 39 |
* if there was no TypeMapping associated with the specified |
| 40 |
* <code>encodingStyleURI</code> |
| 41 |
* |
| 42 |
* @throws javax.xml.rpc.JAXRPCException if there is any error that prevents |
| 43 |
* the registration of the <code>TypeMapping</code> for |
| 44 |
* the specified <code>encodingStyleURI</code> |
| 45 |
*/ |
| 46 |
public TypeMapping register(String encodingStyleURI, TypeMapping mapping); |
| 47 |
|
| 48 |
/** |
| 49 |
* Registers the <code>TypeMapping</code> instance that is default |
| 50 |
* for all encoding styles supported by the |
| 51 |
* <code>TypeMappingRegistry</code>. A default <code>TypeMapping</code> |
| 52 |
* should include serializers and deserializers that are independent |
| 53 |
* of and usable with any encoding style. Successive invocations |
| 54 |
* of the <code>registerDefault</code> method replace any existing |
| 55 |
* default <code>TypeMapping</code> instance. |
| 56 |
* <p> |
| 57 |
* If the default <code>TypeMapping</code> is registered, any |
| 58 |
* other TypeMapping instances registered through the |
| 59 |
* <code>TypeMappingRegistry.register</code> method (for a set |
| 60 |
* of encodingStyle URIs) override the default <code>TypeMapping</code>. |
| 61 |
* |
| 62 |
* @param mapping TypeMapping instance |
| 63 |
* |
| 64 |
* @throws javax.xml.rpc.JAXRPCException if there is any error that |
| 65 |
* prevents the registration of the default |
| 66 |
* <code>TypeMapping</code> |
| 67 |
*/ |
| 68 |
public void registerDefault(TypeMapping mapping); |
| 69 |
|
| 70 |
/** |
| 71 |
* Gets the registered default <code>TypeMapping</code> instance. |
| 72 |
* This method returns <code>null</code> if there is no registered |
| 73 |
* default TypeMapping in the registry. |
| 74 |
* |
| 75 |
* @return The registered default <code>TypeMapping</code> instance |
| 76 |
* or <code>null</code> |
| 77 |
*/ |
| 78 |
public TypeMapping getDefaultTypeMapping(); |
| 79 |
|
| 80 |
/** |
| 81 |
* Returns a list of registered encodingStyle URIs in this |
| 82 |
* <code>TypeMappingRegistry</code> instance. |
| 83 |
* |
| 84 |
* @return Array of the registered encodingStyle URIs |
| 85 |
*/ |
| 86 |
public String[] getRegisteredEncodingStyleURIs(); |
| 87 |
|
| 88 |
/** |
| 89 |
* Returns the registered <code>TypeMapping</code> for the specified |
| 90 |
* encodingStyle URI. If there is no registered <code>TypeMapping</code> |
| 91 |
* for the specified <code>encodingStyleURI</code>, this method |
| 92 |
* returns <code>null</code>. |
| 93 |
* |
| 94 |
* @param encodingStyleURI Encoding style specified as an URI |
| 95 |
* @return TypeMapping for the specified encodingStyleURI or |
| 96 |
* <code>null</code> |
| 97 |
*/ |
| 98 |
public TypeMapping getTypeMapping(String encodingStyleURI); |
| 99 |
|
| 100 |
/** |
| 101 |
* Creates a new empty <code>TypeMapping</code> object. |
| 102 |
* |
| 103 |
* @return TypeMapping instance. |
| 104 |
*/ |
| 105 |
public TypeMapping createTypeMapping(); |
| 106 |
|
| 107 |
/** |
| 108 |
* Unregisters a TypeMapping instance, if present, from the specified |
| 109 |
* encodingStyleURI. |
| 110 |
* |
| 111 |
* @param encodingStyleURI Encoding style specified as an URI |
| 112 |
* @return <code>TypeMapping</code> instance that has been unregistered |
| 113 |
* or <code>null</code> if there was no TypeMapping |
| 114 |
* registered for the specified <code>encodingStyleURI</code> |
| 115 |
*/ |
| 116 |
public TypeMapping unregisterTypeMapping(String encodingStyleURI); |
| 117 |
|
| 118 |
/** |
| 119 |
* Removes a <code>TypeMapping</code> from the TypeMappingRegistry. A |
| 120 |
* <code>TypeMapping</code> is associated with 1 or more |
| 121 |
* encodingStyleURIs. This method unregisters the specified |
| 122 |
* <code>TypeMapping</code> instance from all associated |
| 123 |
* <code>encodingStyleURIs</code> and then removes this |
| 124 |
* TypeMapping instance from the registry. |
| 125 |
* |
| 126 |
* @param mapping TypeMapping to remove |
| 127 |
* @return <code>true</code> if specified <code>TypeMapping</code> |
| 128 |
* is removed from the TypeMappingRegistry; <code>false</code> |
| 129 |
* if the specified <code>TypeMapping</code> was not in the |
| 130 |
* <code>TypeMappingRegistry</code> |
| 131 |
*/ |
| 132 |
public boolean removeTypeMapping(TypeMapping mapping); |
| 133 |
|
| 134 |
/** |
| 135 |
* Removes all registered TypeMappings and encodingStyleURIs |
| 136 |
* from this TypeMappingRegistry. |
| 137 |
*/ |
| 138 |
public void clear(); |
| 139 |
} |
| 140 |
|