Java Code Examples for org.apache.axis.encoding.TypeMapping#isRegistered()
The following examples show how to use
org.apache.axis.encoding.TypeMapping#isRegistered() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AxisDeserializer.java From googleads-java-lib with Apache License 2.0 | 6 votes |
/** Adds the type mappings in the list to {@code registryTypeMapping}. */ private void registerTypeMappings( TypeMapping registryTypeMapping, List<TypeMapping> typeMappings) { Preconditions.checkNotNull(registryTypeMapping, "Null registry type mapping"); Preconditions.checkNotNull(typeMappings, "Null type mappings"); Preconditions.checkArgument(!typeMappings.isEmpty(), "Empty type mappings"); for (TypeMapping typeMapping : typeMappings) { for (Class<?> mappingClass : typeMapping.getAllClasses()) { QName classQName = typeMapping.getTypeQName(mappingClass); DeserializerFactory deserializer = typeMapping.getDeserializer(mappingClass, classQName); if (deserializer != null && !registryTypeMapping.isRegistered(mappingClass, classQName)) { registryTypeMapping.register( mappingClass, classQName, (SerializerFactory) null, deserializer); } } } }
Example 2
Source File: ContextRegistrar.java From openbd-core with GNU General Public License v3.0 | 5 votes |
/** * Registers the specified Class with the current MessageContext's TypeMapping * for use by Axis. This method will remove any existing entries for the same * class type (QName equivalence) before adding new Bean * serializer/deserializer entries. * * @param kls */ public void registerClass(Class<?> kls) { // Add ser/deser pairs for these classes TypeMapping tm = msgContext.getTypeMapping(); QName xmlType = convertToQName(kls, this.scheme); if (!tm.isRegistered(kls, xmlType)) { SerializerFactory sf = new BeanSerializerFactory(kls, xmlType); DeserializerFactory dsf = new BeanDeserializerFactory(kls, xmlType); tm.register(kls, xmlType, sf, dsf); } }
Example 3
Source File: ContextRegistrar.java From openbd-core with GNU General Public License v3.0 | 5 votes |
/** * Unregisters the specified Class from the current MessageContext's * TypeMapping for use by Axis. This method will remove all existing entries * for the class type (QName equivalence). * * @param kls */ public void unregisterClass(Class<?> kls) { TypeMapping tm = msgContext.getTypeMapping(); QName xmlType = convertToQName(kls, this.scheme); if (tm.isRegistered(kls, xmlType)) { tm.removeDeserializer(kls, xmlType); tm.removeSerializer(kls, xmlType); } }