|
Carrot2 v3.5.2
API Documentation |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.carrot2.source.xml.XmlDocumentSourceDescriptor.AttributeBuilder
public static class XmlDocumentSourceDescriptor.AttributeBuilder
Attribute map builder for the XmlDocumentSource component. You can use this
builder as a type-safe alternative to populating the attribute map using attribute keys.
| Field Summary | |
|---|---|
Map<String,Object> |
map
The attribute map populated by this builder. |
| Constructor Summary | |
|---|---|
protected |
XmlDocumentSourceDescriptor.AttributeBuilder(Map<String,Object> map)
Creates a builder backed by the provided map. |
| Method Summary | |
|---|---|
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(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 |
results(int 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<? extends IResource> clazz)
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(Map<String,String> value)
Values for custom placeholders in the XML URL. |
XmlDocumentSourceDescriptor.AttributeBuilder |
xslt(Class<? extends IResource> clazz)
The resource to load XSLT stylesheet from. |
XmlDocumentSourceDescriptor.AttributeBuilder |
xslt(IResource value)
The resource to load XSLT stylesheet from. |
XmlDocumentSourceDescriptor.AttributeBuilder |
xsltParameters(Map<String,String> value)
Parameters to be passed to the XSLT transformer. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public final Map<String,Object> map
| Constructor Detail |
|---|
protected XmlDocumentSourceDescriptor.AttributeBuilder(Map<String,Object> map)
| Method Detail |
|---|
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<? extends IResource> 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 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<? extends IResource> 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 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 xsltParameters(Map<String,String> value)
XmlDocumentSource.xsltParameterspublic XmlDocumentSourceDescriptor.AttributeBuilder query(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 readAll(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 XmlDocumentSourceHelperDescriptor.AttributeBuilder xmlDocumentSourceHelper()
XmlDocumentSourceHelper component, backed by the same attribute map
as the current builder.
|
Please refer to project documentation at
http://project.carrot2.org |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||