Package org.apache.uima.internal.util

Examples of org.apache.uima.internal.util.XmlElementName


    if (oed == null) {
      oed = new OotsElementData();
      this.ootsFeatures.put(key, oed);
    }
    Iterator<String> iter = featVals.iterator();
    XmlElementName elemName = new XmlElementName(null,featName,featName);
    while (iter.hasNext()) {
      oed.childElements.add(new XmlElementNameAndContents(elemName, iter.next()));
    }
  } 
View Full Code Here


      }
      if (membersString.length() > 0) {
        // remove trailing space before adding to attributes
        addAttribute(workAttrs, "members", membersString.substring(0, membersString.length() - 1));
      }
      XmlElementName elemName = uimaTypeName2XmiElementName("uima.cas.View");
      startElement(elemName, workAttrs, 0);
      endElement(elemName);
    }
View Full Code Here

     *
     */
    private void writeNullObject() throws SAXException {
      workAttrs.clear();
      addAttribute(workAttrs, ID_ATTR_NAME, "0");
      XmlElementName elemName = uimaTypeName2XmiElementName("uima.cas.NULL");
      startElement(elemName, workAttrs, 0);
      endElement(elemName);
    }
View Full Code Here

      addAttribute(workAttrs, ID_ATTR_NAME, getXmiId(addr));

      // generate the XMI name for the type (uses a precomputed array so we don't
      // recompute the same name multiple times).
      int typeCode = cas.getHeapValue(addr);
      XmlElementName xmlElementName = xmiTypeNames[typeCode];

      // Call special code according to the type of the FS (special treatment
      // for arrays and lists).
      final int typeClass = classifyType(typeCode);
      switch (typeClass) {
View Full Code Here

              String[] array = listUtils.stringListToStringArray(featVal);
              if (array.length > 0 && !arrayAndListFSs.put(featVal, featVal)) {
                reportWarning("Warning: multiple references to a ListFS.  Reference identity will not be preserved.");
              }
              for (int j = 0; j < array.length; j++) {
                childElements.add(new XmlElementNameAndContents(new XmlElementName(null, featName,
                        featName), array[j]));
              }
              attrValue = null;
            }
            break;
View Full Code Here

        reportWarning("Warning: multiple references to a String array.  Reference identity will not be preserved.");
      }
      int pos = cas.getArrayStartAddress(addr);
      for (int j = 0; j < size; j++) {
        String s = cas.getStringForCode(cas.getHeapValue(pos));
        resultList.add(new XmlElementNameAndContents(new XmlElementName(null, featName, featName),
                s));
        ++pos;
      }
    }
View Full Code Here

        }
        nsUriToPrefixMap.put(nsUri, prefix);
        nsPrefixesUsed.add(prefix);
      }

      return new XmlElementName(nsUri, shortName, prefix + ':' + shortName);
    }
View Full Code Here

    if (oed == null) {
      oed = new OotsElementData();
      this.ootsFeatures.put(key, oed);
    }
    Iterator iter = featVals.iterator();
    XmlElementName elemName = new XmlElementName(null,featName,featName);
    while (iter.hasNext()) {
      oed.childElements.add(new XmlElementNameAndContents(elemName, (String)iter.next()));
    }
  } 
View Full Code Here

          if (href != null && href.startsWith("#")) {          
            //for out-of-typesystem objects, there's special handling here
            //to keep track of the fact this was an href so we re-serialize
            //correctly.
            if (this.outOfTypeSystemElement != null) {
              XmlElementName elemName = new XmlElementName(nameSpaceURI, localName, qualifiedName);
              List ootsAttrs = new ArrayList();
              ootsAttrs.add(new XmlAttribute("href", href));
              XmlElementNameAndContents elemWithContents = new XmlElementNameAndContents(elemName, null, ootsAttrs);
              this.outOfTypeSystemElement.childElements.add(elemWithContents);
            }
View Full Code Here

        // type is not in our type system
        if (!lenient) {
          throw createException(XCASParsingException.UNKNOWN_TYPE, typeName);
        } else {
          addToOutOfTypeSystemData(
              new XmlElementName(nameSpaceURI, localName, qualifiedName), attrs);                 
        }
        return;
      } else if (casBeingFilled.isArrayType(currentType)) {
        // store ID and array values (if specified as attribute).
        // we will actually create the array later, in endElement.
View Full Code Here

TOP

Related Classes of org.apache.uima.internal.util.XmlElementName

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.