Package com.typesafe.config.impl
Class Parseable
- java.lang.Object
-
- com.typesafe.config.impl.Parseable
-
- All Implemented Interfaces:
ConfigParseable
public abstract class Parseable extends java.lang.Object implements ConfigParseable
This is public but it's only for use by the config package; DO NOT TOUCH. The point of this class is to avoid "propagating" each overload on "thing which can be parsed" through multiple interfaces. Most interfaces can have just one overload that takes a Parseable. Also it's used as an abstract "resource handle" in the ConfigIncluder interface.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Parseable()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract ConfigOrigin
createOrigin()
static Parseable
newFile(java.io.File input, ConfigParseOptions options)
static Parseable
newNotFound(java.lang.String whatNotFound, java.lang.String message, ConfigParseOptions options)
static Parseable
newProperties(java.util.Properties properties, ConfigParseOptions options)
static Parseable
newReader(java.io.Reader reader, ConfigParseOptions options)
note that we will never close this reader; you have to do it when parsing is complete.static Parseable
newResources(java.lang.Class<?> klass, java.lang.String resource, ConfigParseOptions options)
static Parseable
newResources(java.lang.String resource, ConfigParseOptions options)
static Parseable
newString(java.lang.String input, ConfigParseOptions options)
static Parseable
newURL(java.net.URL input, ConfigParseOptions options)
ConfigParseOptions
options()
Get the initial options, which can be modified then passed to parse().ConfigOrigin
origin()
Returns aConfigOrigin
describing the origin of the parseable item.ConfigObject
parse()
ConfigObject
parse(ConfigParseOptions baseOptions)
Parse whatever it is.protected void
postConstruct(ConfigParseOptions baseOptions)
protected com.typesafe.config.impl.AbstractConfigValue
rawParseValue(ConfigOrigin origin, ConfigParseOptions finalOptions)
protected com.typesafe.config.impl.AbstractConfigValue
rawParseValue(java.io.Reader reader, ConfigOrigin origin, ConfigParseOptions finalOptions)
protected abstract java.io.Reader
reader()
java.lang.String
toString()
protected static void
trace(java.lang.String message)
-
-
-
Method Detail
-
postConstruct
protected void postConstruct(ConfigParseOptions baseOptions)
-
reader
protected abstract java.io.Reader reader() throws java.io.IOException
- Throws:
java.io.IOException
-
trace
protected static void trace(java.lang.String message)
-
parse
public ConfigObject parse(ConfigParseOptions baseOptions)
Description copied from interface:ConfigParseable
Parse whatever it is. The options should come fromoptions()
but you could tweak them if you like.- Specified by:
parse
in interfaceConfigParseable
- Parameters:
baseOptions
- parse options, should be based on the ones fromoptions()
-
rawParseValue
protected com.typesafe.config.impl.AbstractConfigValue rawParseValue(ConfigOrigin origin, ConfigParseOptions finalOptions) throws java.io.IOException
- Throws:
java.io.IOException
-
rawParseValue
protected com.typesafe.config.impl.AbstractConfigValue rawParseValue(java.io.Reader reader, ConfigOrigin origin, ConfigParseOptions finalOptions) throws java.io.IOException
- Throws:
java.io.IOException
-
parse
public ConfigObject parse()
-
origin
public final ConfigOrigin origin()
Description copied from interface:ConfigParseable
Returns aConfigOrigin
describing the origin of the parseable item.- Specified by:
origin
in interfaceConfigParseable
-
createOrigin
protected abstract ConfigOrigin createOrigin()
-
options
public ConfigParseOptions options()
Description copied from interface:ConfigParseable
Get the initial options, which can be modified then passed to parse(). These options will have the right description, includer, and other parameters already set up.- Specified by:
options
in interfaceConfigParseable
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
newNotFound
public static Parseable newNotFound(java.lang.String whatNotFound, java.lang.String message, ConfigParseOptions options)
-
newReader
public static Parseable newReader(java.io.Reader reader, ConfigParseOptions options)
note that we will never close this reader; you have to do it when parsing is complete.
-
newString
public static Parseable newString(java.lang.String input, ConfigParseOptions options)
-
newURL
public static Parseable newURL(java.net.URL input, ConfigParseOptions options)
-
newFile
public static Parseable newFile(java.io.File input, ConfigParseOptions options)
-
newResources
public static Parseable newResources(java.lang.Class<?> klass, java.lang.String resource, ConfigParseOptions options)
-
newResources
public static Parseable newResources(java.lang.String resource, ConfigParseOptions options)
-
newProperties
public static Parseable newProperties(java.util.Properties properties, ConfigParseOptions options)
-
-