public String getDocumentSummaryInformationText() { if(document == null) { // event based extractor does not have a document return ""; } DocumentSummaryInformation dsi = document.getDocumentSummaryInformation(); StringBuilder text = new StringBuilder(); // Normal properties text.append( getPropertiesText(dsi) ); // Now custom ones CustomProperties cps = dsi == null ? null : dsi.getCustomProperties(); if (cps != null) { for (String key : cps.nameSet()) { String val = getPropertyValueText(cps.get(key)); text.append(key).append(" = ").append(val).append("\n"); } } // All done return text.toString(); } public String getSummaryInformationText() {
private String getLanguage(DocumentSummaryInformation summary) { CustomProperties customProperties = summary.getCustomProperties(); if (customProperties != null) { Object value = customProperties.get("Language"); if (value instanceof String) { return (String) value; } } return null; }
Object value = customProperties.get(name); if (value instanceof String) { set(key, (String) value);
private String getLanguage(DocumentSummaryInformation summary) { CustomProperties customProperties = summary.getCustomProperties(); if (customProperties != null) { Object value = customProperties.get("Language"); if (value instanceof String) { return (String) value; } } return null; }
private String getLanguage(DocumentSummaryInformation summary) { CustomProperties customProperties = summary.getCustomProperties(); if (customProperties != null) { Object value = customProperties.get("Language"); if (value instanceof String) { return (String) value; } } return null; }
public String getDocumentSummaryInformationText() { DocumentSummaryInformation dsi = document.getDocumentSummaryInformation(); StringBuffer text = new StringBuffer(); // Normal properties text.append( getPropertiesText(dsi) ); // Now custom ones CustomProperties cps = dsi == null ? null : dsi.getCustomProperties(); if(cps != null) { Iterator<String> keys = cps.nameSet().iterator(); while(keys.hasNext()) { String key = keys.next(); String val = getPropertyValueText( cps.get(key) ); text.append(key + " = " + val + "\n"); } } // All done return text.toString(); } public String getSummaryInformationText() {
public String getDocumentSummaryInformationText() { DocumentSummaryInformation dsi = document.getDocumentSummaryInformation(); StringBuffer text = new StringBuffer(); // Normal properties text.append( getPropertiesText(dsi) ); // Now custom ones CustomProperties cps = dsi == null ? null : dsi.getCustomProperties(); if(cps != null) { Iterator<String> keys = cps.nameSet().iterator(); while(keys.hasNext()) { String key = keys.next(); String val = getPropertyValueText( cps.get(key) ); text.append(key + " = " + val + "\n"); } } // All done return text.toString(); } public String getSummaryInformationText() {
public String getDocumentSummaryInformationText() { if(document == null) { // event based extractor does not have a document return ""; } DocumentSummaryInformation dsi = document.getDocumentSummaryInformation(); StringBuilder text = new StringBuilder(); // Normal properties text.append( getPropertiesText(dsi) ); // Now custom ones CustomProperties cps = dsi == null ? null : dsi.getCustomProperties(); if (cps != null) { for (String key : cps.nameSet()) { String val = getPropertyValueText(cps.get(key)); text.append(key).append(" = ").append(val).append("\n"); } } // All done return text.toString(); } public String getSummaryInformationText() {
Object value = customProperties.get(name); if (value instanceof String) { set(key, (String) value);
Object value = customProperties.get(name); if (value instanceof String) { set(key, (String) value);
Object value = customProperties.get("Sample Number"); System.out.println("Custom Sample Number is now " + value);