public class JsonFlatLookup extends JsonLookup
JsonLookup.Pairtree| Constructor and Description |
|---|
JsonFlatLookup(InputStream istr,
String configRoot)
Create a JsonNestingLookup from an InputStream containing JSON.
|
JsonFlatLookup(Reader rdr,
String configRoot)
Create a JsonNestingLookup from a Reader containing JSON.
|
JsonFlatLookup(String name,
InputStream istr,
String configRoot)
Create a JsonNestingLookup from an InputStream containing JSON.
|
JsonFlatLookup(String name,
Reader rdr,
String configRoot)
Create a JsonNestingLookup from a Reader containing JSON.
|
JsonFlatLookup(String resourceName,
String configRoot)
Create a JsonNestingLookup from JSON in a resource file.
|
JsonFlatLookup(String name,
String resourceName,
String configRoot)
Create a JsonNestingLookup from JSON in a resource file.
|
| Modifier and Type | Method and Description |
|---|---|
String |
nameFromFragments(List<String> fragments)
Assemble an attribute name that conforms to this Lookup's naming scheme from the provided list of name fragments.
|
String |
valueFromName(String name,
Class singletonType)
Perform the actual lookup characteristic of this Lookup.
|
valueFromName, valueFromNamecapitalize, getNamepublic JsonFlatLookup(Reader rdr, String configRoot)
rdr - Reader containing a complete JSON structure with an unnamed JSON object at the top level.configRoot - JavaScript notation for the location in the JSON structure of the object containing the
configuration.public JsonFlatLookup(InputStream istr, String configRoot)
istr - InputStream containing a complete JSON structure with an unnamed JSON object at the top level.configRoot - JavaScript notation for the location in the JSON structure of the object containing the
configuration.public JsonFlatLookup(String resourceName, String configRoot)
resourceName - Name of a resource file containing a JSON structure with an unnamed JSON object at the top level.configRoot - JavaScript notation for the location in the JSON structure of the object containing the
configuration.public JsonFlatLookup(String name, Reader rdr, String configRoot)
name - Name to be used in forensics for this Lookuprdr - Reader containing a complete JSON structure with an unnamed JSON object at the top level.configRoot - JavaScript notation for the location in the JSON structure of the object containing the
configuration.public JsonFlatLookup(String name, InputStream istr, String configRoot)
name - Name to be used in forensics for this Lookupistr - InputStream containing a complete JSON structure with an unnamed JSON object at the top level.configRoot - JavaScript notation for the location in the JSON structure of the object containing the
configuration.public JsonFlatLookup(String name, String resourceName, String configRoot)
name - Name to be used in forensics for this LookupresourceName - Name of a resource file containing a JSON structure with an unnamed JSON object at the top level.configRoot - JavaScript notation for the location in the JSON structure of the object containing the
configuration.public String nameFromFragments(List<String> fragments)
LookupnameFromFragments in class Lookupfragments - This will be the camel-cased name of the method from your configuration interface, broken apart
into fragments. For example, "threadPoolSize" will become {"thread", "Pool", "Size"} and
"weatherServiceBaseURL" will become {"weather", "Service", "Base", "URL"}.public String valueFromName(String name, Class singletonType)
LookupvalueFromName in class Lookupname - The name of the value to look up, in this Lookup's naming scheme. For example, if the configuration
interface's method name is "threadPoolSize" and nameFromFragments converts that to "thread.pool.size,"
then this method will receive "thread.pool.size" as the name to look up.singletonType - This is the configuration interface that's being satisfied. Mostly you'll ignore this
parameter, but you might find it useful for composing error messages or logging.Copyright © 2017. All rights reserved.