📄 defaulttypemappingimpl.java
字号:
Constants.XSD_NAME) ); // a xsd:NCName myRegister(Constants.XSD_NCNAME, org.apache.axis.types.NCName.class, new SimpleSerializerFactory(org.apache.axis.types.NCName.class, Constants.XSD_NCNAME), new SimpleDeserializerFactory(org.apache.axis.types.NCName.class, Constants.XSD_NCNAME) ); // a xsd:ID myRegister(Constants.XSD_ID, org.apache.axis.types.Id.class, new SimpleSerializerFactory(org.apache.axis.types.Id.class, Constants.XSD_ID), new SimpleDeserializerFactory(org.apache.axis.types.Id.class, Constants.XSD_ID) ); // a xml:lang myRegister(Constants.XML_LANG, org.apache.axis.types.Language.class, new SimpleSerializerFactory(org.apache.axis.types.Language.class, Constants.XML_LANG), new SimpleDeserializerFactory(org.apache.axis.types.Language.class, Constants.XML_LANG) ); // a xsd:language myRegister(Constants.XSD_LANGUAGE, org.apache.axis.types.Language.class, new SimpleSerializerFactory(org.apache.axis.types.Language.class, Constants.XSD_LANGUAGE), new SimpleDeserializerFactory(org.apache.axis.types.Language.class, Constants.XSD_LANGUAGE) ); // a xsd:NmToken myRegister(Constants.XSD_NMTOKEN, org.apache.axis.types.NMToken.class, new SimpleSerializerFactory(org.apache.axis.types.NMToken.class, Constants.XSD_NMTOKEN), new SimpleDeserializerFactory(org.apache.axis.types.NMToken.class, Constants.XSD_NMTOKEN) ); // a xsd:NmTokens myRegister(Constants.XSD_NMTOKENS, org.apache.axis.types.NMTokens.class, new SimpleSerializerFactory(org.apache.axis.types.NMTokens.class, Constants.XSD_NMTOKENS), new SimpleDeserializerFactory(org.apache.axis.types.NMTokens.class, Constants.XSD_NMTOKENS) ); // a xsd:NOTATION myRegister(Constants.XSD_NOTATION, org.apache.axis.types.Notation.class, new BeanSerializerFactory(org.apache.axis.types.Notation.class, Constants.XSD_NOTATION), new BeanDeserializerFactory(org.apache.axis.types.Notation.class, Constants.XSD_NOTATION) ); // a xsd:XSD_ENTITY myRegister(Constants.XSD_ENTITY, org.apache.axis.types.Entity.class, new SimpleSerializerFactory(org.apache.axis.types.Entity.class, Constants.XSD_ENTITY), new SimpleDeserializerFactory(org.apache.axis.types.Entity.class, Constants.XSD_ENTITY) ); // a xsd:XSD_ENTITIES myRegister(Constants.XSD_ENTITIES, org.apache.axis.types.Entities.class, new SimpleSerializerFactory(org.apache.axis.types.Entities.class, Constants.XSD_ENTITIES), new SimpleDeserializerFactory(org.apache.axis.types.Entities.class, Constants.XSD_ENTITIES) ); // a xsd:XSD_IDREF myRegister(Constants.XSD_IDREF, org.apache.axis.types.IDRef.class, new SimpleSerializerFactory(org.apache.axis.types.IDRef.class, Constants.XSD_IDREF), new SimpleDeserializerFactory(org.apache.axis.types.IDRef.class, Constants.XSD_IDREF) ); // a xsd:XSD_XSD_IDREFS myRegister(Constants.XSD_IDREFS, org.apache.axis.types.IDRefs.class, new SimpleSerializerFactory(org.apache.axis.types.IDRefs.class, Constants.XSD_IDREFS), new SimpleDeserializerFactory(org.apache.axis.types.IDRefs.class, Constants.XSD_IDREFS) ); // a xsd:Duration myRegister(Constants.XSD_DURATION, org.apache.axis.types.Duration.class, new SimpleSerializerFactory(org.apache.axis.types.Duration.class, Constants.XSD_DURATION), new SimpleDeserializerFactory(org.apache.axis.types.Duration.class, Constants.XSD_DURATION) ); // a xsd:anyURI myRegister(Constants.XSD_ANYURI, org.apache.axis.types.URI.class, new SimpleSerializerFactory(org.apache.axis.types.URI.class, Constants.XSD_ANYURI), new SimpleDeserializerFactory(org.apache.axis.types.URI.class, Constants.XSD_ANYURI) ); // a xsd:schema myRegister(Constants.XSD_SCHEMA, org.apache.axis.types.Schema.class, new BeanSerializerFactory(org.apache.axis.types.Schema.class, Constants.XSD_SCHEMA), new BeanDeserializerFactory(org.apache.axis.types.Schema.class, Constants.XSD_SCHEMA) ); // Need this at the default TypeMapping level so that we can correctly // obtain the ArraySerializer when in doc/lit mode and only have a // Java class available (no XML type metadata) - see TypeMappingImpl // (getSerializer()) myRegister(Constants.SOAP_ARRAY, java.util.ArrayList.class, new ArraySerializerFactory(), new ArrayDeserializerFactory() ); // // Now register the schema specific types // SchemaVersion.SCHEMA_1999.registerSchemaSpecificTypes(this); SchemaVersion.SCHEMA_2000.registerSchemaSpecificTypes(this); SchemaVersion.SCHEMA_2001.registerSchemaSpecificTypes(this); inInitMappings = false; } /** * Register a "simple" type mapping - in other words, a * @param xmlType * @param javaType */ protected void myRegisterSimple(QName xmlType, Class javaType) { SerializerFactory sf = new SimpleSerializerFactory(javaType, xmlType); DeserializerFactory df = null; if (javaType != java.lang.Object.class) { df = new SimpleDeserializerFactory(javaType, xmlType); } myRegister(xmlType, javaType, sf, df); } /** * Construct TypeMapping for all the [xmlType, javaType] for all of the * known xmlType namespaces. This is the shotgun approach, which works * in 99% of the cases. The other cases that are Schema version specific * (i.e. timeInstant vs. dateTime) are handled by the SchemaVersion * Interface registerSchemaSpecificTypes(). * * @param xmlType is the QName type * @param javaType is the java type * @param sf is the ser factory (if null, the simple factory is used) * @param df is the deser factory (if null, the simple factory is used) */ protected void myRegister(QName xmlType, Class javaType, SerializerFactory sf, DeserializerFactory df) { // Register all known flavors of the namespace. try { if (xmlType.getNamespaceURI().equals( Constants.URI_DEFAULT_SCHEMA_XSD)) { for (int i=0; i < Constants.URIS_SCHEMA_XSD.length; i++) { QName qName = new QName(Constants.URIS_SCHEMA_XSD[i], xmlType.getLocalPart()); super.internalRegister(javaType, qName, sf, df); } } else if (xmlType.getNamespaceURI().equals( Constants.URI_DEFAULT_SOAP_ENC)) { for (int i=0; i < Constants.URIS_SOAP_ENC.length; i++) { QName qName = new QName(Constants.URIS_SOAP_ENC[i], xmlType.getLocalPart()); super.internalRegister(javaType, qName, sf, df); } } else { // Register with the specified xmlType. // This is the prefered mapping and the last registed one wins super.internalRegister(javaType, xmlType, sf, df); } } catch (JAXRPCException e) { } } // Don't allow anyone to muck with the default type mapping because // it is a singleton used for the whole system. public void register(Class javaType, QName xmlType, javax.xml.rpc.encoding.SerializerFactory sf, javax.xml.rpc.encoding.DeserializerFactory dsf) throws JAXRPCException { super.register(javaType, xmlType, sf, dsf); } public void removeSerializer(Class javaType, QName xmlType) throws JAXRPCException { throw new JAXRPCException(Messages.getMessage("fixedTypeMapping")); } public void removeDeserializer(Class javaType, QName xmlType) throws JAXRPCException { throw new JAXRPCException(Messages.getMessage("fixedTypeMapping")); } public void setSupportedEncodings(String[] namespaceURIs) { }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -