Package org.apache.oodt.profile

Examples of org.apache.oodt.profile.EnumeratedProfileElement


  }

  public EnumeratedProfileElement extractEnumeratedProfileElement(String elemName, String varname,
      Profile profile, DAS das)
      throws NoSuchAttributeException {
    EnumeratedProfileElement elem = new EnumeratedProfileElement(profile);
    elem.setName(elemName);

    AttributeTable attTable = null;
    try {
      attTable = das.getAttributeTable(elemName);
    } catch (NoSuchAttributeException e) {
      LOG.log(Level.WARNING, "Error extracting attribute table for element: ["
          + elemName + "]: Message: " + e.getMessage());
      throw e;

    }

    Enumeration attributeNames = attTable.getNames();
    while (attributeNames.hasMoreElements()) {
      String attrName = (String) attributeNames.nextElement();
      Attribute attr = attTable.getAttribute(attrName);
      Enumeration attrValues = null;
      try {
        attrValues = attr.getValues();
      } catch (NoSuchAttributeException e) {
        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)) {
          String[] vals = attrValue.split(" ");
          elem.getValues().addAll(Arrays.asList(vals));
        } else if (attrName.equals(UNITS)) {
          elem.setUnit(attrValue);
        } else {
          elem.getValues().add(attrValue);
        }
      }

    }
View Full Code Here

TOP

Related Classes of org.apache.oodt.profile.EnumeratedProfileElement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.