|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.solr.core.Config
public class Config
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: |
Method Summary | |
---|---|
void |
complainAboutUnknownAttributes(String elementXpath,
String... knownAttributes)
Logs an error and throws an exception if any of the element(s) at the given elementXpath contains an attribute name that is not among knownAttributes. |
Object |
evaluate(String path,
QName type)
|
String |
get(String path)
|
String |
get(String path,
String def)
|
boolean |
getBool(String path)
|
boolean |
getBool(String path,
boolean def)
|
Document |
getDocument()
|
double |
getDouble(String path)
|
double |
getDouble(String path,
double def)
|
float |
getFloat(String path)
|
float |
getFloat(String path,
float def)
|
int |
getInt(String path)
|
int |
getInt(String path,
int def)
|
Version |
getLuceneVersion(String path)
|
Version |
getLuceneVersion(String path,
Version def)
|
String |
getName()
|
Node |
getNode(String path,
boolean errifMissing)
|
Node |
getNode(String path,
Document doc,
boolean errIfMissing)
|
NodeList |
getNodeList(String path,
boolean errIfMissing)
|
Config |
getOriginalConfig()
|
SolrResourceLoader |
getResourceLoader()
|
String |
getResourceName()
|
Set<String> |
getUnknownAttributes(Element element,
String... knownAttributes)
Returns the set of attributes on the given element that are not among the given knownAttributes, or null if all attributes are known. |
Node |
getUnsubstitutedNode(String path,
boolean errIfMissing)
|
String |
getVal(String path,
boolean errIfMissing)
|
XPath |
getXPath()
|
static Version |
parseLuceneVersionString(String matchVersion)
|
void |
substituteProperties()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final org.slf4j.Logger log
Constructor Detail |
---|
public Config(SolrResourceLoader loader, String name) throws ParserConfigurationException, IOException, SAXException
ParserConfigurationException
IOException
SAXException
public Config(SolrResourceLoader loader, String name, InputSource is, String prefix) throws ParserConfigurationException, IOException, SAXException
ParserConfigurationException
IOException
SAXException
public Config(SolrResourceLoader loader, String name, InputSource is, String prefix, boolean subProps) throws ParserConfigurationException, IOException, SAXException
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.
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
ParserConfigurationException
IOException
SAXException
public Config(SolrResourceLoader loader, String name, Document doc)
Method Detail |
---|
public SolrResourceLoader getResourceLoader()
public String getResourceName()
public String getName()
public Document getDocument()
public XPath getXPath()
public void substituteProperties()
public Object evaluate(String path, QName type)
public Node getNode(String path, boolean errifMissing)
public Node getUnsubstitutedNode(String path, boolean errIfMissing)
public Node getNode(String path, Document doc, boolean errIfMissing)
public NodeList getNodeList(String path, boolean errIfMissing)
public Set<String> getUnknownAttributes(Element element, String... knownAttributes)
public void complainAboutUnknownAttributes(String elementXpath, String... knownAttributes)
public String getVal(String path, boolean errIfMissing)
public String get(String path)
public String get(String path, String def)
public int getInt(String path)
public int getInt(String path, int def)
public boolean getBool(String path)
public boolean getBool(String path, boolean def)
public float getFloat(String path)
public float getFloat(String path, float def)
public double getDouble(String path)
public double getDouble(String path, double def)
public Version getLuceneVersion(String path)
public Version getLuceneVersion(String path, Version def)
public static final Version parseLuceneVersionString(String matchVersion)
public Config getOriginalConfig()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |