public OSGiProperty createOSGiProperty() {
return new OSGiPropertyImpl();
}
public OSGiProperty createOSGiProperty(String propName, String propValue, String propType) {
OSGiProperty prop = new OSGiPropertyImpl();
if (propType == null) {
propType = "String";
}
prop.setName(propName);
prop.setStringValue(propValue);
prop.setType(propType);
Object value = propValue;
if ("Integer".equals(propType)) {
value = Integer.valueOf(propValue);
} else if ("Long".equals(propType)) {
value = Long.valueOf(propValue);
} else if ("Float".equals(propType)) {
value = Float.valueOf(propValue);
} else if ("Double".equals(propType)) {
value = Double.valueOf(propValue);
} else if ("Short".equals(propType)) {
value = Short.valueOf(propValue);
} else if ("Character".equals(propType)) {
value = propValue.charAt(0);
} else if ("Byte".equals(propType)) {
value = Byte.valueOf(propValue);
} else if ("Boolean".equals(propType)) {
value = Boolean.valueOf(propValue);
} else if ("String+".equals(propType)) {
value = propValue.split(" ");
} else {
// String
value = propValue;
}
prop.setValue(value);
return prop;
}