org.apache.solr.core
Class Config
java.lang.Object
org.apache.solr.core.Config
- Direct Known Subclasses:
- SolrConfig
public class Config
- extends Object
Field Summary |
static org.slf4j.Logger |
log
|
Constructor Summary |
Config(SolrResourceLoader loader,
String name)
Builds a config from a resource name with no xpath prefix. |
Config(SolrResourceLoader loader,
String name,
Document doc)
|
Config(SolrResourceLoader loader,
String name,
InputSource is,
String prefix)
|
Config(SolrResourceLoader loader,
String name,
InputSource is,
String prefix,
boolean subProps)
Builds a config: |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
public static final org.slf4j.Logger log
Config
public Config(SolrResourceLoader loader,
String name)
throws ParserConfigurationException,
IOException,
SAXException
- Builds a config from a resource name with no xpath prefix.
- Throws:
ParserConfigurationException
IOException
SAXException
Config
public Config(SolrResourceLoader loader,
String name,
InputSource is,
String prefix)
throws ParserConfigurationException,
IOException,
SAXException
- Throws:
ParserConfigurationException
IOException
SAXException
Config
public Config(SolrResourceLoader loader,
String name,
InputSource is,
String prefix,
boolean subProps)
throws ParserConfigurationException,
IOException,
SAXException
- Builds a config:
Note that the 'name' parameter is used to obtain a valid input stream if no valid one is provided through 'is'.
If no valid stream is provided, a valid SolrResourceLoader instance should be provided through 'loader' so
the resource can be opened (@see SolrResourceLoader#openResource); if no SolrResourceLoader instance is provided, a default one
will be created.
Consider passing a non-null 'name' parameter in all use-cases since it is used for logging & exception reporting.
- Parameters:
loader
- the resource loader used to obtain an input stream if 'is' is nullname
- the resource name used if the input stream 'is' is nullis
- the resource as a SAX InputSourceprefix
- an optional prefix that will be preprended to all non-absolute xpath expressions
- Throws:
ParserConfigurationException
IOException
SAXException
Config
public Config(SolrResourceLoader loader,
String name,
Document doc)
getResourceLoader
public SolrResourceLoader getResourceLoader()
- Since:
- solr 1.3
getResourceName
public String getResourceName()
- Since:
- solr 1.3
getName
public String getName()
getDocument
public Document getDocument()
getXPath
public XPath getXPath()
substituteProperties
public void substituteProperties()
evaluate
public Object evaluate(String path,
QName type)
getNode
public Node getNode(String path,
boolean errIfMissing)
getVal
public String getVal(String path,
boolean errIfMissing)
get
public String get(String path)
get
public String get(String path,
String def)
getInt
public int getInt(String path)
getInt
public int getInt(String path,
int def)
getBool
public boolean getBool(String path)
getBool
public boolean getBool(String path,
boolean def)
getFloat
public float getFloat(String path)
getFloat
public float getFloat(String path,
float def)
getDouble
public double getDouble(String path)
getDouble
public double getDouble(String path,
double def)
getLuceneVersion
public Version getLuceneVersion(String path)
getLuceneVersion
public Version getLuceneVersion(String path,
Version def)
parseLuceneVersionString
public static final Version parseLuceneVersionString(String matchVersion)
Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.