public InternalDocColumnSchema getColumnSchema() {
   columnSchema = new InternalDocColumnSchemaImpl(numberOfColumns);
   XPath xpath = XPathFactory.newInstance().newXPath();
   for (Integer index : indexesTable.keySet()) {
     NodeList indexToColumnData = null;
     try {
       indexToColumnData =
           (NodeList)
               xpath.evaluate(
                   "//contact[count(*[@columnCounter="
                       + index
                       + "]) = "
                       + indexesTable.get(index).size()
                       + "][1]/*[@columnCounter="
                       + index
                       + "]",
                   compiledDoc,
                   XPathConstants.NODESET);
     } catch (XPathExpressionException ex) {
       Logger.getLogger(ReadCompiledDoc.class.getName()).log(Level.SEVERE, null, ex);
     }
     if (indexToColumnData == null) {
       System.err.println("Error while parsing compiled doc into column schema - errNo:4");
       return null;
     }
     int iterator = 0;
     for (Integer column : indexesTable.get(index)) {
       String type = ((Element) indexToColumnData.item(iterator)).getTagName();
       columnSchema.setCandidateType(column, type);
       columnSchema.setSelectedtypeType(column, type);
       iterator++;
     }
   }
   return columnSchema;
 }
Ejemplo n.º 2
0
 public InternalDocColumnSchema getColumnSchema() {
   InternalDocColumnSchema schema = new InternalDocColumnSchemaImpl(detectedTypes.size());
   for (int i = 0; i < detectedTypes.size(); i++) {
     schema.setCandidateType(i, detectedTypes.get(i).toString());
   }
   return schema;
 }