}
return getPropertyValueByName(propNodeList.get(0).getItem(), propName);
}
-
+
public static List<PropertyItemType> getPropertyValueListByNameFromNodeList(List<PropertyType> propNodeList,
String propName) {
if (propNodeList == null || propNodeList.isEmpty()) {
return result;
}
-
+
/**
* @param propList the list of properties.
* @param propName the property to fetch
}
return null;
}
-
+
/**
* @param propNodeList the JAXB wrapping node of for the list to search for the named property
* @param propName the name of the property of interest
List<PropertyType> propNodeList, String propName, String qualPrefix) {
return getPropertyValuesByNameInNodeList(propNodeList, propName, qualPrefix, null);
}
-
+
/**
* @param propNodeList the JAXB wrapping node of for the list to search for the named property
* @param propName the name of the property of interest
values = new ArrayList<String>();
return values;
}
- return getPropertyValuesByName(propNodeList.get(0).getItem(),
+ return getPropertyValuesByName(propNodeList.get(0).getItem(),
propName, qualPrefix, values);
}
-
+
/**
* @param propNodeList the Item list to search for the named property
* @param propName the name of the property of interest
List<PropertyItemType> propItems, String propName, String qualPrefix) {
return getPropertyValuesByName(propItems, propName, qualPrefix, null);
}
-
- /**
- * @param propNodeList the Item list to search for the named property
- * @param propName the name of the property of interest
- * @param qualPrefix a namespace qualifier prefix (with ':') to prepend, or null
- * @param values and existing list to append values to. If null, a new one will be created.
- * @return values, or that is null, a new List of string values found for the named property
- */
- public static List<String> getPropertyValuesByName(
- List<PropertyItemType> propItems, String propName, String qualPrefix,
- List<String> values ) {
- if(values==null)
- values = new ArrayList<String>();
- for(PropertyItemType propItem:propItems) {
- if(propName.equals(propItem.getKey())) {
- // TODO - the trim() belongs here, not down a few lines.
- String value = propItem.getValue();
- if(value!=null) {
- values.add((qualPrefix!=null)?(qualPrefix+value):value.trim());
- }
- }
- }
- return values;
- }
+
+ /**
+ * @param propNodeList the Item list to search for the named property
+ * @param propName the name of the property of interest
+ * @param qualPrefix a namespace qualifier prefix (with ':') to prepend, or null
+ * @param values and existing list to append values to. If null, a new one will be created.
+ * @return values, or that is null, a new List of string values found for the named property
+ */
+ public static List<String> getPropertyValuesByName(
+ List<PropertyItemType> propItems, String propName, String qualPrefix,
+ List<String> values ) {
+
+ if (values == null) {
+ values = new ArrayList<String>();
+ }
+
+ if (propItems != null) {
+ for (PropertyItemType propItem : propItems) {
+ if (propName.equals(propItem.getKey())) {
+ // TODO - the trim() belongs here, not down a few lines.
+ String value = propItem.getValue();
+
+ if (value != null) {
+ values.add((qualPrefix != null) ? (qualPrefix + value) : value.trim());
+ }
+ }
+ }
+ }
+
+ return values;
+ }
/**
* @param propNodeList the wrapping list node from JAXB
List<PropertyItemType> propList = propNodeList.get(0).getItem();
return setPropertyValue(propList, propName, value, onlyIfNotSet);
}
-
+
/**
* @param propName the property to set
* @param value the new value to set
}
return valueSet;
}
-
+
}