IPropertyName myPropertyName = PropertyName.getPN("http://sapportals.com/xmlns/cm", "MyProperty");
IProperty myProperty = resource.getProperty(myPropertyName);
if (myProperty != null) {
String myPropertyValue = myProperty.getStringValue();
}
Easy?Now what if the MyProperty is Multi-Valued? Here is the code.
List values = property.getValues();
for (Iterator valuesIterator = values.iterator(); valuesIterator.hasNext();) {
String element = (String) valuesIterator.next();
}
No comments:
Post a Comment