/** * Look to see if any value elements have been set into the property * A bit involved as the value is stored as a DOM Document * * @param property the property to be tested * @return true is values are present */ private boolean isPropertyValueSet(Property property) { Document value = (Document)property.getValue(); if (value == null) { return false; } if (value.getDocumentElement() == null) { return false; } if (value.getDocumentElement().getChildNodes().getLength() == 0) { return false; } return true; }
/** * Look to see if any value elements have been set into the property * A bit involved as the value is stored as a DOM Document * * @param property the property to be tested * @return true is values are present */ private boolean isPropertyValueSet(Property property) { Document value = (Document)property.getValue(); if (value == null) { return false; } if (value.getDocumentElement() == null) { return false; } if (value.getDocumentElement().getChildNodes().getLength() == 0) { return false; } return true; }
/** * Look to see is a property has more than one value * * @param property * @return true is the property has more than one value */ private boolean isPropertyManyValued(Property property) { if (isPropertyValueSet(property)){ Document value = (Document)property.getValue(); if (value.getDocumentElement().getChildNodes().getLength() > 1){ return true; } } return false; }
/** * Look to see is a property has more than one value * * @param property * @return true is the property has more than one value */ private boolean isPropertyManyValued(Property property) { if (isPropertyValueSet(property)){ Document value = (Document)property.getValue(); if (value.getDocumentElement().getChildNodes().getLength() > 1){ return true; } } return false; }
@Override public Object getValue() { if (super.getValue() == null && property != null) { return property.getValue(); } else { return super.getValue(); } }
@Override public Object getValue() { if (super.getValue() == null && property != null) { return property.getValue(); } else { return super.getValue(); } }
public ObjectFactory createValueFactory(Property property) { isSimpleType = isSimpleType(property); Document doc = (Document)property.getValue(); Element rootElement = doc.getDocumentElement();
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.setValue(componentTypeProperty.getValue());
componentProperty.setValue(componentTypeProperty.getValue());
} else { Document sourcePropValue = (Document)sourceProp.getValue();
} else { Document sourcePropValue = (Document)sourceProp.getValue();
writePropertyValue(property.getValue(), property.getXSDElement(), property.getXSDType(), writer);
writePropertyValue(property.getValue(), property.getXSDElement(), property.getXSDType(), writer);
writePropertyValue(property.getValue(), property.getXSDElement(), property.getXSDType(), writer);
writePropertyValue(property.getValue(), property.getXSDElement(), property.getXSDType(), writer);