Logo Search packages:      
Sourcecode: uimaj version File versions  Download package

void org::apache::uima::resource::metadata::impl::MetaDataObject_impl::setSourceUrl ( URL  aUrl ) [inline, inherited]

Sets the URL from which this object was parsed. Typically only the XML parser sets this. This recursively sets the source URL of all descendants of this object.

Parameters:
aUrlthe location of the XML file from which this object was parsed

Implements org::apache::uima::resource::metadata::MetaDataObject.

Definition at line 285 of file MetaDataObject_impl.java.

                                     {
    mSourceUrl = aUrl;

    // set recursively on subobjects
    List<NameClassPair> attrs = listAttributes();
    Iterator<NameClassPair> i = attrs.iterator();
    while (i.hasNext()) {
      String attrName = ((NameClassPair) i.next()).getName();
      Object val = getAttributeValue(attrName);
      if (val instanceof MetaDataObject_impl) {
        ((MetaDataObject_impl) val).setSourceUrl(aUrl);
      } else if (val != null && val.getClass().isArray()) {
        int len = Array.getLength(val);
        for (int j = 0; j < len; j++) {
          Object arrayElem = Array.get(val, j);
          if (arrayElem instanceof MetaDataObject_impl) {
            ((MetaDataObject_impl) arrayElem).setSourceUrl(aUrl);
          }
        }
      } else if (val instanceof Map) {
        Iterator valIter = ((Map) val).values().iterator();
        while (valIter.hasNext()) {
          Object mapVal = valIter.next();
          if (mapVal instanceof MetaDataObject_impl) {
            ((MetaDataObject_impl) mapVal).setSourceUrl(aUrl);
          }
        }
      }
    }
  }

Generated by  Doxygen 1.6.0   Back to index