public class JsonNestingLookup extends JsonLookup
JsonLookup.Pairtree| Constructor and Description |
|---|
JsonNestingLookup(InputStream istr,
String configRoot)
Create a JsonNestingLookup from an InputStream containing JSON.
|
JsonNestingLookup(Reader rdr,
String configRoot)
Create a JsonNestingLookup from a Reader containing JSON.
|
JsonNestingLookup(String name,
InputStream istr,
String configRoot)
Create a JsonNestingLookup from an InputStream containing JSON.
|
JsonNestingLookup(String name,
Reader rdr,
String configRoot)
Create a JsonNestingLookup from a Reader containing JSON.
|
JsonNestingLookup(String resourceName,
String configRoot)
Create a JsonNestingLookup from JSON in a resource file.
|
JsonNestingLookup(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 JsonNestingLookup(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 structure at which the configuration starts,
or null if the configuration starts at the root of the structure.public JsonNestingLookup(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 structure at which the configuration starts,
or null if the configuration starts at the root of the structure.public JsonNestingLookup(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 structure at which the configuration starts,
or null if the configuration starts at the root of the structure.public JsonNestingLookup(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 structure at which the configuration starts,
or null if the configuration starts at the root of the structure.public JsonNestingLookup(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 structure at which the configuration starts,
or null if the configuration starts at the root of the structure.public JsonNestingLookup(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 structure at which the configuration starts,
or null if the configuration starts at the root of the structure.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.