StringOutputAdapter
Contents
[
Hide
]
Inheritance: java.lang.Object, com.groupdocs.search.common.ResultBuilderFactory, com.groupdocs.search.common.OutputAdapter
All Implemented Interfaces: com.groupdocs.search.common.IStringOutputAdapter
public class StringOutputAdapter extends OutputAdapter implements IStringOutputAdapter
Represents an output adapter that collects output as a System.String .
Learn more
The example demonstrates a typical usage of the class.
String indexFolder = "c:\\MyIndex\\";
String documentsFolder = "c:\\MyDocuments\\";
Index index = new Index(indexFolder); // Creating an index in the specified folder
index.add(documentsFolder); // Indexing documents from the specified folder
DocumentInfo[] documents = index.getIndexedDocuments(); // Getting information on indexed documents
StringOutputAdapter adapter = new StringOutputAdapter(); // Creating a string output adapter
index.getDocumentText(documents[0], adapter); // Generating a document text into the adapter
String result = adapter.getResult(); // Getting a result
Constructors
Constructor | Description |
---|---|
StringOutputAdapter(OutputFormat outputFormat) | Initializes a new instance of the StringOutputAdapter class. |
Methods
Method | Description |
---|---|
getResult() | Gets the resulting string. |
StringOutputAdapter(OutputFormat outputFormat)
public StringOutputAdapter(OutputFormat outputFormat)
Initializes a new instance of the StringOutputAdapter class.
Parameters:
Parameter | Type | Description |
---|---|---|
outputFormat | OutputFormat | The output format. |
getResult()
public final String getResult()
Gets the resulting string.
Returns: java.lang.String - The resulting string.