QName type = property.getXSDType(); if( type != null ) { if( mapper.isSimpleXSDType( type ) ) {
private <B> void validateTypes(ComponentProperty property, Class<B> type) { // JAXB seems to do some strange things with conversions, so // we can't rely on the databinding conversion from Node->Java to catch // incompatible types. DataType prop1 = property.getProperty().getDataType(); if ( (prop1 != null) && (type.isAssignableFrom(prop1.getPhysical())) ) { return; } else if ( simpleTypeMapper.getXMLType(type) != null ) { if ( simpleTypeMapper.getXMLType(type).getQName().equals(property.getXSDType())) return; } else if ( isSimpleType(property) ) { if ( type.isAssignableFrom(simpleTypeMapper.getJavaType(property.getXSDType()))) return; } throw new IllegalArgumentException("Property type " + prop1.getPhysical().getName() + " is not compatible with " + type.getName()); }
QName propertyXSDType = componentProperty.getXSDType(); QName propertyElementType = componentProperty.getXSDElement(); DataType<XMLType> sourceDataType = new DataTypeImpl<XMLType>(DOMDataBinding.NAME, Node.class, new XMLType(null, componentProperty.getXSDType())); DataType<XMLType> targetDataType = new DataTypeImpl<XMLType>(JAXBDataBinding.NAME, Object.class, new XMLType(null, componentProperty.getXSDType())); try { mediator.mediate(source, sourceDataType, targetDataType, null); componentProperty.getName(), component.getName(), componentProperty.getXSDType().toString()); if (componentProperty.getXSDType().getNamespaceURI().equals(Constants.SCA11_NS)){ "xmlns:__tmp=\"" + componentProperty.getXSDType().getNamespaceURI() + "\" "+ "targetNamespace=\"http://docs.oasis-open.org/ns/opencsa/sca/200912\" " + "elementFormDefault=\"qualified\">" + "<schema xmlns=\"http://www.w3.org/2001/XMLSchema\" "+ "xmlns:sca=\"http://docs.oasis-open.org/ns/opencsa/sca/200912\" "+ "xmlns:__tmp=\"" + componentProperty.getXSDType().getNamespaceURI() + "\" "+ "targetNamespace=\"http://docs.oasis-open.org/ns/opencsa/sca/200912\" " + "elementFormDefault=\"qualified\">" + "<import namespace=\"" + componentProperty.getXSDType().getNamespaceURI() + "\"/>" + "<element name=\"value\" type=\"" + "__tmp:" + componentProperty.getXSDType().getLocalPart() + "\"/>" +
QName propertyXSDType = componentProperty.getXSDType(); QName propertyElementType = componentProperty.getXSDElement(); DataType<XMLType> sourceDataType = new DataTypeImpl<XMLType>(DOMDataBinding.NAME, Node.class, new XMLType(null, componentProperty.getXSDType())); DataType<XMLType> targetDataType = new DataTypeImpl<XMLType>(JAXBDataBinding.NAME, Object.class, new XMLType(null, componentProperty.getXSDType())); try { mediator.mediate(source, sourceDataType, targetDataType, null); componentProperty.getName(), component.getName(), componentProperty.getXSDType().toString()); if (componentProperty.getXSDType().getNamespaceURI().equals(Constants.SCA11_NS)){ "xmlns:__tmp=\"" + componentProperty.getXSDType().getNamespaceURI() + "\" "+ "targetNamespace=\"http://docs.oasis-open.org/ns/opencsa/sca/200912\" " + "elementFormDefault=\"qualified\">" + "<schema xmlns=\"http://www.w3.org/2001/XMLSchema\" "+ "xmlns:sca=\"http://docs.oasis-open.org/ns/opencsa/sca/200912\" "+ "xmlns:__tmp=\"" + componentProperty.getXSDType().getNamespaceURI() + "\" "+ "targetNamespace=\"http://docs.oasis-open.org/ns/opencsa/sca/200912\" " + "elementFormDefault=\"qualified\">" + "<import namespace=\"" + componentProperty.getXSDType().getNamespaceURI() + "\"/>" + "<element name=\"value\" type=\"" + "__tmp:" + componentProperty.getXSDType().getLocalPart() + "\"/>" +
if (componentProperty.getXSDType() == null) { componentProperty.setXSDType(componentTypeProperty.getXSDType()); if ( componentProperty.getXSDType() != null && componentTypeProperty.getXSDType() != null && !componentProperty.getXSDType().equals(componentTypeProperty.getXSDType())){ Monitor.error(monitor, this,
if (componentProperty.getXSDType() == null) { componentProperty.setXSDType(componentTypeProperty.getXSDType()); if ( componentProperty.getXSDType() != null && componentTypeProperty.getXSDType() != null && !componentProperty.getXSDType().equals(componentTypeProperty.getXSDType())){ Monitor.error(monitor, this,
componentProperty.setXSDElement(property.getXSDElement()); if (componentProperty.getXSDType() == null){ componentProperty.setXSDType(property.getXSDType());
componentProperty.setXSDElement(property.getXSDElement()); if (componentProperty.getXSDType() == null){ componentProperty.setXSDType(property.getXSDType());
if (componentProperty.getXSDElement() == null && componentProperty.getXSDType() == null) { Monitor.error(monitor, this,
if (componentProperty.getXSDElement() == null && componentProperty.getXSDType() == null) { Monitor.error(monitor, this,
componentProperty.setXSDElement(sourceProp.getXSDElement()); if(componentProperty.getXSDType() == null){ componentProperty.setXSDType(sourceProp.getXSDType());
componentProperty.setXSDElement(sourceProp.getXSDElement()); if(componentProperty.getXSDType() == null){ componentProperty.setXSDType(sourceProp.getXSDType());
new XAttr(MUST_SUPPLY, property.isMustSupply()), new XAttr(MANY, property.isMany()), new XAttr(TYPE, property.getXSDType()), new XAttr(ELEMENT, property.getXSDElement()), new XAttr(SOURCE, property.getSource()), writePropertyValue(property.getValue(), property.getXSDElement(), property.getXSDType(), writer);
new XAttr(MUST_SUPPLY, property.isMustSupply()), new XAttr(MANY, property.isMany()), new XAttr(TYPE, property.getXSDType()), new XAttr(ELEMENT, property.getXSDElement()), new XAttr(SOURCE, property.getSource()), writePropertyValue(property.getValue(), property.getXSDElement(), property.getXSDType(), writer);