public static class XmlDocumentSourceDescriptor.AttributeBuilder extends Object
XmlDocumentSource component. You can use this
builder as a type-safe alternative to populating the attribute map using attribute keys.| Modifier and Type | Field and Description |
|---|---|
Map<String,Object> |
map
The attribute map populated by this builder.
|
| Modifier | Constructor and Description |
|---|---|
protected |
XmlDocumentSourceDescriptor.AttributeBuilder(Map<String,Object> map)
Creates a builder backed by the provided map.
|
| Modifier and Type | Method and Description |
|---|---|
List<Cluster> |
clusters()
If
XmlDocumentSource.readClusters is true and clusters are present in the input
XML, they will be deserialized and exposed to components further down the processing
chain. |
XmlDocumentSourceDescriptor.AttributeBuilder |
clusters(org.carrot2.util.attribute.IObjectFactory<? extends List<Cluster>> value)
If
XmlDocumentSource.readClusters is true and clusters are present in the input
XML, they will be deserialized and exposed to components further down the processing
chain. |
XmlDocumentSourceDescriptor.AttributeBuilder |
clusters(List<Cluster> value)
If
XmlDocumentSource.readClusters is true and clusters are present in the input
XML, they will be deserialized and exposed to components further down the processing
chain. |
List<Document> |
documents()
Documents read from the XML data.
|
String |
query()
After processing this field may hold the query read from the XML data, if any.
|
XmlDocumentSourceDescriptor.AttributeBuilder |
query(org.carrot2.util.attribute.IObjectFactory<? extends String> value)
After processing this field may hold the query read from the XML data, if any.
|
XmlDocumentSourceDescriptor.AttributeBuilder |
query(String value)
After processing this field may hold the query read from the XML data, if any.
|
XmlDocumentSourceDescriptor.AttributeBuilder |
readAll(boolean value)
If
true, all documents are read from the input XML stream, regardless
of the limit set by XmlDocumentSource.results. |
XmlDocumentSourceDescriptor.AttributeBuilder |
readAll(org.carrot2.util.attribute.IObjectFactory<? extends Boolean> value)
If
true, all documents are read from the input XML stream, regardless
of the limit set by XmlDocumentSource.results. |
XmlDocumentSourceDescriptor.AttributeBuilder |
readClusters(boolean value)
If clusters are present in the input XML they will be read and exposed to components
further down the processing chain.
|
XmlDocumentSourceDescriptor.AttributeBuilder |
readClusters(org.carrot2.util.attribute.IObjectFactory<? extends Boolean> value)
If clusters are present in the input XML they will be read and exposed to components
further down the processing chain.
|
XmlDocumentSourceDescriptor.AttributeBuilder |
results(int value)
The maximum number of documents to read from the XML data if
XmlDocumentSource.readAll is
false. |
XmlDocumentSourceDescriptor.AttributeBuilder |
results(org.carrot2.util.attribute.IObjectFactory<? extends Integer> value)
The maximum number of documents to read from the XML data if
XmlDocumentSource.readAll is
false. |
String |
title()
The title (file name or query attribute, if present) for the search result fetched
from the resource.
|
XmlDocumentSourceDescriptor.AttributeBuilder |
xml(Class<?> clazz)
The resource to load XML data from.
|
XmlDocumentSourceDescriptor.AttributeBuilder |
xml(org.carrot2.util.attribute.IObjectFactory<? extends IResource> value)
The resource to load XML data from.
|
XmlDocumentSourceDescriptor.AttributeBuilder |
xml(IResource value)
The resource to load XML data from.
|
XmlDocumentSourceHelperDescriptor.AttributeBuilder |
xmlDocumentSourceHelper()
Returns an attribute builder for the nested
XmlDocumentSourceHelper component, backed by the same attribute map
as the current builder. |
XmlDocumentSourceDescriptor.AttributeBuilder |
xmlParameters(org.carrot2.util.attribute.IObjectFactory<? extends Map<String,String>> value)
Values for custom placeholders in the XML URL.
|
XmlDocumentSourceDescriptor.AttributeBuilder |
xmlParameters(Map<String,String> value)
Values for custom placeholders in the XML URL.
|
XmlDocumentSourceDescriptor.AttributeBuilder |
xslt(Class<?> clazz)
The resource to load XSLT stylesheet from.
|
XmlDocumentSourceDescriptor.AttributeBuilder |
xslt(org.carrot2.util.attribute.IObjectFactory<? extends IResource> value)
The resource to load XSLT stylesheet from.
|
XmlDocumentSourceDescriptor.AttributeBuilder |
xslt(IResource value)
The resource to load XSLT stylesheet from.
|
XmlDocumentSourceDescriptor.AttributeBuilder |
xsltParameters(org.carrot2.util.attribute.IObjectFactory<? extends Map<String,String>> value)
Parameters to be passed to the XSLT transformer.
|
XmlDocumentSourceDescriptor.AttributeBuilder |
xsltParameters(Map<String,String> value)
Parameters to be passed to the XSLT transformer.
|
public XmlDocumentSourceDescriptor.AttributeBuilder xml(IResource value)
IResource implementations directly or use
ResourceLookup to look up
IResource instances from a variety of locations.
One special IResource implementation you can use is
URLResourceWithParams. It allows you to specify attribute placeholders in
the URL that will be replaced with actual values at runtime. The placeholder format
is ${attribute}. The following common attributes will be substituted:
query will be replaced with the current query being processed. If
the query has not been provided, this attribute will fall back to an empty string.results will be replaced with the number of results requested. If
the number of results has not been provided, this attribute will be substituted
with an empty string.
Additionally, custom placeholders can be used. Values for the custom placeholders
should be provided in the XmlDocumentSource.xmlParameters attribute.
XmlDocumentSource.xmlpublic XmlDocumentSourceDescriptor.AttributeBuilder xml(Class<?> clazz)
IResource implementations directly or use
ResourceLookup to look up
IResource instances from a variety of locations.
One special IResource implementation you can use is
URLResourceWithParams. It allows you to specify attribute placeholders in
the URL that will be replaced with actual values at runtime. The placeholder format
is ${attribute}. The following common attributes will be substituted:
query will be replaced with the current query being processed. If
the query has not been provided, this attribute will fall back to an empty string.results will be replaced with the number of results requested. If
the number of results has not been provided, this attribute will be substituted
with an empty string.
Additionally, custom placeholders can be used. Values for the custom placeholders
should be provided in the XmlDocumentSource.xmlParameters attribute.
XmlDocumentSource.xmlpublic XmlDocumentSourceDescriptor.AttributeBuilder xml(org.carrot2.util.attribute.IObjectFactory<? extends IResource> value)
IResource implementations directly or use
ResourceLookup to look up
IResource instances from a variety of locations.
One special IResource implementation you can use is
URLResourceWithParams. It allows you to specify attribute placeholders in
the URL that will be replaced with actual values at runtime. The placeholder format
is ${attribute}. The following common attributes will be substituted:
query will be replaced with the current query being processed. If
the query has not been provided, this attribute will fall back to an empty string.results will be replaced with the number of results requested. If
the number of results has not been provided, this attribute will be substituted
with an empty string.
Additionally, custom placeholders can be used. Values for the custom placeholders
should be provided in the XmlDocumentSource.xmlParameters attribute.
XmlDocumentSource.xmlpublic XmlDocumentSourceDescriptor.AttributeBuilder xslt(IResource value)
Documents.
The XSLT IResource can be provided both on initialization and processing
time. The stylesheet provided on initialization will be cached for the life time of
the component, while processing-time style sheets will be compiled every time
processing is requested and will override the initialization-time stylesheet.
To pass additional parameters to the XSLT transformer, use the
XmlDocumentSource.xsltParameters attribute.
XmlDocumentSource.xsltpublic XmlDocumentSourceDescriptor.AttributeBuilder xslt(Class<?> clazz)
Documents.
The XSLT IResource can be provided both on initialization and processing
time. The stylesheet provided on initialization will be cached for the life time of
the component, while processing-time style sheets will be compiled every time
processing is requested and will override the initialization-time stylesheet.
To pass additional parameters to the XSLT transformer, use the
XmlDocumentSource.xsltParameters attribute.
XmlDocumentSource.xsltpublic XmlDocumentSourceDescriptor.AttributeBuilder xslt(org.carrot2.util.attribute.IObjectFactory<? extends IResource> value)
Documents.
The XSLT IResource can be provided both on initialization and processing
time. The stylesheet provided on initialization will be cached for the life time of
the component, while processing-time style sheets will be compiled every time
processing is requested and will override the initialization-time stylesheet.
To pass additional parameters to the XSLT transformer, use the
XmlDocumentSource.xsltParameters attribute.
XmlDocumentSource.xsltpublic XmlDocumentSourceDescriptor.AttributeBuilder xmlParameters(Map<String,String> value)
XmlDocumentSource.xml attribute is URLResourceWithParams, this map provides
values for custom placeholders found in the XML URL. Keys of the map correspond to
placeholder names, values of the map will be used to replace the placeholders.
Please see XmlDocumentSource.xml for the placeholder syntax.XmlDocumentSource.xmlParameterspublic XmlDocumentSourceDescriptor.AttributeBuilder xmlParameters(org.carrot2.util.attribute.IObjectFactory<? extends Map<String,String>> value)
XmlDocumentSource.xml attribute is URLResourceWithParams, this map provides
values for custom placeholders found in the XML URL. Keys of the map correspond to
placeholder names, values of the map will be used to replace the placeholders.
Please see XmlDocumentSource.xml for the placeholder syntax.XmlDocumentSource.xmlParameterspublic XmlDocumentSourceDescriptor.AttributeBuilder xsltParameters(Map<String,String> value)
XmlDocumentSource.xsltParameterspublic XmlDocumentSourceDescriptor.AttributeBuilder xsltParameters(org.carrot2.util.attribute.IObjectFactory<? extends Map<String,String>> value)
XmlDocumentSource.xsltParameterspublic XmlDocumentSourceDescriptor.AttributeBuilder query(String value)
XmlDocumentSource.xml.XmlDocumentSource.querypublic XmlDocumentSourceDescriptor.AttributeBuilder query(org.carrot2.util.attribute.IObjectFactory<? extends String> value)
XmlDocumentSource.xml.XmlDocumentSource.querypublic String query()
XmlDocumentSource.xml.XmlDocumentSource.querypublic XmlDocumentSourceDescriptor.AttributeBuilder results(int value)
XmlDocumentSource.readAll is
false.XmlDocumentSource.resultspublic XmlDocumentSourceDescriptor.AttributeBuilder results(org.carrot2.util.attribute.IObjectFactory<? extends Integer> value)
XmlDocumentSource.readAll is
false.XmlDocumentSource.resultspublic XmlDocumentSourceDescriptor.AttributeBuilder readClusters(boolean value)
XmlDocumentSource.readClusterspublic XmlDocumentSourceDescriptor.AttributeBuilder readClusters(org.carrot2.util.attribute.IObjectFactory<? extends Boolean> value)
XmlDocumentSource.readClusterspublic XmlDocumentSourceDescriptor.AttributeBuilder readAll(boolean value)
true, all documents are read from the input XML stream, regardless
of the limit set by XmlDocumentSource.results.XmlDocumentSource.readAllpublic XmlDocumentSourceDescriptor.AttributeBuilder readAll(org.carrot2.util.attribute.IObjectFactory<? extends Boolean> value)
true, all documents are read from the input XML stream, regardless
of the limit set by XmlDocumentSource.results.XmlDocumentSource.readAllpublic String title()
XmlDocumentSource.titlepublic List<Document> documents()
XmlDocumentSource.documentspublic XmlDocumentSourceDescriptor.AttributeBuilder clusters(List<Cluster> value)
XmlDocumentSource.readClusters is true and clusters are present in the input
XML, they will be deserialized and exposed to components further down the processing
chain.XmlDocumentSource.clusterspublic XmlDocumentSourceDescriptor.AttributeBuilder clusters(org.carrot2.util.attribute.IObjectFactory<? extends List<Cluster>> value)
XmlDocumentSource.readClusters is true and clusters are present in the input
XML, they will be deserialized and exposed to components further down the processing
chain.XmlDocumentSource.clusterspublic List<Cluster> clusters()
XmlDocumentSource.readClusters is true and clusters are present in the input
XML, they will be deserialized and exposed to components further down the processing
chain.XmlDocumentSource.clusterspublic XmlDocumentSourceHelperDescriptor.AttributeBuilder xmlDocumentSourceHelper()
XmlDocumentSourceHelper component, backed by the same attribute map
as the current builder.