public ObjectFactory createValueFactory(Property property, Object propertyValue, Class<?> javaType) { Document doc = (Document)propertyValue; List<Node> nodes = getValues(doc); if (property.isMany()) { return new ListObjectFactoryImpl(property, nodes, javaType); } else { Object value = null; if (!nodes.isEmpty()) { value = nodes.get(0); } return new ObjectFactoryImpl(property, value, javaType); } }
if (property.isMany()) { if (isSimpleType) { String value = "";
public ObjectFactory createValueFactory(Property property, Object propertyValue, JavaElementImpl javaElement) { Document doc = (Document)propertyValue; List<Node> nodes = getValues(doc); Class<?> javaType = JavaIntrospectionHelper.getBaseType(javaElement.getType(), javaElement.getGenericType()); if (property.isMany()) { if (javaElement.getType().isArray()) { return new ArrayObjectFactoryImpl(property, nodes, javaType); } else { return new ListObjectFactoryImpl(property, nodes, javaType); } } else { Object value = null; if (!nodes.isEmpty()) { value = nodes.get(0); } return new ObjectFactoryImpl(property, value, javaType); } }
Document value = readPropertyValue(property.getXSDElement(), property.getXSDType(), property.isMany(), reader, context); property.setValue(value);
Document value = readPropertyValue(property.getXSDElement(), property.getXSDType(), property.isMany(), reader, context); property.setValue(value);
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); } } } }
new XAttr(NAME, property.getName()), new XAttr(MUST_SUPPLY, property.isMustSupply()), new XAttr(MANY, property.isMany()), new XAttr(TYPE, property.getXSDType()), new XAttr(ELEMENT, property.getXSDElement()),
new XAttr(NAME, property.getName()), new XAttr(MUST_SUPPLY, property.isMustSupply()), new XAttr(MANY, property.isMany()), new XAttr(TYPE, property.getXSDType()), new XAttr(ELEMENT, property.getXSDElement()),
new XAttr(NAME, property.getName()), new XAttr(MUST_SUPPLY, property.isMustSupply()), new XAttr(MANY, property.isMany()), new XAttr(TYPE, property.getXSDType()), new XAttr(ELEMENT, property.getXSDElement()),
new XAttr(NAME, property.getName()), new XAttr(MUST_SUPPLY, property.isMustSupply()), new XAttr(MANY, property.isMany()), new XAttr(TYPE, property.getXSDType()), new XAttr(ELEMENT, property.getXSDElement()),