public TypeInfo getTypeInfo(Class javaType, Object logical) { QName xmlType = JavaXMLMapper.getXMLType(javaType); if (xmlType != null) { return new TypeInfo(xmlType, true, null); } else if (javaType.isInterface()) { return new TypeInfo(ANYTYPE_QNAME, true, null); } else { if (logical instanceof XMLType) { xmlType = ((XMLType)logical).getTypeName(); } if (xmlType == null) { xmlType = new QName(Introspector.decapitalize(javaType.getSimpleName())); } return new TypeInfo(xmlType, false, null); } }
public TypeInfo getTypeInfo(Class javaType, Object logical) { QName xmlType = JavaXMLMapper.getXMLType(javaType); if (xmlType != null) { return new TypeInfo(xmlType, true, null); } else if (javaType.isInterface()) { return new TypeInfo(ANYTYPE_QNAME, true, null); } else { if (logical instanceof XMLType) { xmlType = ((XMLType)logical).getTypeName(); } if (xmlType == null) { xmlType = new QName(Introspector.decapitalize(javaType.getSimpleName())); } return new TypeInfo(xmlType, false, null); } }
public TypeInfo getTypeInfo(Class javaType, Object logical) { QName xmlType = JavaXMLMapper.getXMLType(javaType); if (xmlType != null) { return new TypeInfo(xmlType, true, null); } else if (javaType.isInterface()) { return new TypeInfo(ANYTYPE_QNAME, true, null); } else { // types.add(javaType); if (logical instanceof XMLType) { xmlType = ((XMLType)logical).getTypeName(); } if (xmlType == null) { xmlType = new QName(JAXBContextHelper.jaxbDecapitalize(javaType.getSimpleName())); } return new TypeInfo(xmlType, false, null); } }
writer.writeStartElement(Constants.SCA11_TUSCANY_NS, XMLTYPE); XMLType xmlType = (XMLType)dataType.getLogical(); if (xmlType.getTypeName() != null){ writer.writeCharacters(xmlType.getTypeName().toString()); } else { writer.writeCharacters("NoType");
writer.writeStartElement(Constants.SCA11_TUSCANY_NS, XMLTYPE); XMLType xmlType = (XMLType)dataType.getLogical(); if (xmlType.getTypeName() != null){ writer.writeCharacters(xmlType.getTypeName().toString()); } else { writer.writeCharacters("NoType");
public TypeInfo getTypeInfo(Class javaType, Object logical) { QName xmlType = JavaXMLMapper.getXMLType(javaType); if (xmlType != null) { return new TypeInfo(xmlType, true, null); } else if (javaType.isInterface()) { return new TypeInfo(ANYTYPE_QNAME, true, null); } else { // types.add(javaType); if (logical instanceof XMLType) { xmlType = ((XMLType)logical).getTypeName(); } if (xmlType == null) { xmlType = new QName(JAXBContextHelper.jaxbDecapitalize(javaType.getSimpleName())); } return new TypeInfo(xmlType, false, null); } }
public Object transform(T source, TransformationContext context) { XMLType xmlType = (XMLType)context.getSourceDataType().getLogical(); QName type = (xmlType != null) ? xmlType.getTypeName() : null; if (type == null) { xmlType = (XMLType)context.getTargetDataType().getLogical(); type = (xmlType != null) ? xmlType.getTypeName() : null; } Object result = mapper.toJavaObject(type, getText(source), context); close(source); return result; }
public Object transform(T source, TransformationContext context) { XMLType xmlType = (XMLType)context.getSourceDataType().getLogical(); QName type = (xmlType != null) ? xmlType.getTypeName() : null; if (type == null) { xmlType = (XMLType)context.getTargetDataType().getLogical(); type = (xmlType != null) ? xmlType.getTypeName() : null; } Object result = mapper.toJavaObject(type, getText(source), context); close(source); return result; }
namespace = returnXMLType.getElementName().getNamespaceURI(); } else { namespace = returnXMLType.getTypeName().getNamespaceURI();
namespace = returnXMLType.getElementName().getNamespaceURI(); } else { namespace = returnXMLType.getTypeName().getNamespaceURI();
public static Class<?> getJavaType(DataType<?> dataType) { if (dataType == null) { return null; } Class type = dataType.getPhysical(); if (JAXBElement.class.isAssignableFrom(type)) { Type generic = dataType.getGenericType(); type = Object.class; } if (type == Object.class && dataType.getLogical() instanceof XMLType) { XMLType xType = (XMLType)dataType.getLogical(); Class javaType = SIMPLE_TYPE_MAPPER.getJavaType(xType.getTypeName()); if (javaType != null) { type = javaType; } } return type; }
public static Class<?> getJavaType(DataType<?> dataType) { if (dataType == null) { return null; } Class type = dataType.getPhysical(); if (JAXBElement.class.isAssignableFrom(type)) { Type generic = dataType.getGenericType(); type = Object.class; } if (type == Object.class && dataType.getLogical() instanceof XMLType) { XMLType xType = (XMLType)dataType.getLogical(); Class javaType = SIMPLE_TYPE_MAPPER.getJavaType(xType.getTypeName()); if (javaType != null) { type = javaType; } } return type; }
public T transform(Object source, TransformationContext context) { XMLType xmlType = (XMLType) context.getTargetDataType().getLogical(); String text = mapper.toXMLLiteral(xmlType.getTypeName(), source, context); return createElement(xmlType.getElementName(), text, context); }
public T transform(Object source, TransformationContext context) { XMLType xmlType = (XMLType) context.getTargetDataType().getLogical(); String text = mapper.toXMLLiteral(xmlType.getTypeName(), source, context); return createElement(xmlType.getElementName(), text, context); }
public Object transform(T source, TransformationContext context) { //FIXME why is the logical type sometimes a Class instead of an XMLType? if (context.getSourceDataType().getLogical() instanceof XMLType) { XMLType xmlType = (XMLType) context.getSourceDataType().getLogical(); return toJavaObject(xmlType.getTypeName(), getRootElement(source), context); } else { return toJavaObject(null, getRootElement(source), context); } }
if (logical instanceof XMLType && logical != XMLType.UNKNOWN) { ((XMLType)logical).setTypeName(xmlType.getTypeName()); } else { dataType.setLogical(xmlType);
public Object transform(T source, TransformationContext context) { //FIXME why is the logical type sometimes a Class instead of an XMLType? if (context.getSourceDataType().getLogical() instanceof XMLType) { XMLType xmlType = (XMLType) context.getSourceDataType().getLogical(); return toJavaObject(xmlType.getTypeName(), getRootElement(source), context); } else { return toJavaObject(null, getRootElement(source), context); } }
public Part generatePart(Definition definition, DataType arg, String partName) { Part part = definition.createPart(); part.setName(partName); if (arg != null && arg.getLogical() instanceof XMLType) { XMLType xmlType = (XMLType)arg.getLogical(); QName elementName = xmlType.getElementName(); part.setElementName(elementName); addNamespace(definition, elementName); if (xmlType.getElementName() == null) { QName typeName = xmlType.getTypeName(); part.setTypeName(typeName); addNamespace(definition, typeName); } } return part; }
public Part generatePart(Definition definition, DataType arg, String partName) { Part part = definition.createPart(); part.setName(partName); if (arg != null && arg.getLogical() instanceof XMLType) { XMLType xmlType = (XMLType)arg.getLogical(); QName elementName = xmlType.getElementName(); part.setElementName(elementName); addNamespace(definition, elementName); if (xmlType.getElementName() == null) { QName typeName = xmlType.getTypeName(); part.setTypeName(typeName); addNamespace(definition, typeName); } } return part; }
@Override public <T> void visitEnd(Class<T> clazz, JavaImplementation type) throws IntrospectionException { for (Property property : type.getProperties()) { String name = property.getName(); JavaElementImpl element = type.getPropertyMembers().get(name); introspect(property, element); DataType dt = property.getDataType(); Object logical = dt.getLogical(); if (logical instanceof XMLType && logical != XMLType.UNKNOWN) { XMLType xmlType = (XMLType)logical; property.setXSDType(xmlType.getTypeName()); property.setXSDElement(xmlType.getElementName()); } else { Class<?> baseType = JavaIntrospectionHelper.getBaseType(element.getType(), element.getGenericType()); QName typeName = JavaXMLMapper.getXMLType(baseType); property.setXSDType(typeName); } } super.visitEnd(clazz, type); }