public ComponentProperty getProperty(String name) { for (ComponentProperty property : getProperties()) { if (property.getName().equals(name)) { return property; } } return null; }
public ComponentProperty getProperty(String name) { for (ComponentProperty property : getProperties()) { if (property.getName().equals(name)) { return property; } } return null; }
public static Object getProperty(String name, ServletContext sc) { RuntimeComponent rc = (RuntimeComponent)sc.getAttribute(COMPONENT_ATTR); for (ComponentProperty p : rc.getProperties()) { if (name.equals(p.getName())) { return p.getValue(); } } return null; }
public static Object getProperty(String name, ServletContext sc) { RuntimeComponent rc = (RuntimeComponent)sc.getAttribute(COMPONENT_ATTR); for (ComponentProperty p : rc.getProperties()) { if (name.equals(p.getName())) { return p.getValue(); } } return null; }
/** * Generate JavaScript code to inject SCA Properties * @param pw * @throws IOException */ private static void generateJavaScriptPropertyFunction(RuntimeComponent component, PrintWriter pw) throws IOException { pw.println("__tuscany.sca.propertyMap = {};"); for(ComponentProperty property : component.getProperties()) { String propertyName = property.getName(); pw.println("__tuscany.sca.propertyMap." + propertyName + " = new String(\"" + getPropertyValue(property) + "\");"); } pw.println("tuscany.sca.Property = function (name) {"); pw.println(" return __tuscany.sca.propertyMap[name];"); pw.println("}"); }
public Object getPropertyObj(Class<?> type, String name) { List<ComponentProperty> props = component.getProperties(); for (ComponentProperty prop : props) { if (prop.getName().equals(name)) { return propertyFactory.createPropertyValue(prop, type); } } return null; // property name not found } }
/** * Gets the value for the specified property with the specified type. * * @param type The type of the property value we are getting * @param propertyName The name of the property we are getting * @param B The class of the property value we are getting * * @throws ServiceRuntimeException If a Property for the specified propertyName * is not found * * @see #setPropertyValueFactory(PropertyValueFactory) */ public <B> B getProperty(Class<B> type, String propertyName) { for (ComponentProperty p : component.getProperties()) { if (propertyName.equals(p.getName())) { return propertyFactory.createPropertyValue(p, type); } } throw new IllegalArgumentException("Property not found: " + propertyName); }
/** * Method to create a Java Bean for a Property value * @param <B> the class type of the Bean * @param requiredType - a Class object for the required type * @param name - the Property name * @return - a Bean of the specified property, with value set */ private <B> B getPropertyBean(Class<?> requiredType, String name) { B propertyObject = null; // Get the component's list of properties List<ComponentProperty> props = component.getProperties(); for (ComponentProperty prop : props) { if (prop.getName().equals(name)) { // On finding the property, create a factory for it and create a Bean using // the factory propertyObject = (B)propertyFactory.createPropertyValue(prop, requiredType); } // end if } // end for return propertyObject; }
Element toElement = bpelDOM.createElementNS(NS_URI, "to"); Attr variableAttribute = bpelDOM.createAttribute("variable"); variableAttribute.setValue( property.getName() ); toElement.setAttributeNode( variableAttribute ); Element copyElement = bpelDOM.createElementNS(NS_URI, "copy");
if (componentProperty != component.getProperty(componentProperty.getName())){ Monitor.error(monitor, this, Messages.ASSEMBLY_VALIDATION, "DuplicateComponentPropertyName", component.getName(), componentProperty.getName()); Property property = component.getImplementation().getProperty(componentProperty.getName()); "PropertyNotFound", component.getName(), componentProperty.getName());
if (componentProperty != component.getProperty(componentProperty.getName())){ Monitor.error(monitor, this, Messages.ASSEMBLY_VALIDATION, "DuplicateComponentPropertyName", component.getName(), componentProperty.getName()); Property property = component.getImplementation().getProperty(componentProperty.getName()); "PropertyNotFound", component.getName(), componentProperty.getName());
Messages.ASSEMBLY_VALIDATION, "PropertyValueDoesNotMatchSimpleType", componentProperty.getName(), component.getName(), componentProperty.getXSDType().toString()); Messages.ASSEMBLY_VALIDATION, "PropertyValueDoesNotMatchComplexType", componentProperty.getName(), component.getName(), componentProperty.getXSDType().toString(),
Messages.ASSEMBLY_VALIDATION, "PropertyValueDoesNotMatchSimpleType", componentProperty.getName(), component.getName(), componentProperty.getXSDType().toString()); Messages.ASSEMBLY_VALIDATION, "PropertyValueDoesNotMatchComplexType", componentProperty.getName(), component.getName(), componentProperty.getXSDType().toString(),
private void configureProperty(ComponentProperty configuredProperty) { JavaElementImpl element = instanceFactoryProvider.getImplementation().getPropertyMembers().get(configuredProperty.getName());
"PropertyMustSupplyIncompatible", component.getName(), componentProperty.getName()); "PropertyOverrideManyAttribute", component.getName(), componentProperty.getName()); "PropertXSDElementsDontMatch", component.getName(), componentProperty.getName(), componentProperty.getXSDElement(), componentTypeProperty.getXSDElement()); "PropertXSDTypesDontMatch", component.getName(), componentProperty.getName(), componentProperty.getXSDType(), componentTypeProperty.getXSDType());
"PropertyMustSupplyIncompatible", component.getName(), componentProperty.getName()); "PropertyOverrideManyAttribute", component.getName(), componentProperty.getName()); "PropertXSDElementsDontMatch", component.getName(), componentProperty.getName(), componentProperty.getXSDElement(), componentTypeProperty.getXSDElement()); "PropertXSDTypesDontMatch", component.getName(), componentProperty.getName(), componentProperty.getXSDType(), componentTypeProperty.getXSDType());