private boolean isSimpleType(Property property) { if (property.getXSDType() != null) { return simpleTypeMapper.isSimpleXSDType(property.getXSDType()); } else { if (property instanceof Document) { Document doc = (Document)property; Element element = doc.getDocumentElement(); if (element.getChildNodes().getLength() == 1 && element.getChildNodes().item(0).getNodeType() == Node.TEXT_NODE) { return true; } } } return false; }
/** * * @param property * @return */ private boolean isSimpleType(Property property) { if (property.getXSDType() != null) { return simpleTypeMapper.isSimpleXSDType(property.getXSDType()); } else { if (property instanceof Document) { Document doc = (Document)property; Element element = doc.getDocumentElement(); if (element.getChildNodes().getLength() == 1 && element.getChildNodes().item(0).getNodeType() == Element.TEXT_NODE) { return true; } } } return false; }
public List<?> getInstance() throws ObjectCreationException { if (isSimpleType) { List<Object> values = new ArrayList<Object>(); for (String aValue : (List<String>)propertyValue) { values.add(simpleTypeMapper.toJavaObject(property.getXSDType(), aValue, null)); } return values; } else { List<Object> instances = new ArrayList<Object>(); for (Node aValue : (List<Node>)propertyValue) { instances.add(mediator.mediate(aValue, sourceDataType, targetDataType, null)); } return instances; } } }
public Object getInstance() throws ObjectCreationException { if (isSimpleType) { return simpleTypeMapper.toJavaObject(property.getXSDType(), (String)propertyValue, null); } else { return mediator.mediate(propertyValue, sourceDataType, targetDataType, null); } } }
sourceDataType = new DataTypeImpl<XMLType>(DOMDataBinding.NAME, Node.class, new XMLType(null, this.property.getXSDType())); if (this.property.getXSDType() != null) { if (simpleTypeMapper.isSimpleXSDType(this.property.getXSDType())) { typeInfo = new TypeInfo(property.getXSDType(), true, null); } else { typeInfo = new TypeInfo(property.getXSDType(), false, null); typeInfo = new TypeInfo(property.getXSDType(), false, null);
if (property.getXSDType() != null && property.getXSDType().getNamespaceURI().equals("http://www.w3.org/2001/XMLSchema") != true){ XSDefinition xsdDefinition = xsdFactory.createXSDefinition(); xsdDefinition.setUnresolved(true); xsdDefinition.setNamespace(property.getXSDType().getNamespaceURI()); warning(context.getMonitor(), "PropertyTypeNotFound", property, property.getXSDType().toString(), property.getName(), parentName); } else {
if (property.getXSDType() != null && property.getXSDType().getNamespaceURI().equals("http://www.w3.org/2001/XMLSchema") != true){ XSDefinition xsdDefinition = xsdFactory.createXSDefinition(); xsdDefinition.setUnresolved(true); xsdDefinition.setNamespace(property.getXSDType().getNamespaceURI()); warning(context.getMonitor(), "PropertyTypeNotFound", property, property.getXSDType().toString(), property.getName(), parentName); } else {
for (String aValue : (List<String>)propertyValue) { try { Array.set(values, count++, simpleTypeMapper.toJavaObject(property.getXSDType(), aValue, null)); } catch (NumberFormatException ex) { throw new ObjectCreationException("Failed to create instance for property " + property
for (String aValue : (List<String>)propertyValue) { try { values.add(simpleTypeMapper.toJavaObject(property.getXSDType(), aValue, null)); } catch (NumberFormatException ex) { throw new ObjectCreationException("Failed to create instance for property " + property
public Object getInstance() throws ObjectCreationException { // TUSCANY-3791 if (result != null){ return result; } if (isSimpleType) { try { result = simpleTypeMapper.toJavaObject(property.getXSDType(), (String)propertyValue, null); } catch (NumberFormatException ex) { throw new ObjectCreationException("Failed to create instance for property " + property.getName() + " with value " + propertyValue, ex); } catch (IllegalArgumentException ex) { throw new ObjectCreationException("Failed to create instance for property " + property.getName() + " with value " + propertyValue, ex); } } else { result = mediator.mediate(propertyValue, sourceDataType, targetDataType, null); } return result; } }
componentProperty.setXSDType(componentTypeProperty.getXSDType()); componentTypeProperty.getXSDType() != null && !componentProperty.getXSDType().equals(componentTypeProperty.getXSDType())){ Monitor.error(monitor, this, component.getName(), componentProperty.getName(), componentProperty.getXSDType(), componentTypeProperty.getXSDType());
componentProperty.setXSDType(componentTypeProperty.getXSDType()); componentTypeProperty.getXSDType() != null && !componentProperty.getXSDType().equals(componentTypeProperty.getXSDType())){ Monitor.error(monitor, this, component.getName(), componentProperty.getName(), componentProperty.getXSDType(), componentTypeProperty.getXSDType());
private void addPropertiesFromComponentType(Component component, Monitor monitor) { // Create component property for each property if (component.getImplementation() != null) { for (Property property : component.getImplementation().getProperties()) { // check for duplicate property names in implementation if (property != component.getImplementation().getProperty(property.getName())){ Monitor.error(monitor, this, Messages.ASSEMBLY_VALIDATION, "DuplicateImplementationPropertyName", component.getName(), property.getName()); } ComponentProperty componentProperty = (ComponentProperty)component.getProperty(property.getName()); // if the component doesn't have a property with the same name as // the component type property then create one if (componentProperty == null) { componentProperty = assemblyFactory.createComponentProperty(); componentProperty.setName(property.getName()); componentProperty.setValue(property.getValue()); componentProperty.setMany(property.isMany()); componentProperty.setMustSupply(property.isMustSupply()); componentProperty.setXSDElement(property.getXSDElement()); componentProperty.setXSDType(property.getXSDType()); componentProperty.setProperty(property); component.getProperties().add(componentProperty); } } } }
private void addPropertiesFromComponentType(Component component, Monitor monitor) { // Create component property for each property if (component.getImplementation() != null) { for (Property property : component.getImplementation().getProperties()) { // check for duplicate property names in implementation if (property != component.getImplementation().getProperty(property.getName())){ Monitor.error(monitor, this, Messages.ASSEMBLY_VALIDATION, "DuplicateImplementationPropertyName", component.getName(), property.getName()); } ComponentProperty componentProperty = (ComponentProperty)component.getProperty(property.getName()); // if the component doesn't have a property with the same name as // the component type property then create one if (componentProperty == null) { componentProperty = assemblyFactory.createComponentProperty(); componentProperty.setName(property.getName()); componentProperty.setValue(property.getValue()); componentProperty.setMany(property.isMany()); componentProperty.setMustSupply(property.isMustSupply()); componentProperty.setXSDElement(property.getXSDElement()); componentProperty.setXSDType(property.getXSDType()); componentProperty.setProperty(property); component.getProperties().add(componentProperty); } } } }
componentProperty.setXSDType(property.getXSDType());
componentProperty.setXSDType(property.getXSDType());
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()), policyProcessor.writePolicies(property)); 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()), policyProcessor.writePolicies(property)); writePropertyValue(property.getValue(), property.getXSDElement(), property.getXSDType(), writer);
componentProperty.setXSDType(sourceProp.getXSDType());