Author: luca
Date: Tue May 29 16:39:34 2012
New Revision: 1343834
URL: http://svn.apache.org/viewvc?rev=1343834&view=rev
Log:
Protecting metadata extraction versus attributes that are containers
Modified:
oodt/trunk/opendapps/src/main/java/org/apache/oodt/opendapps/OpendapProfileElementExtractor.java
Modified:
oodt/trunk/opendapps/src/main/java/org/apache/oodt/opendapps/OpendapProfileElementExtractor.java
URL:
http://svn.apache.org/viewvc/oodt/trunk/opendapps/src/main/java/org/apache/oodt/opendapps/OpendapProfileElementExtractor.java?rev=1343834&r1=1343833&r2=1343834&view=diff
==============================================================================
---
oodt/trunk/opendapps/src/main/java/org/apache/oodt/opendapps/OpendapProfileElementExtractor.java
(original)
+++
oodt/trunk/opendapps/src/main/java/org/apache/oodt/opendapps/OpendapProfileElementExtractor.java
Tue May 29 16:39:34 2012
@@ -68,32 +68,38 @@ public class OpendapProfileElementExtrac
while (attributeNames.hasMoreElements()) {
String attrName = (String) attributeNames.nextElement();
Attribute attr = attTable.getAttribute(attrName);
- Enumeration attrValues = null;
- try {
- attrValues = attr.getValues();
- } catch (NoSuchAttributeException e) {
- e.printStackTrace();
- LOG.log(Level.WARNING, "Attempt to resolve attribute: [" + attrName
- + "] failed: Message: " + e.getMessage());
- continue;
- }
-
- while (attrValues.hasMoreElements()) {
- String attrValue = (String) attrValues.nextElement();
- if (attrName.equals(ACTUAL_RANGE)) {
- elem.setMinValue(attrValue);
- if (attrValues.hasMoreElements()) {
- elem.setMaxValue((String) attrValues.nextElement());
+
+ if (!attr.isContainer()) {
+ Enumeration attrValues = null;
+
+ try {
+ attrValues = attr.getValues();
+ } catch (NoSuchAttributeException e) {
+ e.printStackTrace();
+ LOG.log(Level.WARNING, "Attempt to resolve attribute: [" + attrName
+ + "] failed: Message: " + e.getMessage());
+ continue;
+ }
+
+ while (attrValues.hasMoreElements()) {
+ String attrValue = (String) attrValues.nextElement();
+ if (attrName.equals(ACTUAL_RANGE)) {
+ elem.setMinValue(attrValue);
+ if (attrValues.hasMoreElements()) {
+ elem.setMaxValue((String) attrValues.nextElement());
+ }
+ } else if (attrName.equals(UNITS)) {
+ elem.setUnit(attrValue);
+ } else if (attrName.equals(START)) {
+ elem.setMinValue(attrValue);
+ } else if (attrName.equals(END)) {
+ elem.setMaxValue(attrValue);
}
- } else if (attrName.equals(UNITS)) {
- elem.setUnit(attrValue);
- } else if (attrName.equals(START)) {
- elem.setMinValue(attrValue);
- } else if (attrName.equals(END)) {
- elem.setMaxValue(attrValue);
}
}
- }
+
+ } // not a container attribute
+
return elem;
}