本文整理汇总了Java中org.apache.axis.description.TypeDesc类的典型用法代码示例。如果您正苦于以下问题:Java TypeDesc类的具体用法?Java TypeDesc怎么用?Java TypeDesc使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TypeDesc类属于org.apache.axis.description包,在下文中一共展示了TypeDesc类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: BeanDeserializer
import org.apache.axis.description.TypeDesc; //导入依赖的package包/类
public BeanDeserializer(Class javaType, QName xmlType, TypeDesc typeDesc,
Map propertyMap ) {
this.xmlType = xmlType;
this.javaType = javaType;
this.typeDesc = typeDesc;
this.propertyMap = propertyMap;
// create a value
try {
value=javaType.newInstance();
} catch (Exception e) {
// Don't process the exception at this point.
// This is defered until the call to startElement
// which will throw the exception.
}
}
开发者ID:lucee,项目名称:Lucee4,代码行数:17,代码来源:BeanDeserializer.java
示例2: getProperties
import org.apache.axis.description.TypeDesc; //导入依赖的package包/类
/**
* Get a list of the bean properties
*/
public static Map getProperties(Class javaType, TypeDesc typeDesc ) {
Map propertyMap = null;
if (typeDesc != null) {
propertyMap = typeDesc.getPropertyDescriptorMap();
} else {
BeanPropertyDescriptor[] pd = BeanUtils.getPd(javaType, null);
propertyMap = new StructImpl();// use this to get rid of case sensitivity
// loop through properties and grab the names for later
for (int i = 0; i < pd.length; i++) {
BeanPropertyDescriptor descriptor = pd[i];
propertyMap.put(descriptor.getName(), descriptor);
}
}
return propertyMap;
}
开发者ID:lucee,项目名称:Lucee4,代码行数:22,代码来源:BeanDeserializerFactory.java
示例3: serialize
import org.apache.axis.description.TypeDesc; //导入依赖的package包/类
public static String serialize(Object obj) throws IOException {
TypeDesc desc = TypeDesc.getTypeDescForClass(obj.getClass());
BeanSerializer serializer = new BeanSerializer(obj.getClass(), desc.getXmlType(), desc);
MessageContext mctx = new MessageContext(null);
mctx.setProperty(AxisEngine.PROP_ENABLE_NAMESPACE_PREFIX_OPTIMIZATION, true);
mctx.setProperty(AxisEngine.PROP_SEND_XSI, true);
mctx.setTypeMappingRegistry(new TypeMappingRegistryImpl());
StringWriter writer = new StringWriter();
SerializationContext ctx = new SerializationContext(writer, mctx);
ctx.setPretty(false);
ctx.setSendDecl(true);
ctx.setDoMultiRefs(false);
serializer.serialize(new QName("keha"), new AttributesImpl(), obj, ctx);
return writer.getBuffer().toString();
}
开发者ID:nortal,项目名称:j-road,代码行数:20,代码来源:AxisUtil.java
示例4: BeanDeserializerFactory
import org.apache.axis.description.TypeDesc; //导入依赖的package包/类
public BeanDeserializerFactory(Class javaType, QName xmlType) {
super(BeanDeserializer.class, xmlType, javaType);
// Sometimes an Enumeration class is registered as a Bean.
// If this is the case, silently switch to the EnumDeserializer
if (JavaUtils.isEnumClass(javaType)) {
deserClass = EnumDeserializer.class;
}
typeDesc = TypeDesc.getTypeDescForClass(javaType);
propertyMap = getProperties(javaType, typeDesc);
}
开发者ID:lucee,项目名称:Lucee4,代码行数:13,代码来源:BeanDeserializerFactory.java
示例5: initialize
import org.apache.axis.description.TypeDesc; //导入依赖的package包/类
void initialize(Object serviceImpl, ClassLoader classLoader) throws ClassNotFoundException {
this.serviceImpl = serviceImpl;
Class serviceEndpointBaseClass = classLoader.loadClass(serviceEndpointClassName);
serviceEndpointClass = enhanceServiceEndpointInterface(serviceEndpointBaseClass, classLoader);
Class[] constructorTypes = new Class[]{classLoader.loadClass(GenericServiceEndpoint.class.getName())};
this.constructor = FastClass.create(serviceEndpointClass).getConstructor(constructorTypes);
this.handlerInfoChainFactory = new HandlerInfoChainFactory(handlerInfos);
sortedOperationInfos = new OperationInfo[FastClass.create(serviceEndpointClass).getMaxIndex() + 1];
String encodingStyle = "";
for (int i = 0; i < operationInfos.length; i++) {
OperationInfo operationInfo = operationInfos[i];
Signature signature = operationInfo.getSignature();
MethodProxy methodProxy = MethodProxy.find(serviceEndpointClass, signature);
if (methodProxy == null) {
throw new ServerRuntimeException("No method proxy for operationInfo " + signature);
}
int index = methodProxy.getSuperIndex();
sortedOperationInfos[index] = operationInfo;
if (operationInfo.getOperationDesc().getUse() == Use.ENCODED) {
encodingStyle = org.apache.axis.Constants.URI_SOAP11_ENC;
}
}
//register our type descriptors
Service service = ((ServiceImpl) serviceImpl).getService();
AxisEngine axisEngine = service.getEngine();
TypeMappingRegistry typeMappingRegistry = axisEngine.getTypeMappingRegistry();
TypeMapping typeMapping = typeMappingRegistry.getOrMakeTypeMapping(encodingStyle);
typeMapping.register(BigInteger.class, Constants.XSD_UNSIGNEDLONG, new SimpleSerializerFactory(BigInteger.class, Constants.XSD_UNSIGNEDLONG), new SimpleDeserializerFactory(BigInteger.class, Constants.XSD_UNSIGNEDLONG));
typeMapping.register(URI.class, Constants.XSD_ANYURI, new SimpleSerializerFactory(URI.class, Constants.XSD_ANYURI), new SimpleDeserializerFactory(URI.class, Constants.XSD_ANYURI));
//It is essential that the types be registered before the typeInfos create the serializer/deserializers.
for (Iterator iter = typeInfo.iterator(); iter.hasNext(); ) {
TypeInfo info = (TypeInfo) iter.next();
TypeDesc.registerTypeDescForClass(info.getClazz(), info.buildTypeDesc());
}
TypeInfo.register(typeInfo, typeMapping);
}
开发者ID:apache,项目名称:tomee,代码行数:37,代码来源:SeiFactoryImpl.java
示例6: getXmlType
import org.apache.axis.description.TypeDesc; //导入依赖的package包/类
/**
* Uses reflection to get the QName XmlType.
*/
private <T extends Serializable> QName getXmlType(Class<T> clazz)
throws IllegalArgumentException,
IllegalAccessException,
InvocationTargetException,
SecurityException,
NoSuchMethodException {
Method getTypeDesc = clazz.getMethod("getTypeDesc");
TypeDesc typeDesc = (TypeDesc) getTypeDesc.invoke(null);
return typeDesc.getXmlType();
}
开发者ID:googleads,项目名称:googleads-java-lib,代码行数:14,代码来源:AxisSerializer.java
示例7: readObject
import org.apache.axis.description.TypeDesc; //导入依赖的package包/类
private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {
in.defaultReadObject();
typeDesc = TypeDesc.getTypeDescForClass(javaType);
propertyMap = getProperties(javaType, typeDesc);
}
开发者ID:lucee,项目名称:Lucee4,代码行数:6,代码来源:BeanDeserializerFactory.java
示例8: getTypeDesc
import org.apache.axis.description.TypeDesc; //导入依赖的package包/类
public static TypeDesc getTypeDesc()
{
return typeDesc;
}
开发者ID:afrous,项目名称:Cynthia,代码行数:5,代码来源:DataAndEventId.java
示例9: buildTypeDesc
import org.apache.axis.description.TypeDesc; //导入依赖的package包/类
public TypeDesc buildTypeDesc() {
TypeDesc typeDesc = new TypeDesc(clazz, canSearchParents);
typeDesc.setXmlType(qName);
typeDesc.setFields(fields);
return typeDesc;
}
开发者ID:apache,项目名称:tomee,代码行数:7,代码来源:TypeInfo.java
注:本文中的org.apache.axis.description.TypeDesc类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论