org.apache.solr.core
Class Config

java.lang.Object
  extended by org.apache.solr.core.Config

public class Config
extends Object

Version:
$Id: Config.java 542679 2007-05-29 22:28:21Z ryan $
Author:
yonik

Field Summary
static Logger log
           
 
Constructor Summary
Config(String name, InputStream is, String prefix)
           
 
Method Summary
 Object evaluate(String path, QName type)
           
static Class findClass(String cname, String... subpackages)
           
 String get(String path)
           
 String get(String path, String def)
           
 boolean getBool(String path)
           
 boolean getBool(String path, boolean def)
           
 Document getDocument()
           
 float getFloat(String path)
           
 float getFloat(String path, float def)
           
static String getInstanceDir()
           
 int getInt(String path)
           
 int getInt(String path, int def)
           
static List<String> getLines(String resource)
          Accesses a resource by name and returns the (non comment) lines containing data.
 Node getNode(String path, boolean errIfMissing)
           
 String getVal(String path, boolean errIfMissing)
           
 XPath getXPath()
           
static boolean isInstanceDirInitialized()
           
static Object newInstance(String cname, String... subpackages)
           
static InputStream openResource(String resource)
           
static void setInstanceDir(String dir)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

public static final Logger log
Constructor Detail

Config

public Config(String name,
              InputStream is,
              String prefix)
       throws ParserConfigurationException,
              IOException,
              SAXException
Throws:
ParserConfigurationException
IOException
SAXException
Method Detail

getDocument

public Document getDocument()

getXPath

public XPath getXPath()

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)

findClass

public static Class findClass(String cname,
                              String... subpackages)

newInstance

public static Object newInstance(String cname,
                                 String... subpackages)

setInstanceDir

public static void setInstanceDir(String dir)

getInstanceDir

public static String getInstanceDir()

isInstanceDirInitialized

public static boolean isInstanceDirInitialized()

openResource

public static InputStream openResource(String resource)

getLines

public static List<String> getLines(String resource)
                             throws IOException
Accesses a resource by name and returns the (non comment) lines containing data.

A comment line is any line that starts with the character "#"

Parameters:
resource -
Returns:
a list of non-blank non-comment lines with whitespace trimmed from front and back.
Throws:
IOException


Copyright © 2006 - 2009 The Apache Software Foundation